katalyst-govuk-formbuilder 1.3.2 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (134) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/katalyst/govuk/formbuilder.scss +1 -1
  3. data/lib/katalyst/govuk/formbuilder/engine.rb +1 -0
  4. data/lib/katalyst/govuk/formbuilder/version.rb +1 -1
  5. data/vendor/assets/stylesheets/govuk-frontend/govuk/_base.scss +3 -0
  6. data/vendor/assets/stylesheets/govuk-frontend/govuk/all-ie8.scss +6 -0
  7. data/vendor/assets/stylesheets/govuk-frontend/govuk/all.scss +9 -0
  8. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/_all.scss +34 -0
  9. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/accordion/_accordion.scss +2 -0
  10. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/accordion/_index.scss +392 -0
  11. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/back-link/_back-link.scss +2 -0
  12. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/back-link/_index.scss +99 -0
  13. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/breadcrumbs/_breadcrumbs.scss +2 -0
  14. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/breadcrumbs/_index.scss +147 -0
  15. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/button/_button.scss +2 -0
  16. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/button/_index.scss +295 -0
  17. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/character-count/_character-count.scss +2 -0
  18. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/character-count/_index.scss +34 -0
  19. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/checkboxes/_checkboxes.scss +2 -0
  20. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/checkboxes/_index.scss +335 -0
  21. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/cookie-banner/_cookie-banner.scss +2 -0
  22. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/cookie-banner/_index.scss +49 -0
  23. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/date-input/_date-input.scss +2 -0
  24. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/date-input/_index.scss +26 -0
  25. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/details/_details.scss +2 -0
  26. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/details/_index.scss +88 -0
  27. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/error-message/_error-message.scss +2 -0
  28. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/error-message/_index.scss +12 -0
  29. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/error-summary/_error-summary.scss +2 -0
  30. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/error-summary/_index.scss +43 -0
  31. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/fieldset/_fieldset.scss +2 -0
  32. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/fieldset/_index.scss +64 -0
  33. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/file-upload/_file-upload.scss +2 -0
  34. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/file-upload/_index.scss +50 -0
  35. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/footer/_footer.scss +2 -0
  36. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/footer/_index.scss +200 -0
  37. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/header/_header.scss +2 -0
  38. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/header/_index.scss +349 -0
  39. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/hint/_hint.scss +2 -0
  40. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/hint/_index.scss +42 -0
  41. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/input/_index.scss +181 -0
  42. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/input/_input.scss +2 -0
  43. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/inset-text/_index.scss +24 -0
  44. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/inset-text/_inset-text.scss +2 -0
  45. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/label/_index.scss +41 -0
  46. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/label/_label.scss +2 -0
  47. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/notification-banner/_index.scss +89 -0
  48. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/notification-banner/_notification-banner.scss +2 -0
  49. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/pagination/_index.scss +247 -0
  50. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/pagination/_pagination.scss +2 -0
  51. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/panel/_index.scss +56 -0
  52. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/panel/_panel.scss +2 -0
  53. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/phase-banner/_index.scss +27 -0
  54. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/phase-banner/_phase-banner.scss +2 -0
  55. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/radios/_index.scss +349 -0
  56. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/radios/_radios.scss +2 -0
  57. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/select/_index.scss +60 -0
  58. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/select/_select.scss +2 -0
  59. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/skip-link/_index.scss +47 -0
  60. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/skip-link/_skip-link.scss +2 -0
  61. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/summary-list/_index.scss +276 -0
  62. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/summary-list/_summary-list.scss +2 -0
  63. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/table/_index.scss +71 -0
  64. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/table/_table.scss +2 -0
  65. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/tabs/_index.scss +130 -0
  66. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/tabs/_tabs.scss +2 -0
  67. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/tag/_index.scss +81 -0
  68. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/tag/_tag.scss +2 -0
  69. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/textarea/_index.scss +47 -0
  70. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/textarea/_textarea.scss +2 -0
  71. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/warning-text/_index.scss +66 -0
  72. data/vendor/assets/stylesheets/govuk-frontend/govuk/components/warning-text/_warning-text.scss +2 -0
  73. data/vendor/assets/stylesheets/govuk-frontend/govuk/core/_all.scss +5 -0
  74. data/vendor/assets/stylesheets/govuk-frontend/govuk/core/_global-styles.scss +19 -0
  75. data/vendor/assets/stylesheets/govuk-frontend/govuk/core/_links.scss +35 -0
  76. data/vendor/assets/stylesheets/govuk-frontend/govuk/core/_lists.scss +66 -0
  77. data/vendor/assets/stylesheets/govuk-frontend/govuk/core/_section-break.scss +56 -0
  78. data/vendor/assets/stylesheets/govuk-frontend/govuk/core/_typography.scss +186 -0
  79. data/vendor/assets/stylesheets/govuk-frontend/govuk/helpers/_all.scss +12 -0
  80. data/vendor/assets/stylesheets/govuk-frontend/govuk/helpers/_clearfix.scss +15 -0
  81. data/vendor/assets/stylesheets/govuk-frontend/govuk/helpers/_colour.scss +95 -0
  82. data/vendor/assets/stylesheets/govuk-frontend/govuk/helpers/_device-pixels.scss +37 -0
  83. data/vendor/assets/stylesheets/govuk-frontend/govuk/helpers/_focused.scss +33 -0
  84. data/vendor/assets/stylesheets/govuk-frontend/govuk/helpers/_font-faces.scss +41 -0
  85. data/vendor/assets/stylesheets/govuk-frontend/govuk/helpers/_grid.scss +61 -0
  86. data/vendor/assets/stylesheets/govuk-frontend/govuk/helpers/_links.scss +429 -0
  87. data/vendor/assets/stylesheets/govuk-frontend/govuk/helpers/_media-queries.scss +91 -0
  88. data/vendor/assets/stylesheets/govuk-frontend/govuk/helpers/_shape-arrow.scss +80 -0
  89. data/vendor/assets/stylesheets/govuk-frontend/govuk/helpers/_spacing.scss +171 -0
  90. data/vendor/assets/stylesheets/govuk-frontend/govuk/helpers/_typography.scss +214 -0
  91. data/vendor/assets/stylesheets/govuk-frontend/govuk/helpers/_visually-hidden.scss +84 -0
  92. data/vendor/assets/stylesheets/govuk-frontend/govuk/objects/_all.scss +6 -0
  93. data/vendor/assets/stylesheets/govuk-frontend/govuk/objects/_button-group.scss +85 -0
  94. data/vendor/assets/stylesheets/govuk-frontend/govuk/objects/_form-group.scss +23 -0
  95. data/vendor/assets/stylesheets/govuk-frontend/govuk/objects/_grid.scss +24 -0
  96. data/vendor/assets/stylesheets/govuk-frontend/govuk/objects/_main-wrapper.scss +53 -0
  97. data/vendor/assets/stylesheets/govuk-frontend/govuk/objects/_template.scss +32 -0
  98. data/vendor/assets/stylesheets/govuk-frontend/govuk/objects/_width-container.scss +84 -0
  99. data/vendor/assets/stylesheets/govuk-frontend/govuk/overrides/_all.scss +5 -0
  100. data/vendor/assets/stylesheets/govuk-frontend/govuk/overrides/_display.scss +24 -0
  101. data/vendor/assets/stylesheets/govuk-frontend/govuk/overrides/_spacing.scss +102 -0
  102. data/vendor/assets/stylesheets/govuk-frontend/govuk/overrides/_text-align.scss +14 -0
  103. data/vendor/assets/stylesheets/govuk-frontend/govuk/overrides/_typography.scss +21 -0
  104. data/vendor/assets/stylesheets/govuk-frontend/govuk/overrides/_width.scss +46 -0
  105. data/vendor/assets/stylesheets/govuk-frontend/govuk/settings/_all.scss +24 -0
  106. data/vendor/assets/stylesheets/govuk-frontend/govuk/settings/_assets.scss +82 -0
  107. data/vendor/assets/stylesheets/govuk-frontend/govuk/settings/_colours-applied.scss +155 -0
  108. data/vendor/assets/stylesheets/govuk-frontend/govuk/settings/_colours-organisations.scss +142 -0
  109. data/vendor/assets/stylesheets/govuk-frontend/govuk/settings/_colours-palette.scss +120 -0
  110. data/vendor/assets/stylesheets/govuk-frontend/govuk/settings/_compatibility.scss +100 -0
  111. data/vendor/assets/stylesheets/govuk-frontend/govuk/settings/_global-styles.scss +13 -0
  112. data/vendor/assets/stylesheets/govuk-frontend/govuk/settings/_ie8.scss +18 -0
  113. data/vendor/assets/stylesheets/govuk-frontend/govuk/settings/_links.scss +62 -0
  114. data/vendor/assets/stylesheets/govuk-frontend/govuk/settings/_measurements.scss +95 -0
  115. data/vendor/assets/stylesheets/govuk-frontend/govuk/settings/_media-queries.scss +23 -0
  116. data/vendor/assets/stylesheets/govuk-frontend/govuk/settings/_spacing.scss +76 -0
  117. data/vendor/assets/stylesheets/govuk-frontend/govuk/settings/_typography-font-families.scss +32 -0
  118. data/vendor/assets/stylesheets/govuk-frontend/govuk/settings/_typography-font.scss +112 -0
  119. data/vendor/assets/stylesheets/govuk-frontend/govuk/settings/_typography-responsive.scss +195 -0
  120. data/vendor/assets/stylesheets/govuk-frontend/govuk/settings/_warnings.scss +53 -0
  121. data/vendor/assets/stylesheets/govuk-frontend/govuk/tools/_all.scss +7 -0
  122. data/vendor/assets/stylesheets/govuk-frontend/govuk/tools/_compatibility.scss +50 -0
  123. data/vendor/assets/stylesheets/govuk-frontend/govuk/tools/_exports.scss +33 -0
  124. data/vendor/assets/stylesheets/govuk-frontend/govuk/tools/_font-url.scss +25 -0
  125. data/vendor/assets/stylesheets/govuk-frontend/govuk/tools/_ie8.scss +51 -0
  126. data/vendor/assets/stylesheets/govuk-frontend/govuk/tools/_image-url.scss +25 -0
  127. data/vendor/assets/stylesheets/govuk-frontend/govuk/tools/_px-to-em.scss +20 -0
  128. data/vendor/assets/stylesheets/govuk-frontend/govuk/tools/_px-to-rem.scss +20 -0
  129. data/vendor/assets/stylesheets/govuk-frontend/govuk/utilities/_all.scss +2 -0
  130. data/vendor/assets/stylesheets/govuk-frontend/govuk/utilities/_clearfix.scss +5 -0
  131. data/vendor/assets/stylesheets/govuk-frontend/govuk/utilities/_visually-hidden.scss +9 -0
  132. data/vendor/assets/stylesheets/govuk-frontend/govuk/vendor/_sass-mq.scss +347 -0
  133. metadata +130 -3
  134. data/app/assets/builds/katalyst/govuk/formbuilder.min.css +0 -1
@@ -0,0 +1,112 @@
1
+ @import "compatibility";
2
+ @import "typography-font-families";
3
+
4
+ ////
5
+ /// @group settings/typography
6
+ ////
7
+
8
+ /// Use 'legacy' fonts
9
+ ///
10
+ /// Whether or not to use v1 nta font from GOV.UK Elements / Frontend
11
+ /// Toolkit, for teams that are migrating to GOV.UK Frontend and may be using
12
+ /// components from both places in a single application.
13
+ ///
14
+ /// @type Boolean
15
+ /// @access public
16
+ /// @deprecated Will be removed in v5.0 with the rest of the compatibility mode
17
+ /// suite of tools and settings
18
+
19
+ $govuk-use-legacy-font: if(
20
+ (
21
+ $govuk-compatibility-govukfrontendtoolkit or
22
+ $govuk-compatibility-govuktemplate or
23
+ $govuk-compatibility-govukelements
24
+ ),
25
+ true,
26
+ false
27
+ ) !default;
28
+
29
+ // Only show the deprecation warning if user is setting $govuk-use-legacy-font
30
+ // manually instead of automatically via compatibility variables
31
+ @if $govuk-use-legacy-font == true and
32
+ $govuk-compatibility-govukfrontendtoolkit == false and
33
+ $govuk-compatibility-govuktemplate == false and
34
+ $govuk-compatibility-govukelements == false {
35
+ @include _warning(legacy-font, "$govuk-use-legacy-font is deprecated. " +
36
+ "From version 5.0, GOV.UK Frontend will only support the included version " +
37
+ "of GDS Transport.");
38
+ }
39
+
40
+ // =========================================================
41
+ // Font families
42
+ // =========================================================
43
+
44
+ /// Font families to use for all typography on screen media
45
+ ///
46
+ /// @type List
47
+ /// @access public
48
+
49
+ $govuk-font-family: if(
50
+ $govuk-use-legacy-font,
51
+ $govuk-font-family-nta,
52
+ $govuk-font-family-gds-transport
53
+ ) !default;
54
+
55
+ /// Font families to use when displaying tabular numbers
56
+ ///
57
+ /// @type List
58
+ /// @access public
59
+ /// @deprecated Will be removed in v5.0 with the rest of the compatibility mode
60
+ /// suite of tools and settings
61
+
62
+ $govuk-font-family-tabular: if(
63
+ $govuk-use-legacy-font,
64
+ $govuk-font-family-nta-tabular,
65
+ false
66
+ ) !default;
67
+
68
+ // Only show the deprecation warning if user is setting $govuk-font-family-tabular
69
+ // manually instead of automatically via $govuk-use-legacy-font
70
+ @if $govuk-font-family-tabular != false and $govuk-use-legacy-font == false {
71
+ @include _warning(tabular-font-face, "$govuk-font-family-tabular is deprecated. " +
72
+ "From version 5.0, GOV.UK Frontend will not support using a separate " +
73
+ "font-face for tabular numbers.");
74
+ }
75
+
76
+ /// Font families to use for print media
77
+ ///
78
+ /// We recommend that you use system fonts when printing. This will avoid issues
79
+ /// with some printer drivers and operating systems.
80
+ ///
81
+ /// @type List
82
+ /// @access public
83
+
84
+ $govuk-font-family-print: sans-serif !default;
85
+
86
+ /// Include the default @font-face declarations
87
+ ///
88
+ /// If you have set $govuk-font-family to something other than
89
+ /// `$govuk-font-family-gds-transport` this option is disabled by default.
90
+ ///
91
+ /// @type Boolean
92
+ /// @access public
93
+
94
+ $govuk-include-default-font-face: (
95
+ $govuk-font-family == $govuk-font-family-gds-transport
96
+ ) !default;
97
+
98
+ // =========================================================
99
+ // Font weights
100
+ // =========================================================
101
+
102
+ /// Font weight for regular typography
103
+ ///
104
+ /// @type Number
105
+ /// @access public
106
+ $govuk-font-weight-regular: 400 !default;
107
+
108
+ /// Font weight for bold typography
109
+ ///
110
+ /// @type Number
111
+ /// @access public
112
+ $govuk-font-weight-bold: 700 !default;
@@ -0,0 +1,195 @@
1
+ @import "compatibility";
2
+
3
+ ////
4
+ /// @group settings/typography
5
+ ////
6
+
7
+ /// Whether or not to define font sizes in rem, improving accessibility by
8
+ /// allowing users to adjust the base font-size. This is enabled by default,
9
+ /// unless any of the compatibility mode settings are enabled.
10
+ ///
11
+ /// You should make sure that $govuk-root-font-size is set correctly for your
12
+ /// project.
13
+ ///
14
+ /// @type Boolean
15
+ /// @access public
16
+ /// @deprecated Will be removed in v5.0 with the rest of the compatibility mode
17
+ /// suite of tools and settings
18
+
19
+ $govuk-typography-use-rem: if(
20
+ (
21
+ $govuk-compatibility-govukfrontendtoolkit or
22
+ $govuk-compatibility-govuktemplate or
23
+ $govuk-compatibility-govukelements
24
+ ),
25
+ false,
26
+ true
27
+ ) !default;
28
+
29
+ // Only show the deprecation warning if user is setting $govuk-typography-use-rem
30
+ // manually instead of automatically via compatibility variables
31
+ @if $govuk-typography-use-rem == false and
32
+ $govuk-compatibility-govukfrontendtoolkit == false and
33
+ $govuk-compatibility-govuktemplate == false and
34
+ $govuk-compatibility-govukelements == false {
35
+ @include _warning(allow-not-using-rem, "$govuk-typography-use-rem is deprecated. " +
36
+ "From version 5.0, GOV.UK Frontend will not support disabling rem font sizes.");
37
+ }
38
+
39
+ /// Root font size
40
+ ///
41
+ /// This is used to calculate rem sizes for the typography, and should match the
42
+ /// _effective_ font-size of your root (or html) element.
43
+ ///
44
+ /// Ideally you should not be setting the font-size on the html or root element
45
+ /// in order to allow it to scale with user-preference, in which case this
46
+ /// should be set to 16px.
47
+ ///
48
+ /// If you are integrating Frontend into an existing project that also uses
49
+ /// alphagov/govuk_template and you wish to enable `$govuk-typography-use-rem`
50
+ /// then you should set this to 10px to match the 62.5% (10px) base font size
51
+ /// that govuk_template sets on the <html> element.
52
+ ///
53
+ /// @type Number
54
+ /// @access public
55
+
56
+ $govuk-root-font-size: 16px !default;
57
+
58
+ /// Responsive typography font map
59
+ ///
60
+ /// This is used to generate responsive typography that adapts according to the
61
+ /// breakpoints.
62
+ ///
63
+ /// Font size and font weight can be defined for each breakpoint. You can define
64
+ /// different behaviour on tablet and desktop. The 'null' breakpoint is for
65
+ /// mobile.
66
+ ///
67
+ /// Line-heights will automatically be converted from pixel measurements into
68
+ /// relative values. For example, with a font-size of 16px and a line-height of
69
+ /// 24px, the line-height will be converted to 1.5 before output.
70
+ ///
71
+ /// You can also specify a separate font size and line height for print media.
72
+ ///
73
+ /// @type Map
74
+ ///
75
+ /// @prop {Number} $point.$breakpoint.font-size - Font size for `$point` at `$breakpoint`
76
+ /// @prop {Number} $point.$breakpoint.line-height - Line height for `$point` at `$breakpoint`
77
+ /// @prop {Number} $point.print.font-size - Font size for `$point` when printing
78
+ /// @prop {Number} $point.print.line-height - Line height for `$point` when printing
79
+ ///
80
+ /// @access public
81
+
82
+ $govuk-typography-scale: (
83
+ 80: (
84
+ null: (
85
+ font-size: 53px,
86
+ line-height: 55px
87
+ ),
88
+ tablet: (
89
+ font-size: 80px,
90
+ line-height: 80px
91
+ ),
92
+ print: (
93
+ font-size: 53pt,
94
+ line-height: 1.1
95
+ )
96
+ ),
97
+ 48: (
98
+ null: (
99
+ font-size: 32px,
100
+ line-height: 35px
101
+ ),
102
+ tablet: (
103
+ font-size: 48px,
104
+ line-height: 50px
105
+ ),
106
+ print: (
107
+ font-size: 32pt,
108
+ line-height: 1.15
109
+ )
110
+ ),
111
+ 36: (
112
+ null: (
113
+ font-size: 24px,
114
+ line-height: 25px
115
+ ),
116
+ tablet: (
117
+ font-size: 36px,
118
+ line-height: 40px
119
+ ),
120
+ print: (
121
+ font-size: 24pt,
122
+ line-height: 1.05
123
+ )
124
+ ),
125
+ 27: (
126
+ null: (
127
+ font-size: 18px,
128
+ line-height: 20px
129
+ ),
130
+ tablet: (
131
+ font-size: 27px,
132
+ line-height: 30px
133
+ ),
134
+ print: (
135
+ font-size: 18pt,
136
+ line-height: 1.15
137
+ )
138
+ ),
139
+ 24: (
140
+ null: (
141
+ font-size: 18px,
142
+ line-height: 20px
143
+ ),
144
+ tablet: (
145
+ font-size: 24px,
146
+ line-height: 30px
147
+ ),
148
+ print: (
149
+ font-size: 18pt,
150
+ line-height: 1.15
151
+ )
152
+ ),
153
+ 19: (
154
+ null: (
155
+ font-size: 16px,
156
+ line-height: 20px
157
+ ),
158
+ tablet: (
159
+ font-size: 19px,
160
+ line-height: 25px
161
+ ),
162
+ print: (
163
+ font-size: 14pt,
164
+ line-height: 1.15
165
+ )
166
+ ),
167
+ 16: (
168
+ null: (
169
+ font-size: 14px,
170
+ line-height: 16px
171
+ ),
172
+ tablet: (
173
+ font-size: 16px,
174
+ line-height: 20px
175
+ ),
176
+ print: (
177
+ font-size: 14pt,
178
+ line-height: 1.2
179
+ )
180
+ ),
181
+ 14: (
182
+ null: (
183
+ font-size: 12px,
184
+ line-height: 15px
185
+ ),
186
+ tablet: (
187
+ font-size: 14px,
188
+ line-height: 20px
189
+ ),
190
+ print: (
191
+ font-size: 12pt,
192
+ line-height: 1.2
193
+ )
194
+ )
195
+ ) !default;
@@ -0,0 +1,53 @@
1
+ ////
2
+ /// @group settings/warnings
3
+ ////
4
+
5
+ /// Suppressed warnings map
6
+ ///
7
+ /// This map is used to determine which deprecation warnings to **not** show
8
+ /// to users when compiling sass. This is in place for codebases that do not
9
+ /// have the necessary capacity to upgrade and remove the deprecation,
10
+ /// particularly if the deprecation is significant. For example, removal of
11
+ /// compatibility with legacy libraries such as govuk_elements.
12
+ ///
13
+ /// You can add to this map and define which warnings to suppress by appending to
14
+ /// it using the warning key, found in the warning message. For example:
15
+ ///
16
+ /// @example scss:
17
+ /// // warning message:
18
+ /// // $foobar is no longer supported. To silence this warning, update
19
+ /// // $govuk-suppressed-warnings with key: "foobar"
20
+ /// $govuk-suppressed-warnings: (
21
+ /// foobar
22
+ /// );
23
+ ///
24
+ /// @type List
25
+ /// @access public
26
+
27
+ $govuk-suppressed-warnings: () !default;
28
+
29
+ /// Warnings
30
+ ///
31
+ /// Acts as a wrapper for the built in `@warn` sass function
32
+ ///
33
+ /// We use this instead of using `@warn` for 3 reasons:
34
+ ///
35
+ /// - To check if a warning is being suppressed through `$govuk-suppressed-warnings`,
36
+ /// in which case we don't call `@warn` and printing the warning to the user
37
+ /// - To format the passed warning `$message` with the warning key at the end
38
+ /// - To prevent duplicate warnings by adding the passed `$key` to
39
+ /// `$govuk-suppressed-warnings` after `@warn` is called to ensure it only runs
40
+ /// once per sass compilation
41
+ ///
42
+ /// @param {String} $key - The key to be checked against `$govuk-suppressed-warnings`
43
+ /// and then passed to it to prevent multiple of the same warning.
44
+ /// @param {String} $message - The message to use when calling `@warn`
45
+ /// @access private
46
+
47
+ @mixin _warning($key, $message) {
48
+ @if not index($govuk-suppressed-warnings, $key) {
49
+ @warn $message + " To silence this warning, update $govuk-suppressed-warnings " +
50
+ "with key: \"#{$key}\"";
51
+ $govuk-suppressed-warnings: append($govuk-suppressed-warnings, $key) !global;
52
+ }
53
+ }
@@ -0,0 +1,7 @@
1
+ @import "compatibility";
2
+ @import "exports";
3
+ @import "font-url";
4
+ @import "ie8";
5
+ @import "image-url";
6
+ @import "px-to-em";
7
+ @import "px-to-rem";
@@ -0,0 +1,50 @@
1
+ ////
2
+ /// @group tools/compatibility-mode
3
+ ////
4
+
5
+ /// Temporary private version of govuk-compatibility to avoid deprecation warnings
6
+ ///
7
+ /// @access private
8
+
9
+ @mixin _govuk-compatibility($product) {
10
+ @if map-has-key($_govuk-compatibility, $product) {
11
+ @if map-get($_govuk-compatibility, $product) == true {
12
+ @content;
13
+ }
14
+ } @else {
15
+ @error "Non existent product '#{$product}'";
16
+ }
17
+ }
18
+
19
+ /// Conditional Compatibility Mixin
20
+ ///
21
+ /// Selectively output a block (available to the mixin as @content) if a given
22
+ /// $product is also identified as being used in the project.
23
+ ///
24
+ /// This can then be used to include styles that are only needed to override
25
+ /// styles provided by those other products (e.g. where govuk_template has a
26
+ /// very specific link selector that otherwise affects buttons).
27
+ ///
28
+ /// @example scss
29
+ /// // Override .my-class if GOV.UK Template is also being used
30
+ /// @include govuk-compatibility(govuk_template) {
31
+ /// .my-class {
32
+ /// color: inherit;
33
+ /// }
34
+ /// }
35
+ ///
36
+ /// @param {String} $product - Name of product that we are 'defending' against.
37
+ /// @content Passed content is outputted only if Frontend is being used with
38
+ /// this product
39
+ /// @throw Errors if product name is not recognised
40
+ /// @access public
41
+ /// @deprecated Will be removed in v5.0 with the rest of the compatibility mode
42
+ /// suite of tools and settings
43
+
44
+ @mixin govuk-compatibility($product) {
45
+ @include _warning(compatibility-helper, "govuk-compatibility is deprecated. " +
46
+ "From version 5.0, GOV.UK Frontend will not support compatibility mode.");
47
+ @include _govuk-compatibility($product) {
48
+ @content;
49
+ }
50
+ }
@@ -0,0 +1,33 @@
1
+ ////
2
+ /// @group tools
3
+ ////
4
+
5
+ /// List of modules which have already been exported
6
+ ///
7
+ /// @type List
8
+ /// @access private
9
+
10
+ $_govuk-imported-modules: () !default;
11
+
12
+ /// Export module
13
+ ///
14
+ /// Ensure that the modules of CSS that we define throughout Frontend are only
15
+ /// included in the generated CSS once, no matter how many times they are
16
+ /// imported across the individual components.
17
+ ///
18
+ /// @param {String} $name - Name of module - must be unique within the codebase
19
+ /// @content The passed content will only be outputted if a module of the same
20
+ /// $name has not already been outputted
21
+ /// @access public
22
+
23
+ @mixin govuk-exports($name) {
24
+ // If the mixin is not in the list of modules already exported...
25
+ @if not index($_govuk-imported-modules, $name) {
26
+ // ... then add it to the list
27
+ $_govuk-imported-modules: append($_govuk-imported-modules, $name) !global;
28
+ // ... and output the CSS for that module
29
+ @content;
30
+ }
31
+ // The next time exports is called for the module of the same name, it will be
32
+ // found in the list and so nothing will be outputted.
33
+ }
@@ -0,0 +1,25 @@
1
+ ////
2
+ /// @group tools/assets
3
+ ////
4
+
5
+ /// Font URL
6
+ ///
7
+ /// If a custom font-url handler is defined ($govuk-font-url-function) then
8
+ /// it will be called, otherwise a url will be returned with the filename
9
+ /// appended to the font path.
10
+ ///
11
+ /// @param {String} $filename - Font filename
12
+ /// @return {String} URL for the filename, wrapped in `url()`
13
+ /// @access public
14
+
15
+ @function govuk-font-url($filename) {
16
+ $use-custom-function: variable-exists("govuk-font-url-function")
17
+ and $govuk-font-url-function
18
+ and function-exists($govuk-font-url-function);
19
+
20
+ @if $use-custom-function {
21
+ @return call(get-function($govuk-font-url-function), $filename);
22
+ } @else {
23
+ @return url($govuk-fonts-path + $filename);
24
+ }
25
+ }
@@ -0,0 +1,51 @@
1
+ ////
2
+ /// @group tools/internet-explorer-8
3
+ ////
4
+
5
+ /// Conditionally include rules only for IE8
6
+ ///
7
+ /// @content Passed content is only outputted if we're compiling a stylesheet
8
+ /// that targets IE8 (if `$govuk-is-ie8` is true)
9
+ ///
10
+ /// @example scss - Usage
11
+ ///
12
+ /// .foo {
13
+ /// min-width: 100px;
14
+ /// // Specify width for IE8 only
15
+ /// @include govuk-if-ie8 {
16
+ /// width: 100px;
17
+ /// }
18
+ /// }
19
+ ///
20
+ /// @access public
21
+
22
+ @mixin govuk-if-ie8 {
23
+ @if $govuk-is-ie8 {
24
+ @content;
25
+ }
26
+ }
27
+
28
+ /// Conditionally exclude rules for IE8
29
+ ///
30
+ /// @content Passed content is only outputted if we're not compiling a
31
+ /// stylesheet that targets IE8 (if `$govuk-is-ie8` is false)
32
+ ///
33
+ /// @example scss - Usage
34
+ ///
35
+ /// .foo {
36
+ /// font-weight: bold;
37
+ ///
38
+ /// // Enhance foo only for modern browsers (not IE8)
39
+ /// @include govuk-not-ie8 {
40
+ /// font-family: "Comic Sans MS", "Curlz MT" cursive, sans-serif;
41
+ /// color: #FF69B4;
42
+ /// }
43
+ /// }
44
+ ///
45
+ /// @access public
46
+
47
+ @mixin govuk-not-ie8 {
48
+ @if not $govuk-is-ie8 {
49
+ @content;
50
+ }
51
+ }
@@ -0,0 +1,25 @@
1
+ ////
2
+ /// @group tools/assets
3
+ ////
4
+
5
+ /// Image URL
6
+ ///
7
+ /// If a custom image-url handler is defined ($govuk-image-url-function) then
8
+ /// it will be called, otherwise a url will be returned with the filename
9
+ /// appended to the image path.
10
+ ///
11
+ /// @param {String} Filename for the image to load
12
+ /// @return {String} URL for the filename, wrapped in `url()`
13
+ /// @access public
14
+
15
+ @function govuk-image-url($filename) {
16
+ $use-custom-function: variable-exists("govuk-image-url-function")
17
+ and $govuk-image-url-function
18
+ and function-exists($govuk-image-url-function);
19
+
20
+ @if $use-custom-function {
21
+ @return call(get-function($govuk-image-url-function), $filename);
22
+ } @else {
23
+ @return url($govuk-images-path + $filename);
24
+ }
25
+ }
@@ -0,0 +1,20 @@
1
+ ////
2
+ /// @group tools/unit-conversion
3
+ ////
4
+
5
+ /// Convert pixels to em
6
+ ///
7
+ /// @param {Number} $value - Length in pixels
8
+ /// @param {Number} $context-font-size - Font size of element
9
+ /// @return {Number} Length in ems
10
+ /// @access public
11
+
12
+ @function govuk-em($value, $context-font-size) {
13
+ @if unitless($value) {
14
+ $value: $value * 1px;
15
+ }
16
+ @if unitless($context-font-size) {
17
+ $context-font-size: $context-font-size * 1px;
18
+ }
19
+ @return $value / $context-font-size * 1em;
20
+ }
@@ -0,0 +1,20 @@
1
+ ////
2
+ /// @group tools/unit-conversion
3
+ ////
4
+
5
+ /// Convert pixels to rem
6
+ ///
7
+ /// The $govuk-root-font-size (defined in settings/_typography-responsive.scss)
8
+ /// must be configured to match the font-size of your root (html) element
9
+ ///
10
+ /// @param {Number} $value - Length in pixels
11
+ /// @return {Number} Length in rems
12
+ /// @access public
13
+
14
+ @function govuk-px-to-rem($value) {
15
+ @if unitless($value) {
16
+ $value: $value * 1px;
17
+ }
18
+
19
+ @return $value / $govuk-root-font-size * 1rem;
20
+ }
@@ -0,0 +1,2 @@
1
+ @import "clearfix";
2
+ @import "visually-hidden";
@@ -0,0 +1,5 @@
1
+ @include govuk-exports("govuk/utilities/clearfix") {
2
+ .govuk-clearfix {
3
+ @include govuk-clearfix;
4
+ }
5
+ }
@@ -0,0 +1,9 @@
1
+ @include govuk-exports("govuk/utilities/visually-hidden") {
2
+ .govuk-visually-hidden {
3
+ @include govuk-visually-hidden;
4
+ }
5
+
6
+ .govuk-visually-hidden-focusable {
7
+ @include govuk-visually-hidden-focusable;
8
+ }
9
+ }