dxw_govuk_frontend_rails 2.9.0.pre.alpha.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.circleci/config.yml +33 -0
- data/.circleci/setup-rubygems.sh +3 -0
- data/.gitignore +9 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +91 -0
- data/Rakefile +50 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/dxw_govuk_frontend_rails.gemspec +27 -0
- data/lib/dxw_govuk_frontend_rails/version.rb +3 -0
- data/lib/dxw_govuk_frontend_rails.rb +12 -0
- data/package-lock.json +13 -0
- data/package.json +26 -0
- data/vendor/assets/fonts/bold-a2452cb66f-v1.woff2 +0 -0
- data/vendor/assets/fonts/bold-f38c792ac2-v1.woff +0 -0
- data/vendor/assets/fonts/bold-fb2676462a-v1.eot +0 -0
- data/vendor/assets/fonts/bold-tabular-357fdfbcc3-v1.eot +0 -0
- data/vendor/assets/fonts/bold-tabular-784c21afb8-v1.woff +0 -0
- data/vendor/assets/fonts/bold-tabular-b89238d840-v1.woff2 +0 -0
- data/vendor/assets/fonts/light-2c037cf7e1-v1.eot +0 -0
- data/vendor/assets/fonts/light-458f8ea81c-v1.woff +0 -0
- data/vendor/assets/fonts/light-f38ad40456-v1.woff2 +0 -0
- data/vendor/assets/fonts/light-tabular-498ea8ffe2-v1.eot +0 -0
- data/vendor/assets/fonts/light-tabular-62cc6f0a28-v1.woff +0 -0
- data/vendor/assets/fonts/light-tabular-851b10ccdd-v1.woff2 +0 -0
- data/vendor/assets/images/favicon.ico +0 -0
- data/vendor/assets/images/govuk-apple-touch-icon-152x152.png +0 -0
- data/vendor/assets/images/govuk-apple-touch-icon-167x167.png +0 -0
- data/vendor/assets/images/govuk-apple-touch-icon-180x180.png +0 -0
- data/vendor/assets/images/govuk-apple-touch-icon.png +0 -0
- data/vendor/assets/images/govuk-crest-2x.png +0 -0
- data/vendor/assets/images/govuk-crest.png +0 -0
- data/vendor/assets/images/govuk-logotype-crown.png +0 -0
- data/vendor/assets/images/govuk-mask-icon.svg +7 -0
- data/vendor/assets/images/govuk-opengraph-image.png +0 -0
- data/vendor/assets/images/icon-arrow-left.png +0 -0
- data/vendor/assets/images/icon-important.png +0 -0
- data/vendor/assets/images/icon-pointer-2x.png +0 -0
- data/vendor/assets/images/icon-pointer.png +0 -0
- data/vendor/assets/javascripts/govuk_frontend_rails.js +2358 -0
- data/vendor/assets/stylesheets/all-ie8.scss +6 -0
- data/vendor/assets/stylesheets/all.scss +11 -0
- data/vendor/assets/stylesheets/components/_all.scss +29 -0
- data/vendor/assets/stylesheets/components/accordion/_accordion.scss +188 -0
- data/vendor/assets/stylesheets/components/back-link/_back-link.scss +54 -0
- data/vendor/assets/stylesheets/components/breadcrumbs/_breadcrumbs.scss +119 -0
- data/vendor/assets/stylesheets/components/button/_button.scss +180 -0
- data/vendor/assets/stylesheets/components/character-count/_character-count.scss +31 -0
- data/vendor/assets/stylesheets/components/checkboxes/_checkboxes.scss +161 -0
- data/vendor/assets/stylesheets/components/date-input/_date-input.scss +30 -0
- data/vendor/assets/stylesheets/components/details/_details.scss +89 -0
- data/vendor/assets/stylesheets/components/error-message/_error-message.scss +15 -0
- data/vendor/assets/stylesheets/components/error-summary/_error-summary.scss +72 -0
- data/vendor/assets/stylesheets/components/fieldset/_fieldset.scss +60 -0
- data/vendor/assets/stylesheets/components/file-upload/_file-upload.scss +19 -0
- data/vendor/assets/stylesheets/components/footer/_footer.scss +233 -0
- data/vendor/assets/stylesheets/components/header/_header.scss +304 -0
- data/vendor/assets/stylesheets/components/hint/_hint.scss +50 -0
- data/vendor/assets/stylesheets/components/input/_input.scss +77 -0
- data/vendor/assets/stylesheets/components/inset-text/_inset-text.scss +28 -0
- data/vendor/assets/stylesheets/components/label/_label.scss +45 -0
- data/vendor/assets/stylesheets/components/panel/_panel.scss +44 -0
- data/vendor/assets/stylesheets/components/phase-banner/_phase-banner.scss +31 -0
- data/vendor/assets/stylesheets/components/radios/_radios.scss +187 -0
- data/vendor/assets/stylesheets/components/select/_select.scss +32 -0
- data/vendor/assets/stylesheets/components/skip-link/_skip-link.scss +26 -0
- data/vendor/assets/stylesheets/components/summary-list/_summary-list.scss +123 -0
- data/vendor/assets/stylesheets/components/table/_table.scss +53 -0
- data/vendor/assets/stylesheets/components/tabs/_tabs.scss +130 -0
- data/vendor/assets/stylesheets/components/tag/_tag.scss +33 -0
- data/vendor/assets/stylesheets/components/textarea/_textarea.scss +32 -0
- data/vendor/assets/stylesheets/components/warning-text/_warning-text.scss +59 -0
- data/vendor/assets/stylesheets/core/_all.scss +6 -0
- data/vendor/assets/stylesheets/core/_global-styles.scss +23 -0
- data/vendor/assets/stylesheets/core/_links.scss +31 -0
- data/vendor/assets/stylesheets/core/_lists.scss +58 -0
- data/vendor/assets/stylesheets/core/_section-break.scss +60 -0
- data/vendor/assets/stylesheets/core/_template.scss +35 -0
- data/vendor/assets/stylesheets/core/_typography.scss +190 -0
- data/vendor/assets/stylesheets/govuk-frontend-rails.scss +16 -0
- data/vendor/assets/stylesheets/helpers/_all.scss +12 -0
- data/vendor/assets/stylesheets/helpers/_clearfix.scss +15 -0
- data/vendor/assets/stylesheets/helpers/_colour.scss +51 -0
- data/vendor/assets/stylesheets/helpers/_device-pixels.scss +38 -0
- data/vendor/assets/stylesheets/helpers/_focusable.scss +34 -0
- data/vendor/assets/stylesheets/helpers/_font-faces.scss +67 -0
- data/vendor/assets/stylesheets/helpers/_grid.scss +107 -0
- data/vendor/assets/stylesheets/helpers/_links.scss +200 -0
- data/vendor/assets/stylesheets/helpers/_media-queries.scss +95 -0
- data/vendor/assets/stylesheets/helpers/_shape-arrow.scss +80 -0
- data/vendor/assets/stylesheets/helpers/_spacing.scss +152 -0
- data/vendor/assets/stylesheets/helpers/_typography.scss +188 -0
- data/vendor/assets/stylesheets/helpers/_visually-hidden.scss +82 -0
- data/vendor/assets/stylesheets/objects/_all.scss +4 -0
- data/vendor/assets/stylesheets/objects/_form-group.scss +25 -0
- data/vendor/assets/stylesheets/objects/_grid.scss +27 -0
- data/vendor/assets/stylesheets/objects/_main-wrapper.scss +53 -0
- data/vendor/assets/stylesheets/objects/_width-container.scss +63 -0
- data/vendor/assets/stylesheets/overrides/_all.scss +4 -0
- data/vendor/assets/stylesheets/overrides/_display.scss +18 -0
- data/vendor/assets/stylesheets/overrides/_spacing.scss +62 -0
- data/vendor/assets/stylesheets/overrides/_typography.scss +25 -0
- data/vendor/assets/stylesheets/overrides/_width.scss +49 -0
- data/vendor/assets/stylesheets/settings/_all.scss +21 -0
- data/vendor/assets/stylesheets/settings/_assets.scss +82 -0
- data/vendor/assets/stylesheets/settings/_colours-applied.scss +140 -0
- data/vendor/assets/stylesheets/settings/_colours-organisations.scss +136 -0
- data/vendor/assets/stylesheets/settings/_colours-palette.scss +37 -0
- data/vendor/assets/stylesheets/settings/_compatibility.scss +51 -0
- data/vendor/assets/stylesheets/settings/_global-styles.scss +13 -0
- data/vendor/assets/stylesheets/settings/_ie8.scss +18 -0
- data/vendor/assets/stylesheets/settings/_measurements.scss +99 -0
- data/vendor/assets/stylesheets/settings/_media-queries.scss +23 -0
- data/vendor/assets/stylesheets/settings/_spacing.scss +80 -0
- data/vendor/assets/stylesheets/settings/_typography-font-families.scss +22 -0
- data/vendor/assets/stylesheets/settings/_typography-font.scss +60 -0
- data/vendor/assets/stylesheets/settings/_typography-responsive.scss +180 -0
- data/vendor/assets/stylesheets/tools/_all.scss +8 -0
- data/vendor/assets/stylesheets/tools/_compatibility.scss +36 -0
- data/vendor/assets/stylesheets/tools/_exports.scss +33 -0
- data/vendor/assets/stylesheets/tools/_font-url.scss +28 -0
- data/vendor/assets/stylesheets/tools/_ie8.scss +51 -0
- data/vendor/assets/stylesheets/tools/_iff.scss +15 -0
- data/vendor/assets/stylesheets/tools/_image-url.scss +28 -0
- data/vendor/assets/stylesheets/tools/_px-to-em.scss +20 -0
- data/vendor/assets/stylesheets/tools/_px-to-rem.scss +20 -0
- data/vendor/assets/stylesheets/utilities/_all.scss +2 -0
- data/vendor/assets/stylesheets/utilities/_clearfix.scss +5 -0
- data/vendor/assets/stylesheets/utilities/_visually-hidden.scss +10 -0
- data/vendor/assets/stylesheets/vendor/_sass-mq.scss +351 -0
- metadata +204 -0
@@ -0,0 +1,188 @@
|
|
1
|
+
////
|
2
|
+
/// @group helpers
|
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 NTA font we need to include the font-face declarations.
|
21
|
+
// We do not need to include the NTA font-face declarations if alphagov/govuk_template is being used since they will already be included.
|
22
|
+
@if ($govuk-include-default-font-face) {
|
23
|
+
@include _govuk-font-face-nta;
|
24
|
+
}
|
25
|
+
|
26
|
+
@include govuk-media-query($media-type: print) {
|
27
|
+
font-family: $govuk-font-family-print;
|
28
|
+
}
|
29
|
+
}
|
30
|
+
|
31
|
+
/// Text colour helper
|
32
|
+
///
|
33
|
+
/// Sets the text colour, including a suitable override for print.
|
34
|
+
///
|
35
|
+
/// @access public
|
36
|
+
|
37
|
+
@mixin govuk-text-colour {
|
38
|
+
color: $govuk-text-colour;
|
39
|
+
|
40
|
+
@include govuk-media-query($media-type: print) {
|
41
|
+
color: $govuk-print-text-colour;
|
42
|
+
}
|
43
|
+
}
|
44
|
+
|
45
|
+
/// Regular font weight helper
|
46
|
+
///
|
47
|
+
/// @param {Boolean} $important [false] - Whether to mark declarations as
|
48
|
+
/// `!important`. Generally Used to create override classes.
|
49
|
+
/// @access public
|
50
|
+
|
51
|
+
@mixin govuk-typography-weight-regular($important: false) {
|
52
|
+
font-weight: $govuk-font-weight-regular iff($important, !important);
|
53
|
+
}
|
54
|
+
|
55
|
+
/// Bold font weight helper
|
56
|
+
///
|
57
|
+
/// @param {Boolean} $important [false] - Whether to mark declarations as
|
58
|
+
/// `!important`. Generally Used to create override classes.
|
59
|
+
/// @access public
|
60
|
+
|
61
|
+
@mixin govuk-typography-weight-bold($important: false) {
|
62
|
+
font-weight: $govuk-font-weight-bold iff($important, !important);
|
63
|
+
}
|
64
|
+
|
65
|
+
/// Convert line-heights specified in pixels into a relative value, unless
|
66
|
+
/// they are already unit-less (and thus already treated as relative values)
|
67
|
+
/// or the units do not match the units used for the font size.
|
68
|
+
///
|
69
|
+
/// @param {Number} $line-height Line height
|
70
|
+
/// @param {Number} $font-size Font size
|
71
|
+
/// @return {Number} The line height as either a relative value or unmodified
|
72
|
+
///
|
73
|
+
/// @access private
|
74
|
+
@function _govuk-line-height($line-height, $font-size) {
|
75
|
+
@if not unitless($line-height) and unit($line-height) == unit($font-size) {
|
76
|
+
$line-height: $line-height / $font-size;
|
77
|
+
}
|
78
|
+
|
79
|
+
@return $line-height;
|
80
|
+
}
|
81
|
+
|
82
|
+
/// Responsive typography helper
|
83
|
+
///
|
84
|
+
/// Takes a 'font map' as an argument and uses it to create font-size and
|
85
|
+
/// line-height declarations for different breakpoints, and for print.
|
86
|
+
///
|
87
|
+
/// Example font map:
|
88
|
+
///
|
89
|
+
/// $my-font-map: (
|
90
|
+
/// null: (
|
91
|
+
/// font-size: 16px,
|
92
|
+
/// line-height: 20px
|
93
|
+
/// ),
|
94
|
+
/// tablet: (
|
95
|
+
/// font-size: 19px,
|
96
|
+
/// line-height: 25px
|
97
|
+
/// ),
|
98
|
+
/// print: (
|
99
|
+
/// font-size: 14pt,
|
100
|
+
/// line-height: 1.15
|
101
|
+
/// )
|
102
|
+
/// );
|
103
|
+
///
|
104
|
+
/// @param {Map} $font-map - Font map
|
105
|
+
/// @param {Number} $override-line-height [false] - Non responsive custom line
|
106
|
+
/// height. Omit to use the line height from the font map.
|
107
|
+
/// @param {Boolean} $important [false] - Whether to mark declarations as
|
108
|
+
/// `!important`.
|
109
|
+
///
|
110
|
+
/// @access public
|
111
|
+
|
112
|
+
@mixin govuk-typography-responsive($size, $override-line-height: false, $important: false) {
|
113
|
+
|
114
|
+
@if not map-has-key($govuk-typography-scale, $size) {
|
115
|
+
@error "Unknown font size `#{$size}` - expected a point from the typography scale.";
|
116
|
+
}
|
117
|
+
|
118
|
+
$font-map: map-get($govuk-typography-scale, $size);
|
119
|
+
|
120
|
+
@each $breakpoint, $breakpoint-map in $font-map {
|
121
|
+
$font-size: map-get($breakpoint-map, "font-size");
|
122
|
+
$font-size-rem: govuk-px-to-rem($font-size);
|
123
|
+
|
124
|
+
$line-height: _govuk-line-height(
|
125
|
+
$line-height: if($override-line-height,
|
126
|
+
$override-line-height,
|
127
|
+
map-get($breakpoint-map, "line-height")
|
128
|
+
),
|
129
|
+
$font-size: $font-size
|
130
|
+
);
|
131
|
+
|
132
|
+
// Mark rules as !important if $important is true - this will result in
|
133
|
+
// these variables becoming strings, so this needs to happen *after* they
|
134
|
+
// are used in calculations
|
135
|
+
$font-size: $font-size iff($important, !important);
|
136
|
+
$font-size-rem: $font-size-rem iff($important, !important);
|
137
|
+
$line-height: $line-height iff($important, !important);
|
138
|
+
|
139
|
+
@if $breakpoint == null {
|
140
|
+
font-size: $font-size; // sass-lint:disable no-duplicate-properties
|
141
|
+
@if $govuk-typography-use-rem {
|
142
|
+
font-size: $font-size-rem; // sass-lint:disable no-duplicate-properties
|
143
|
+
}
|
144
|
+
line-height: $line-height;
|
145
|
+
} @elseif $breakpoint == "print" {
|
146
|
+
@include govuk-media-query($media-type: print) {
|
147
|
+
font-size: $font-size;
|
148
|
+
line-height: $line-height;
|
149
|
+
}
|
150
|
+
} @else {
|
151
|
+
@include govuk-media-query($from: $breakpoint) {
|
152
|
+
font-size: $font-size; // sass-lint:disable no-duplicate-properties
|
153
|
+
@if $govuk-typography-use-rem {
|
154
|
+
font-size: $font-size-rem; // sass-lint:disable no-duplicate-properties
|
155
|
+
}
|
156
|
+
line-height: $line-height;
|
157
|
+
}
|
158
|
+
}
|
159
|
+
}
|
160
|
+
}
|
161
|
+
|
162
|
+
/// Font helper
|
163
|
+
///
|
164
|
+
/// @param {Number} $size - Size of the font as it would appear on desktop -
|
165
|
+
/// uses the responsive font size map
|
166
|
+
/// @param {String} $weight [regular] - Weight: `bold` or `regular`
|
167
|
+
/// @param {Boolean} $tabular [false] - Whether to use tabular numbers or not
|
168
|
+
/// @param {Number} $line-height [false] - Line-height, if overriding the default
|
169
|
+
///
|
170
|
+
/// @access public
|
171
|
+
|
172
|
+
@mixin govuk-font($size, $weight: regular, $tabular: false, $line-height: false) {
|
173
|
+
@if $tabular {
|
174
|
+
@include govuk-typography-common($font-family: $govuk-font-family-tabular);
|
175
|
+
} @else {
|
176
|
+
@include govuk-typography-common;
|
177
|
+
}
|
178
|
+
|
179
|
+
@if $weight == regular {
|
180
|
+
@include govuk-typography-weight-regular;
|
181
|
+
} @else if $weight == bold {
|
182
|
+
@include govuk-typography-weight-bold;
|
183
|
+
}
|
184
|
+
|
185
|
+
@if $size {
|
186
|
+
@include govuk-typography-responsive($size, $override-line-height: $line-height);
|
187
|
+
}
|
188
|
+
}
|
@@ -0,0 +1,82 @@
|
|
1
|
+
////
|
2
|
+
/// @group helpers
|
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 iff($important, !important);
|
18
|
+
|
19
|
+
width: 1px iff($important, !important);
|
20
|
+
height: 1px iff($important, !important);
|
21
|
+
// If margin is set to a negative value it can cause text to be announced in the wrong order in VoiceOver for OSX
|
22
|
+
margin: 0 iff($important, !important);
|
23
|
+
padding: 0 iff($important, !important);
|
24
|
+
|
25
|
+
overflow: hidden iff($important, !important);
|
26
|
+
clip: rect(0 0 0 0) iff($important, !important);
|
27
|
+
-webkit-clip-path: inset(50%) iff($important, !important);
|
28
|
+
clip-path: inset(50%) iff($important, !important);
|
29
|
+
|
30
|
+
border: 0 iff($important, !important);
|
31
|
+
|
32
|
+
// For long content, line feeds are not interpreted as spaces and small width
|
33
|
+
// causes content to wrap 1 word per line:
|
34
|
+
// https://medium.com/@jessebeach/beware-smushed-off-screen-accessible-text-5952a4c2cbfe
|
35
|
+
white-space: nowrap iff($important, !important);
|
36
|
+
}
|
37
|
+
|
38
|
+
/// Hide an element visually, but have it available for screen readers whilst
|
39
|
+
/// allowing the element to be focused when navigated to via the keyboard (e.g.
|
40
|
+
/// for the skip link)
|
41
|
+
///
|
42
|
+
/// This is slightly less opinionated about borders and padding to make it
|
43
|
+
/// easier to style the focussed element.
|
44
|
+
///
|
45
|
+
/// @param {Boolean} $important [true] - Whether to mark as `!important`
|
46
|
+
///
|
47
|
+
/// @access public
|
48
|
+
|
49
|
+
@mixin govuk-visually-hidden-focusable($important: true) {
|
50
|
+
position: absolute iff($important, !important);
|
51
|
+
|
52
|
+
width: 1px iff($important, !important);
|
53
|
+
height: 1px iff($important, !important);
|
54
|
+
// If margin is set to a negative value it can cause text to be announced in the wrong order in VoiceOver for OSX
|
55
|
+
margin: 0 iff($important, !important);
|
56
|
+
|
57
|
+
overflow: hidden iff($important, !important);
|
58
|
+
clip: rect(0 0 0 0) iff($important, !important);
|
59
|
+
-webkit-clip-path: inset(50%) iff($important, !important);
|
60
|
+
clip-path: inset(50%) iff($important, !important);
|
61
|
+
|
62
|
+
// For long content, line feeds are not interpreted as spaces and small width
|
63
|
+
// causes content to wrap 1 word per line:
|
64
|
+
// https://medium.com/@jessebeach/beware-smushed-off-screen-accessible-text-5952a4c2cbfe
|
65
|
+
white-space: nowrap iff($important, !important);
|
66
|
+
|
67
|
+
&:active,
|
68
|
+
&:focus {
|
69
|
+
position: static iff($important, !important);
|
70
|
+
|
71
|
+
width: auto iff($important, !important);
|
72
|
+
height: auto iff($important, !important);
|
73
|
+
margin: inherit iff($important, !important);
|
74
|
+
|
75
|
+
overflow: visible iff($important, !important);
|
76
|
+
clip: auto iff($important, !important);
|
77
|
+
-webkit-clip-path: none iff($important, !important);
|
78
|
+
clip-path: none iff($important, !important);
|
79
|
+
|
80
|
+
white-space: inherit iff($important, !important);
|
81
|
+
}
|
82
|
+
}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
@import "../settings/all";
|
2
|
+
@import "../tools/all";
|
3
|
+
@import "../helpers/all";
|
4
|
+
|
5
|
+
@include govuk-exports("govuk/objects/form-group") {
|
6
|
+
|
7
|
+
.govuk-form-group {
|
8
|
+
@include govuk-responsive-margin(6, "bottom");
|
9
|
+
|
10
|
+
.govuk-form-group:last-of-type {
|
11
|
+
margin-bottom: 0; // Remove margin from last item in nested groups
|
12
|
+
}
|
13
|
+
}
|
14
|
+
|
15
|
+
.govuk-form-group--error {
|
16
|
+
padding-left: govuk-spacing(3);
|
17
|
+
border-left: $govuk-border-width-form-group-error solid $govuk-error-colour;
|
18
|
+
|
19
|
+
.govuk-form-group {
|
20
|
+
// Reset error styles in nested form groups that might have error class
|
21
|
+
padding: 0;
|
22
|
+
border: 0;
|
23
|
+
}
|
24
|
+
}
|
25
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
@import "../settings/all";
|
2
|
+
@import "../tools/all";
|
3
|
+
@import "../helpers/all";
|
4
|
+
|
5
|
+
@include govuk-exports("govuk/objects/grid") {
|
6
|
+
|
7
|
+
.govuk-grid-row {
|
8
|
+
@include govuk-clearfix;
|
9
|
+
margin-right: - ($govuk-gutter-half);
|
10
|
+
margin-left: - ($govuk-gutter-half);
|
11
|
+
}
|
12
|
+
|
13
|
+
@each $width in map-keys($govuk-grid-widths) {
|
14
|
+
.govuk-grid-column-#{$width} {
|
15
|
+
@include govuk-grid-column($width, $class: false)
|
16
|
+
}
|
17
|
+
}
|
18
|
+
|
19
|
+
// These *must* be defined in a separate loop as they have the same
|
20
|
+
// specificity as the non-breakpoint specific classes, so need to appear after
|
21
|
+
// them in the outputted CSS
|
22
|
+
@each $width in map-keys($govuk-grid-widths) {
|
23
|
+
.govuk-grid-column-#{$width}-from-desktop {
|
24
|
+
@include govuk-grid-column($width, $at: desktop, $class: false)
|
25
|
+
}
|
26
|
+
}
|
27
|
+
}
|
@@ -0,0 +1,53 @@
|
|
1
|
+
@import "../settings/all";
|
2
|
+
@import "../tools/all";
|
3
|
+
@import "../helpers/all";
|
4
|
+
|
5
|
+
// Example usage with Breadcrumbs, phase banners, back links:
|
6
|
+
// <div class="govuk-width-container">
|
7
|
+
// <!-- Breadcrumbs, phase banners, back links are placed in here. -->
|
8
|
+
// <div class="govuk-main-wrapper">
|
9
|
+
// <!-- Wrapper for the main content of your page which applies padding
|
10
|
+
// to the top / bottom -->
|
11
|
+
// </div>
|
12
|
+
// </div>
|
13
|
+
//
|
14
|
+
// Example usage without Breadcrumbs, phase banners, back links:
|
15
|
+
// <div class="govuk-width-container">
|
16
|
+
// <div class="govuk-main-wrapper govuk-main-wrapper--l">
|
17
|
+
// <!-- Wrapper for the main content of your page which applies padding
|
18
|
+
// to the top / bottom -->
|
19
|
+
// </div>
|
20
|
+
// </div>
|
21
|
+
|
22
|
+
|
23
|
+
@mixin govuk-main-wrapper {
|
24
|
+
// In IE11 the `main` element can be used, but is not recognized –
|
25
|
+
// meaning it's not defined in IE's default style sheet,
|
26
|
+
// so it uses CSS initial value, which is inline.
|
27
|
+
display: block;
|
28
|
+
padding-top: govuk-spacing(4);
|
29
|
+
padding-bottom: govuk-spacing(4);
|
30
|
+
|
31
|
+
@include govuk-media-query($from: tablet) {
|
32
|
+
// This spacing is manually adjusted to replicate the margin of
|
33
|
+
// govuk-heading-xl (50px) minus the spacing of back link and
|
34
|
+
// breadcrumbs (10px)
|
35
|
+
padding-top: govuk-spacing(7);
|
36
|
+
padding-bottom: govuk-spacing(7);
|
37
|
+
}
|
38
|
+
}
|
39
|
+
|
40
|
+
// Use govuk-main-wrapper--l when you page does not have Breadcrumbs, phase banners or back links
|
41
|
+
@mixin govuk-main-wrapper--l {
|
42
|
+
@include govuk-responsive-padding(8, "top");
|
43
|
+
}
|
44
|
+
|
45
|
+
@include govuk-exports("govuk/objects/main-wrapper") {
|
46
|
+
.govuk-main-wrapper {
|
47
|
+
@include govuk-main-wrapper;
|
48
|
+
}
|
49
|
+
|
50
|
+
.govuk-main-wrapper--l {
|
51
|
+
@include govuk-main-wrapper--l;
|
52
|
+
}
|
53
|
+
}
|
@@ -0,0 +1,63 @@
|
|
1
|
+
@import "../settings/all";
|
2
|
+
@import "../tools/all";
|
3
|
+
@import "../helpers/all";
|
4
|
+
|
5
|
+
@mixin govuk-width-container {
|
6
|
+
// Limit the width of the container to the page width
|
7
|
+
max-width: $govuk-page-width;
|
8
|
+
|
9
|
+
// On mobile, add half width gutters
|
10
|
+
margin: 0 $govuk-gutter-half;
|
11
|
+
|
12
|
+
// Respect 'display cutout' safe area (avoids notches and rounded corners)
|
13
|
+
@supports (margin: unquote("max(calc(0px))")) {
|
14
|
+
$gutter-safe-area-right: calc(#{$govuk-gutter-half} + env(safe-area-inset-right));
|
15
|
+
$gutter-safe-area-left: calc(#{$govuk-gutter-half} + env(safe-area-inset-left));
|
16
|
+
|
17
|
+
// Use max() to pick largest margin, default or with safe area
|
18
|
+
// Escaped due to Sass max() vs. CSS native max()
|
19
|
+
margin-right: unquote("max(#{$govuk-gutter-half}, #{$gutter-safe-area-right})");
|
20
|
+
margin-left: unquote("max(#{$govuk-gutter-half}, #{$gutter-safe-area-left})");
|
21
|
+
}
|
22
|
+
|
23
|
+
// On tablet, add full width gutters
|
24
|
+
@include govuk-media-query($from: tablet) {
|
25
|
+
margin: 0 $govuk-gutter;
|
26
|
+
|
27
|
+
// Respect 'display cutout' safe area (avoids notches and rounded corners)
|
28
|
+
@supports (margin: unquote("max(calc(0px))")) {
|
29
|
+
$gutter-safe-area-right: calc(#{$govuk-gutter-half} + env(safe-area-inset-right));
|
30
|
+
$gutter-safe-area-left: calc(#{$govuk-gutter-half} + env(safe-area-inset-left));
|
31
|
+
|
32
|
+
// Use max() to pick largest margin, default or with safe area
|
33
|
+
// Escaped due to Sass max() vs. CSS native max()
|
34
|
+
margin-right: unquote("max(#{$govuk-gutter}, #{$gutter-safe-area-right})");
|
35
|
+
margin-left: unquote("max(#{$govuk-gutter}, #{$gutter-safe-area-left})");
|
36
|
+
}
|
37
|
+
}
|
38
|
+
|
39
|
+
// As soon as the viewport is greater than the width of the page plus the
|
40
|
+
// gutters, just centre the content instead of adding gutters.
|
41
|
+
@include govuk-media-query($and: "(min-width: #{($govuk-page-width + $govuk-gutter * 2)})") {
|
42
|
+
margin: 0 auto;
|
43
|
+
|
44
|
+
// Since a safe area may have previously been set above,
|
45
|
+
// we need to duplicate this margin that centers the page.
|
46
|
+
@supports (margin: unquote("max(calc(0px))")) {
|
47
|
+
margin: 0 auto;
|
48
|
+
}
|
49
|
+
}
|
50
|
+
|
51
|
+
@include govuk-if-ie8 {
|
52
|
+
width: $govuk-page-width;
|
53
|
+
// Since media queries are not supported in IE8,
|
54
|
+
// we need to duplicate this margin that centers the page.
|
55
|
+
margin: 0 auto;
|
56
|
+
}
|
57
|
+
}
|
58
|
+
|
59
|
+
@include govuk-exports("govuk/objects/width-container") {
|
60
|
+
.govuk-width-container {
|
61
|
+
@include govuk-width-container;
|
62
|
+
}
|
63
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
@import "../settings/all";
|
2
|
+
@import "../tools/all";
|
3
|
+
@import "../helpers/all";
|
4
|
+
|
5
|
+
@include govuk-exports("govuk/overrides/display") {
|
6
|
+
|
7
|
+
.govuk-\!-display-inline {
|
8
|
+
display: inline !important;
|
9
|
+
}
|
10
|
+
|
11
|
+
.govuk-\!-display-inline-block {
|
12
|
+
display: inline-block !important;
|
13
|
+
}
|
14
|
+
|
15
|
+
.govuk-\!-display-block {
|
16
|
+
display: block !important;
|
17
|
+
}
|
18
|
+
}
|
@@ -0,0 +1,62 @@
|
|
1
|
+
@import "../settings/all";
|
2
|
+
@import "../tools/all";
|
3
|
+
@import "../helpers/all";
|
4
|
+
|
5
|
+
////
|
6
|
+
/// @group overrides
|
7
|
+
////
|
8
|
+
|
9
|
+
/// Directions for spacing
|
10
|
+
///
|
11
|
+
/// @type Map
|
12
|
+
/// @access private
|
13
|
+
|
14
|
+
$_spacing-directions: (
|
15
|
+
"top",
|
16
|
+
"right",
|
17
|
+
"bottom",
|
18
|
+
"left"
|
19
|
+
) !default;
|
20
|
+
|
21
|
+
/// Spacing override classes
|
22
|
+
///
|
23
|
+
/// Generate spacing override classes for the given property (e.g. margin)
|
24
|
+
/// for each point in the spacing scale.
|
25
|
+
///
|
26
|
+
/// @param {String} $property - Property to add spacing to (e.g. 'margin')
|
27
|
+
///
|
28
|
+
/// @example scss
|
29
|
+
/// .govuk-\!-margin-0 {
|
30
|
+
/// margin: 0;
|
31
|
+
/// }
|
32
|
+
///
|
33
|
+
/// .govuk-\!-margin-top-1 {
|
34
|
+
/// margin-top: [whatever spacing point 1 is...]
|
35
|
+
/// }
|
36
|
+
///
|
37
|
+
/// @access private
|
38
|
+
|
39
|
+
@mixin _govuk-generate-spacing-overrides($property) {
|
40
|
+
// For each point in the spacing scale (defined in settings), create an
|
41
|
+
// override that affects all directions...
|
42
|
+
@each $scale-point, $scale-map in $govuk-spacing-responsive-scale {
|
43
|
+
|
44
|
+
.govuk-\!-#{$property}-#{$scale-point} {
|
45
|
+
|
46
|
+
@include _govuk-responsive-spacing($scale-point, $property, "all", true);
|
47
|
+
}
|
48
|
+
|
49
|
+
// ... and then an override for each individual direction
|
50
|
+
@each $direction in $_spacing-directions {
|
51
|
+
|
52
|
+
.govuk-\!-#{$property}-#{$direction}-#{$scale-point} {
|
53
|
+
@include _govuk-responsive-spacing($scale-point, $property, $direction, true);
|
54
|
+
}
|
55
|
+
}
|
56
|
+
}
|
57
|
+
}
|
58
|
+
|
59
|
+
@include govuk-exports("govuk/overrides/spacing") {
|
60
|
+
@include _govuk-generate-spacing-overrides("margin");
|
61
|
+
@include _govuk-generate-spacing-overrides("padding");
|
62
|
+
}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
@import "../settings/all";
|
2
|
+
@import "../tools/all";
|
3
|
+
@import "../helpers/all";
|
4
|
+
|
5
|
+
@include govuk-exports("govuk/overrides/typography") {
|
6
|
+
// Font size and line height
|
7
|
+
|
8
|
+
// Generate typography override classes for each responsive font map in the
|
9
|
+
// typography scale eg .govuk-\!-font-size-80
|
10
|
+
@each $size in map-keys($govuk-typography-scale) {
|
11
|
+
.govuk-\!-font-size-#{$size} {
|
12
|
+
@include govuk-typography-responsive($size, $important: true);
|
13
|
+
}
|
14
|
+
}
|
15
|
+
|
16
|
+
// Weights
|
17
|
+
|
18
|
+
.govuk-\!-font-weight-regular {
|
19
|
+
@include govuk-typography-weight-regular($important: true);
|
20
|
+
}
|
21
|
+
|
22
|
+
.govuk-\!-font-weight-bold {
|
23
|
+
@include govuk-typography-weight-bold($important: true);
|
24
|
+
}
|
25
|
+
}
|
@@ -0,0 +1,49 @@
|
|
1
|
+
@import "../settings/all";
|
2
|
+
@import "../tools/all";
|
3
|
+
@import "../helpers/all";
|
4
|
+
|
5
|
+
@include govuk-exports("govuk/overrides/width") {
|
6
|
+
.govuk-\!-width-full {
|
7
|
+
width: 100% !important;
|
8
|
+
}
|
9
|
+
|
10
|
+
.govuk-\!-width-three-quarters {
|
11
|
+
width: 100% !important;
|
12
|
+
|
13
|
+
@include govuk-media-query($from: tablet) {
|
14
|
+
width: 75% !important;
|
15
|
+
}
|
16
|
+
}
|
17
|
+
|
18
|
+
.govuk-\!-width-two-thirds {
|
19
|
+
width: 100% !important;
|
20
|
+
|
21
|
+
@include govuk-media-query($from: tablet) {
|
22
|
+
width: 66.66% !important;
|
23
|
+
}
|
24
|
+
}
|
25
|
+
|
26
|
+
.govuk-\!-width-one-half {
|
27
|
+
width: 100% !important;
|
28
|
+
|
29
|
+
@include govuk-media-query($from: tablet) {
|
30
|
+
width: 50% !important;
|
31
|
+
}
|
32
|
+
}
|
33
|
+
|
34
|
+
.govuk-\!-width-one-third {
|
35
|
+
width: 100% !important;
|
36
|
+
|
37
|
+
@include govuk-media-query($from: tablet) {
|
38
|
+
width: 33.33% !important;
|
39
|
+
}
|
40
|
+
}
|
41
|
+
|
42
|
+
.govuk-\!-width-one-quarter {
|
43
|
+
width: 100% !important;
|
44
|
+
|
45
|
+
@include govuk-media-query($from: tablet) {
|
46
|
+
width: 25% !important;
|
47
|
+
}
|
48
|
+
}
|
49
|
+
}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
// The order we import settings in is important, as some settings files rely on
|
2
|
+
// others
|
3
|
+
|
4
|
+
@import "assets";
|
5
|
+
|
6
|
+
@import "compatibility";
|
7
|
+
@import "global-styles";
|
8
|
+
@import "ie8";
|
9
|
+
|
10
|
+
@import "media-queries";
|
11
|
+
|
12
|
+
@import "colours-palette";
|
13
|
+
@import "colours-organisations";
|
14
|
+
@import "colours-applied";
|
15
|
+
|
16
|
+
@import "spacing";
|
17
|
+
@import "measurements";
|
18
|
+
|
19
|
+
@import "typography-font-families";
|
20
|
+
@import "typography-font";
|
21
|
+
@import "typography-responsive";
|