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,171 @@
1
+ ////
2
+ /// @group helpers/spacing
3
+ ////
4
+
5
+ // stylelint-disable indentation
6
+
7
+ /// Single point spacing
8
+ ///
9
+ /// Returns measurement corresponding to the spacing point requested.
10
+ ///
11
+ /// @param {Number} $spacing-point - Point on the spacing scale
12
+ /// (set in `settings/_spacing.scss`)
13
+ ///
14
+ /// @returns {String} Spacing measurement eg. 10px
15
+ ///
16
+ /// @example scss
17
+ /// .element {
18
+ /// padding: govuk-spacing(5);
19
+ /// }
20
+ ///
21
+ /// @example scss Using negative spacing
22
+ /// .element {
23
+ /// margin-top: govuk-spacing(-1);
24
+ /// }
25
+ ///
26
+ /// @example scss Marking spacing declarations as important
27
+ /// .element {
28
+ /// margin-top: govuk-spacing(1) !important;
29
+ /// }
30
+ ///
31
+ /// @access public
32
+
33
+ @function govuk-spacing($spacing-point) {
34
+
35
+ $actual-input-type: type-of($spacing-point);
36
+ @if $actual-input-type != "number" {
37
+ @error "Expected a number (integer), but got a "
38
+ + "#{$actual-input-type}.";
39
+ }
40
+
41
+ $is-negative: false;
42
+ @if $spacing-point < 0 {
43
+ $is-negative: true;
44
+ $spacing-point: abs($spacing-point);
45
+ }
46
+
47
+ @if not map-has-key($govuk-spacing-points, $spacing-point) {
48
+ @error "Unknown spacing variable `#{$spacing-point}`. Make sure you are using a point from the spacing scale in `_settings/spacing.scss`.";
49
+ }
50
+
51
+ $value: map-get($govuk-spacing-points, $spacing-point);
52
+ @return if($is-negative, $value * -1, $value);
53
+ }
54
+
55
+ /// Responsive spacing
56
+ ///
57
+ /// Adds responsive spacing (either padding or margin, depending on `$property`)
58
+ /// by fetching a 'spacing map' from the responsive spacing scale, which defines
59
+ /// different spacing values at different breakpoints.
60
+ ///
61
+ /// To generate responsive spacing, use 'govuk-responsive-margin' or
62
+ /// 'govuk-responsive-padding' mixins
63
+ ///
64
+ /// @param {Number} $responsive-spacing-point - Point on the responsive spacing
65
+ /// scale, corresponds to a map of breakpoints and spacing values
66
+ /// @param {String} $property - Property to add spacing to (e.g. 'margin')
67
+ /// @param {String} $direction [all] - Direction to add spacing to
68
+ /// (`top`, `right`, `bottom`, `left`, `all`)
69
+ /// @param {Boolean} $important [false] - Whether to mark as `!important`
70
+ /// @param {Number} $adjustment [false] - Offset to adjust spacing by
71
+ ///
72
+ /// @access private
73
+
74
+ @mixin _govuk-responsive-spacing($responsive-spacing-point, $property, $direction: "all", $important: false, $adjustment: false) {
75
+
76
+ $actual-input-type: type-of($responsive-spacing-point);
77
+ @if $actual-input-type != "number" {
78
+ @error "Expected a number (integer), but got a " + "#{$actual-input-type}.";
79
+ }
80
+
81
+ @if not map-has-key($govuk-spacing-responsive-scale, $responsive-spacing-point) {
82
+ @error "Unknown spacing point `#{$responsive-spacing-point}`. Make sure you are using a point from the "
83
+ + "responsive spacing scale in `_settings/spacing.scss`.";
84
+ }
85
+
86
+ // Make sure that the return value from `_settings/spacing.scss` is a map.
87
+ $scale-map: map-get($govuk-spacing-responsive-scale, $responsive-spacing-point);
88
+ $actual-map-type: type-of($scale-map);
89
+ @if $actual-map-type != "map" {
90
+ @error "Expected a number (integer), but got a "
91
+ + "#{$actual-map-type}. Make sure you are using a map to set the responsive spacing in `_settings/spacing.scss`)";
92
+ }
93
+
94
+ // Loop through each breakpoint in the map
95
+ @each $breakpoint, $breakpoint-value in $scale-map {
96
+
97
+ @if $adjustment {
98
+ $breakpoint-value: $breakpoint-value + $adjustment;
99
+ }
100
+
101
+ // The 'null' breakpoint is for mobile.
102
+ @if not $breakpoint {
103
+
104
+ @if $direction == all {
105
+ #{$property}: $breakpoint-value if($important, !important, null);
106
+ } @else {
107
+ #{$property}-#{$direction}: $breakpoint-value if($important, !important, null);
108
+ }
109
+ } @else {
110
+ @include govuk-media-query($from: $breakpoint) {
111
+ @if $direction == all {
112
+ #{$property}: $breakpoint-value if($important, !important, null);
113
+ } @else {
114
+ #{$property}-#{$direction}: $breakpoint-value if($important, !important, null);
115
+ }
116
+ }
117
+ }
118
+ }
119
+ }
120
+
121
+ /// Responsive margin
122
+ ///
123
+ /// Adds responsive margin by fetching a 'spacing map' from the responsive
124
+ /// spacing scale, which defines different spacing values at different
125
+ /// breakpoints. Wrapper for the `_govuk-responsive-spacing` mixin.
126
+ ///
127
+ /// @see {mixin} _govuk-responsive-spacing
128
+ ///
129
+ /// @param {Number} $responsive-spacing-point - Point on the responsive spacing
130
+ /// scale, corresponds to a map of breakpoints and spacing values
131
+ /// @param {String} $direction [all] - Direction to add spacing to
132
+ /// (`top`, `right`, `bottom`, `left`, `all`)
133
+ /// @param {Boolean} $important [false] - Whether to mark as `!important`
134
+ /// @param {Number} $adjustment [false] - Offset to adjust spacing by
135
+ ///
136
+ /// @example scss
137
+ /// .element {
138
+ /// @include govuk-responsive-margin(6, "left", $adjustment: 1px);
139
+ /// }
140
+ ///
141
+ /// @access public
142
+
143
+ @mixin govuk-responsive-margin($responsive-spacing-point, $direction: "all", $important: false, $adjustment: false) {
144
+ @include _govuk-responsive-spacing($responsive-spacing-point, "margin", $direction, $important, $adjustment);
145
+ }
146
+
147
+ /// Responsive padding
148
+ ///
149
+ /// Adds responsive padding by fetching a 'spacing map' from the responsive
150
+ /// spacing scale, which defines different spacing values at different
151
+ /// breakpoints. Wrapper for the `_govuk-responsive-spacing` mixin.
152
+ ///
153
+ /// @see {mixin} _govuk-responsive-spacing
154
+ ///
155
+ /// @param {Number} $responsive-spacing-point - Point on the responsive spacing
156
+ /// scale, corresponds to a map of breakpoints and spacing values
157
+ /// @param {String} $direction [all] - Direction to add spacing to
158
+ /// (`top`, `right`, `bottom`, `left`, `all`)
159
+ /// @param {Boolean} $important [false] - Whether to mark as `!important`
160
+ /// @param {Number} $adjustment [false] - Offset to adjust spacing
161
+ ///
162
+ /// @example scss
163
+ /// .element {
164
+ /// @include govuk-responsive-padding(6, "left", $adjustment: 1px);
165
+ /// }
166
+ ///
167
+ /// @access public
168
+
169
+ @mixin govuk-responsive-padding($responsive-spacing-point, $direction: "all", $important: false, $adjustment: false) {
170
+ @include _govuk-responsive-spacing($responsive-spacing-point, "padding", $direction, $important, $adjustment);
171
+ }
@@ -0,0 +1,214 @@
1
+ ////
2
+ /// @group helpers/typography
3
+ ////
4
+
5
+ @import "../tools/px-to-rem";
6
+
7
+ /// 'Common typography' helper
8
+ ///
9
+ /// Sets the font family and associated properties, such as font smoothing. Also
10
+ /// overrides the font for print.
11
+ ///
12
+ /// @param {List} $font-family [$govuk-font-family] Font family to use
13
+ /// @access public
14
+
15
+ @mixin govuk-typography-common($font-family: $govuk-font-family) {
16
+ font-family: $font-family;
17
+ -webkit-font-smoothing: antialiased;
18
+ -moz-osx-font-smoothing: grayscale;
19
+
20
+ // If the user is using the default GDS Transport font we need to include
21
+ // the font-face declarations.
22
+ //
23
+ // We do not need to include the GDS Transport font-face declarations if
24
+ // alphagov/govuk_template is being used since nta will already be included by
25
+ // default.
26
+ @if $govuk-include-default-font-face {
27
+ @include _govuk-font-face-gds-transport;
28
+ }
29
+
30
+ @include govuk-media-query($media-type: print) {
31
+ font-family: $govuk-font-family-print;
32
+ }
33
+ }
34
+
35
+ /// Text colour helper
36
+ ///
37
+ /// Sets the text colour, including a suitable override for print.
38
+ ///
39
+ /// @access public
40
+
41
+ @mixin govuk-text-colour {
42
+ color: $govuk-text-colour;
43
+
44
+ @include govuk-media-query($media-type: print) {
45
+ color: $govuk-print-text-colour;
46
+ }
47
+ }
48
+
49
+ /// Regular font weight helper
50
+ ///
51
+ /// @param {Boolean} $important [false] - Whether to mark declarations as
52
+ /// `!important`. Generally Used to create override classes.
53
+ /// @access public
54
+
55
+ @mixin govuk-typography-weight-regular($important: false) {
56
+ font-weight: $govuk-font-weight-regular if($important, !important, null);
57
+ }
58
+
59
+ /// Bold font weight helper
60
+ ///
61
+ /// @param {Boolean} $important [false] - Whether to mark declarations as
62
+ /// `!important`. Generally Used to create override classes.
63
+ /// @access public
64
+
65
+ @mixin govuk-typography-weight-bold($important: false) {
66
+ font-weight: $govuk-font-weight-bold if($important, !important, null);
67
+ }
68
+
69
+ /// Convert line-heights specified in pixels into a relative value, unless
70
+ /// they are already unit-less (and thus already treated as relative values)
71
+ /// or the units do not match the units used for the font size.
72
+ ///
73
+ /// @param {Number} $line-height Line height
74
+ /// @param {Number} $font-size Font size
75
+ /// @return {Number} The line height as either a relative value or unmodified
76
+ ///
77
+ /// @access private
78
+
79
+ @function _govuk-line-height($line-height, $font-size) {
80
+ @if not unitless($line-height) and unit($line-height) == unit($font-size) {
81
+ $line-height: $line-height / $font-size;
82
+ }
83
+
84
+ @return $line-height;
85
+ }
86
+
87
+ /// Responsive typography helper
88
+ ///
89
+ /// Takes a point from the responsive 'font map' as an argument (the size as it
90
+ /// would appear on tablet and above), and uses it to create font-size and
91
+ /// line-height declarations for different breakpoints, and print.
92
+ ///
93
+ /// Example font map:
94
+ ///
95
+ /// 19: (
96
+ /// null: (
97
+ /// font-size: 16px,
98
+ /// line-height: 20px
99
+ /// ),
100
+ /// tablet: (
101
+ /// font-size: 19px,
102
+ /// line-height: 25px
103
+ /// ),
104
+ /// print: (
105
+ /// font-size: 14pt,
106
+ /// line-height: 1.15
107
+ /// )
108
+ /// );
109
+ ///
110
+ /// @param {Number} $size - Point from the spacing scale (the size as it would
111
+ /// appear on tablet and above)
112
+ /// @param {Number} $override-line-height [false] - Non responsive custom line
113
+ /// height. Omit to use the line height from the font map.
114
+ /// @param {Boolean} $important [false] - Whether to mark declarations as
115
+ /// `!important`.
116
+ ///
117
+ /// @throw if `$size` is not a valid point from the spacing scale
118
+ ///
119
+ /// @access public
120
+
121
+ @mixin govuk-typography-responsive($size, $override-line-height: false, $important: false) {
122
+
123
+ @if not map-has-key($govuk-typography-scale, $size) {
124
+ @error "Unknown font size `#{$size}` - expected a point from the typography scale.";
125
+ }
126
+
127
+ $font-map: map-get($govuk-typography-scale, $size);
128
+
129
+ @each $breakpoint, $breakpoint-map in $font-map {
130
+ $font-size: map-get($breakpoint-map, "font-size");
131
+ $font-size-rem: govuk-px-to-rem($font-size);
132
+
133
+ $line-height: _govuk-line-height(
134
+ $line-height: if(
135
+ $override-line-height,
136
+ $override-line-height,
137
+ map-get($breakpoint-map, "line-height")
138
+ ),
139
+ $font-size: $font-size
140
+ );
141
+
142
+ // Mark rules as !important if $important is true - this will result in
143
+ // these variables becoming strings, so this needs to happen *after* they
144
+ // are used in calculations
145
+ $font-size: $font-size if($important, !important, null);
146
+ $font-size-rem: $font-size-rem if($important, !important, null);
147
+ $line-height: $line-height if($important, !important, null);
148
+
149
+ @if not $breakpoint {
150
+ font-size: $font-size;
151
+ @if $govuk-typography-use-rem {
152
+ font-size: $font-size-rem;
153
+ }
154
+ line-height: $line-height;
155
+ } @else if $breakpoint == "print" {
156
+ @include govuk-media-query($media-type: print) {
157
+ font-size: $font-size;
158
+ line-height: $line-height;
159
+ }
160
+ } @else {
161
+ @include govuk-media-query($from: $breakpoint) {
162
+ font-size: $font-size;
163
+ @if $govuk-typography-use-rem {
164
+ font-size: $font-size-rem;
165
+ }
166
+ line-height: $line-height;
167
+ }
168
+ }
169
+ }
170
+ }
171
+
172
+ /// Font helper
173
+ ///
174
+ /// @param {Number | Boolean} $size Point from the spacing scale (the size as it
175
+ /// would appear on tablet and above). Use `false` to avoid setting a size.
176
+ /// @param {String} $weight [regular] - Weight: `bold` or `regular`
177
+ /// @param {Boolean} $tabular [false] - Whether to use tabular numbers or not
178
+ /// @param {Number} $line-height [false] - Line-height, if overriding the
179
+ /// default
180
+ ///
181
+ /// @throw if `$size` is not a valid point from the spacing scale (or false)
182
+ ///
183
+ /// @access public
184
+
185
+ @mixin govuk-font($size, $weight: regular, $tabular: false, $line-height: false) {
186
+ @if $tabular {
187
+ // if govuk-font-family-tabular is set use $govuk-font-family-tabular
188
+ @if $govuk-font-family-tabular {
189
+ @include govuk-typography-common($font-family: $govuk-font-family-tabular);
190
+ } @else {
191
+ @include govuk-typography-common;
192
+ -webkit-font-feature-settings: "tnum" 1;
193
+ font-feature-settings: "tnum" 1;
194
+
195
+ @supports (font-variant-numeric: tabular-nums) {
196
+ -webkit-font-feature-settings: normal;
197
+ font-feature-settings: normal;
198
+ font-variant-numeric: tabular-nums;
199
+ }
200
+ }
201
+ } @else {
202
+ @include govuk-typography-common;
203
+ }
204
+
205
+ @if $weight == regular {
206
+ @include govuk-typography-weight-regular;
207
+ } @else if $weight == bold {
208
+ @include govuk-typography-weight-bold;
209
+ }
210
+
211
+ @if $size {
212
+ @include govuk-typography-responsive($size, $override-line-height: $line-height);
213
+ }
214
+ }
@@ -0,0 +1,84 @@
1
+ ////
2
+ /// @group helpers/accessibility
3
+ ////
4
+
5
+ /// Hide an element visually, but have it available for screen readers
6
+ ///
7
+ /// @link https://snook.ca/archives/html_and_css/hiding-content-for-accessibility
8
+ /// - Hiding Content for Accessibility, Jonathan Snook, February 2011
9
+ /// @link https://github.com/h5bp/html5-boilerplate/blob/9f13695d21ff92c55c78dfa9f16bb02a1b6e911f/src/css/main.css#L121-L158
10
+ /// - h5bp/html5-boilerplate - Thanks!
11
+ ///
12
+ /// @param {Boolean} $important [true] - Whether to mark as `!important`
13
+ ///
14
+ /// @access public
15
+
16
+ @mixin govuk-visually-hidden($important: true) {
17
+ position: absolute if($important, !important, null);
18
+
19
+ width: 1px if($important, !important, null);
20
+ height: 1px if($important, !important, null);
21
+ // If margin is set to a negative value it can cause text to be announced in
22
+ // the wrong order in VoiceOver for OSX
23
+ margin: 0 if($important, !important, null);
24
+ padding: 0 if($important, !important, null);
25
+
26
+ overflow: hidden if($important, !important, null);
27
+ clip: rect(0 0 0 0) if($important, !important, null);
28
+ -webkit-clip-path: inset(50%) if($important, !important, null);
29
+ clip-path: inset(50%) if($important, !important, null);
30
+
31
+ border: 0 if($important, !important, null);
32
+
33
+ // For long content, line feeds are not interpreted as spaces and small width
34
+ // causes content to wrap 1 word per line:
35
+ // https://medium.com/@jessebeach/beware-smushed-off-screen-accessible-text-5952a4c2cbfe
36
+ white-space: nowrap if($important, !important, null);
37
+ }
38
+
39
+ /// Hide an element visually, but have it available for screen readers whilst
40
+ /// allowing the element to be focused when navigated to via the keyboard (e.g.
41
+ /// for the skip link)
42
+ ///
43
+ /// This is slightly less opinionated about borders and padding to make it
44
+ /// easier to style the focussed element.
45
+ ///
46
+ /// @param {Boolean} $important [true] - Whether to mark as `!important`
47
+ ///
48
+ /// @access public
49
+
50
+ @mixin govuk-visually-hidden-focusable($important: true) {
51
+ position: absolute if($important, !important, null);
52
+
53
+ width: 1px if($important, !important, null);
54
+ height: 1px if($important, !important, null);
55
+ // If margin is set to a negative value it can cause text to be announced in
56
+ // the wrong order in VoiceOver for OSX
57
+ margin: 0 if($important, !important, null);
58
+
59
+ overflow: hidden if($important, !important, null);
60
+ clip: rect(0 0 0 0) if($important, !important, null);
61
+ -webkit-clip-path: inset(50%) if($important, !important, null);
62
+ clip-path: inset(50%) if($important, !important, null);
63
+
64
+ // For long content, line feeds are not interpreted as spaces and small width
65
+ // causes content to wrap 1 word per line:
66
+ // https://medium.com/@jessebeach/beware-smushed-off-screen-accessible-text-5952a4c2cbfe
67
+ white-space: nowrap if($important, !important, null);
68
+
69
+ &:active,
70
+ &:focus {
71
+ position: static if($important, !important, null);
72
+
73
+ width: auto if($important, !important, null);
74
+ height: auto if($important, !important, null);
75
+ margin: inherit if($important, !important, null);
76
+
77
+ overflow: visible if($important, !important, null);
78
+ clip: auto if($important, !important, null);
79
+ -webkit-clip-path: none if($important, !important, null);
80
+ clip-path: none if($important, !important, null);
81
+
82
+ white-space: inherit if($important, !important, null);
83
+ }
84
+ }
@@ -0,0 +1,6 @@
1
+ @import "button-group";
2
+ @import "form-group";
3
+ @import "grid";
4
+ @import "main-wrapper";
5
+ @import "template";
6
+ @import "width-container";
@@ -0,0 +1,85 @@
1
+ @import "../base";
2
+
3
+ @include govuk-exports("govuk/objects/button-group") {
4
+ // Button groups can be used to group buttons and links together as a group.
5
+ //
6
+ // Within a button group:
7
+ //
8
+ // - links are styled to line up visually with the buttons, including being
9
+ // centre-aligned on mobile
10
+ // - spacing between the buttons and links is handled automatically, including
11
+ // when they wrap across multiple lines
12
+ .govuk-button-group {
13
+ $horizontal-gap: govuk-spacing(3);
14
+ $vertical-gap: govuk-spacing(3);
15
+
16
+ // These need to be kept in sync with the button component's styles
17
+ $button-padding: govuk-spacing(2);
18
+ $button-shadow-size: $govuk-border-width-form-element;
19
+
20
+ $link-spacing: govuk-spacing(1);
21
+
22
+ @include govuk-responsive-margin(6, "bottom", $adjustment: $vertical-gap * -1);
23
+
24
+ // Flexbox is used to center-align links on mobile, align everything along
25
+ // the baseline on tablet and above, and to removes extra whitespace that
26
+ // we'd get between the buttons and links because they're inline-blocks.
27
+ //
28
+ // Ideally we'd use `gap` with flexbox rather than having to do it all with
29
+ // margins, but unfortunately the support isn't there (yet) and @supports
30
+ // doesn't play nicely with it
31
+ // (https://github.com/w3c/csswg-drafts/issues/3559)
32
+ display: -ms-flexbox;
33
+ display: flex;
34
+ -ms-flex-direction: column;
35
+ flex-direction: column;
36
+ -ms-flex-align: center;
37
+ align-items: center;
38
+
39
+ // Give links within the button group the same font-size and line-height
40
+ // as buttons.
41
+ //
42
+ // Because we want the focus state to be tight around the link text, we use
43
+ // margins where the buttons would use padding.
44
+ .govuk-link {
45
+ @include govuk-font($size: 19, $line-height: 19px);
46
+ display: inline-block;
47
+ // Prevent links overflowing their container in IE10/11 because of bug
48
+ // with align-items: center
49
+ max-width: 100%;
50
+ margin-top: $link-spacing;
51
+ margin-bottom: $link-spacing + $vertical-gap;
52
+ text-align: center;
53
+ }
54
+
55
+ // Reduce the bottom margin to the size of the vertical gap (accommodating
56
+ // the button shadow) – the 'lost' margin is moved to the button-group.
57
+ .govuk-button {
58
+ margin-bottom: $vertical-gap + $button-shadow-size;
59
+ }
60
+
61
+ // On tablet and above, we also introduce a 'column gap' between the
62
+ // buttons and links in each row and left align links
63
+ @include govuk-media-query($from: tablet) {
64
+ // Cancel out the column gap for the last item in each row
65
+ margin-right: ($horizontal-gap * -1);
66
+
67
+ -ms-flex-direction: row;
68
+
69
+ flex-direction: row;
70
+ -ms-flex-wrap: wrap;
71
+ flex-wrap: wrap;
72
+ -ms-flex-align: baseline;
73
+ align-items: baseline;
74
+
75
+ .govuk-button,
76
+ .govuk-link {
77
+ margin-right: $horizontal-gap;
78
+ }
79
+
80
+ .govuk-link {
81
+ text-align: left;
82
+ }
83
+ }
84
+ }
85
+ }
@@ -0,0 +1,23 @@
1
+ @import "../base";
2
+
3
+ @include govuk-exports("govuk/objects/form-group") {
4
+ .govuk-form-group {
5
+ @include govuk-clearfix;
6
+ @include govuk-responsive-margin(6, "bottom");
7
+
8
+ .govuk-form-group:last-of-type {
9
+ margin-bottom: 0; // Remove margin from last item in nested groups
10
+ }
11
+ }
12
+
13
+ .govuk-form-group--error {
14
+ padding-left: govuk-spacing(3);
15
+ border-left: $govuk-border-width-form-group-error solid $govuk-error-colour;
16
+
17
+ .govuk-form-group {
18
+ // Reset error styles in nested form groups that might have error class
19
+ padding: 0;
20
+ border: 0;
21
+ }
22
+ }
23
+ }
@@ -0,0 +1,24 @@
1
+ @import "../base";
2
+
3
+ @include govuk-exports("govuk/objects/grid") {
4
+ .govuk-grid-row {
5
+ @include govuk-clearfix;
6
+ margin-right: - ($govuk-gutter-half);
7
+ margin-left: - ($govuk-gutter-half);
8
+ }
9
+
10
+ @each $width in map-keys($govuk-grid-widths) {
11
+ .govuk-grid-column-#{$width} {
12
+ @include govuk-grid-column($width);
13
+ }
14
+ }
15
+
16
+ // These *must* be defined in a separate loop as they have the same
17
+ // specificity as the non-breakpoint specific classes, so need to appear after
18
+ // them in the outputted CSS
19
+ @each $width in map-keys($govuk-grid-widths) {
20
+ .govuk-grid-column-#{$width}-from-desktop {
21
+ @include govuk-grid-column($width, $at: desktop);
22
+ }
23
+ }
24
+ }
@@ -0,0 +1,53 @@
1
+ @import "../base";
2
+
3
+ ////
4
+ /// @group objects/layout
5
+ ////
6
+
7
+ // Example usage with Breadcrumbs, phase banners, back links:
8
+ // <div class="govuk-width-container">
9
+ // <!-- Breadcrumbs, phase banners, back links are placed in here. -->
10
+ // <div class="govuk-main-wrapper">
11
+ // <!-- Wrapper for the main content of your page which applies padding
12
+ // to the top / bottom -->
13
+ // </div>
14
+ // </div>
15
+ //
16
+ // Example usage without Breadcrumbs, phase banners, back links:
17
+ // <div class="govuk-width-container">
18
+ // <div class="govuk-main-wrapper govuk-main-wrapper--l">
19
+ // <!-- Wrapper for the main content of your page which applies padding
20
+ // to the top / bottom -->
21
+ // </div>
22
+ // </div>
23
+
24
+ @include govuk-exports("govuk/objects/main-wrapper") {
25
+ .govuk-main-wrapper {
26
+ // In IE11 the `main` element can be used, but is not recognized –
27
+ // meaning it's not defined in IE's default style sheet,
28
+ // so it uses CSS initial value, which is inline.
29
+ display: block;
30
+ padding-top: govuk-spacing(4);
31
+ padding-bottom: govuk-spacing(4);
32
+
33
+ @include govuk-media-query($from: tablet) {
34
+ // This spacing is manually adjusted to replicate the margin of
35
+ // govuk-heading-xl (50px) minus the spacing of back link and
36
+ // breadcrumbs (10px)
37
+ padding-top: govuk-spacing(7);
38
+ padding-bottom: govuk-spacing(7);
39
+ }
40
+ }
41
+
42
+ // Using the `.govuk-main-wrapper--auto-spacing` modifier should apply the
43
+ // correct spacing depending on whether there are any elements
44
+ // (such the back link, breadcrumbs or phase banner components) before the
45
+ // `.govuk-main-wrapper` in the `govuk-width-container`.
46
+ //
47
+ // If you need to control the spacing manually, use the
48
+ // `govuk-main-wrapper--l` modifier instead.
49
+ .govuk-main-wrapper--auto-spacing:first-child,
50
+ .govuk-main-wrapper--l {
51
+ @include govuk-responsive-padding(8, "top");
52
+ }
53
+ }