dxw_govuk_frontend_rails 2.9.0.pre.alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. checksums.yaml +7 -0
  2. data/.circleci/config.yml +33 -0
  3. data/.circleci/setup-rubygems.sh +3 -0
  4. data/.gitignore +9 -0
  5. data/CODE_OF_CONDUCT.md +74 -0
  6. data/Gemfile +4 -0
  7. data/LICENSE.txt +21 -0
  8. data/README.md +91 -0
  9. data/Rakefile +50 -0
  10. data/bin/console +14 -0
  11. data/bin/setup +8 -0
  12. data/dxw_govuk_frontend_rails.gemspec +27 -0
  13. data/lib/dxw_govuk_frontend_rails/version.rb +3 -0
  14. data/lib/dxw_govuk_frontend_rails.rb +12 -0
  15. data/package-lock.json +13 -0
  16. data/package.json +26 -0
  17. data/vendor/assets/fonts/bold-a2452cb66f-v1.woff2 +0 -0
  18. data/vendor/assets/fonts/bold-f38c792ac2-v1.woff +0 -0
  19. data/vendor/assets/fonts/bold-fb2676462a-v1.eot +0 -0
  20. data/vendor/assets/fonts/bold-tabular-357fdfbcc3-v1.eot +0 -0
  21. data/vendor/assets/fonts/bold-tabular-784c21afb8-v1.woff +0 -0
  22. data/vendor/assets/fonts/bold-tabular-b89238d840-v1.woff2 +0 -0
  23. data/vendor/assets/fonts/light-2c037cf7e1-v1.eot +0 -0
  24. data/vendor/assets/fonts/light-458f8ea81c-v1.woff +0 -0
  25. data/vendor/assets/fonts/light-f38ad40456-v1.woff2 +0 -0
  26. data/vendor/assets/fonts/light-tabular-498ea8ffe2-v1.eot +0 -0
  27. data/vendor/assets/fonts/light-tabular-62cc6f0a28-v1.woff +0 -0
  28. data/vendor/assets/fonts/light-tabular-851b10ccdd-v1.woff2 +0 -0
  29. data/vendor/assets/images/favicon.ico +0 -0
  30. data/vendor/assets/images/govuk-apple-touch-icon-152x152.png +0 -0
  31. data/vendor/assets/images/govuk-apple-touch-icon-167x167.png +0 -0
  32. data/vendor/assets/images/govuk-apple-touch-icon-180x180.png +0 -0
  33. data/vendor/assets/images/govuk-apple-touch-icon.png +0 -0
  34. data/vendor/assets/images/govuk-crest-2x.png +0 -0
  35. data/vendor/assets/images/govuk-crest.png +0 -0
  36. data/vendor/assets/images/govuk-logotype-crown.png +0 -0
  37. data/vendor/assets/images/govuk-mask-icon.svg +7 -0
  38. data/vendor/assets/images/govuk-opengraph-image.png +0 -0
  39. data/vendor/assets/images/icon-arrow-left.png +0 -0
  40. data/vendor/assets/images/icon-important.png +0 -0
  41. data/vendor/assets/images/icon-pointer-2x.png +0 -0
  42. data/vendor/assets/images/icon-pointer.png +0 -0
  43. data/vendor/assets/javascripts/govuk_frontend_rails.js +2358 -0
  44. data/vendor/assets/stylesheets/all-ie8.scss +6 -0
  45. data/vendor/assets/stylesheets/all.scss +11 -0
  46. data/vendor/assets/stylesheets/components/_all.scss +29 -0
  47. data/vendor/assets/stylesheets/components/accordion/_accordion.scss +188 -0
  48. data/vendor/assets/stylesheets/components/back-link/_back-link.scss +54 -0
  49. data/vendor/assets/stylesheets/components/breadcrumbs/_breadcrumbs.scss +119 -0
  50. data/vendor/assets/stylesheets/components/button/_button.scss +180 -0
  51. data/vendor/assets/stylesheets/components/character-count/_character-count.scss +31 -0
  52. data/vendor/assets/stylesheets/components/checkboxes/_checkboxes.scss +161 -0
  53. data/vendor/assets/stylesheets/components/date-input/_date-input.scss +30 -0
  54. data/vendor/assets/stylesheets/components/details/_details.scss +89 -0
  55. data/vendor/assets/stylesheets/components/error-message/_error-message.scss +15 -0
  56. data/vendor/assets/stylesheets/components/error-summary/_error-summary.scss +72 -0
  57. data/vendor/assets/stylesheets/components/fieldset/_fieldset.scss +60 -0
  58. data/vendor/assets/stylesheets/components/file-upload/_file-upload.scss +19 -0
  59. data/vendor/assets/stylesheets/components/footer/_footer.scss +233 -0
  60. data/vendor/assets/stylesheets/components/header/_header.scss +304 -0
  61. data/vendor/assets/stylesheets/components/hint/_hint.scss +50 -0
  62. data/vendor/assets/stylesheets/components/input/_input.scss +77 -0
  63. data/vendor/assets/stylesheets/components/inset-text/_inset-text.scss +28 -0
  64. data/vendor/assets/stylesheets/components/label/_label.scss +45 -0
  65. data/vendor/assets/stylesheets/components/panel/_panel.scss +44 -0
  66. data/vendor/assets/stylesheets/components/phase-banner/_phase-banner.scss +31 -0
  67. data/vendor/assets/stylesheets/components/radios/_radios.scss +187 -0
  68. data/vendor/assets/stylesheets/components/select/_select.scss +32 -0
  69. data/vendor/assets/stylesheets/components/skip-link/_skip-link.scss +26 -0
  70. data/vendor/assets/stylesheets/components/summary-list/_summary-list.scss +123 -0
  71. data/vendor/assets/stylesheets/components/table/_table.scss +53 -0
  72. data/vendor/assets/stylesheets/components/tabs/_tabs.scss +130 -0
  73. data/vendor/assets/stylesheets/components/tag/_tag.scss +33 -0
  74. data/vendor/assets/stylesheets/components/textarea/_textarea.scss +32 -0
  75. data/vendor/assets/stylesheets/components/warning-text/_warning-text.scss +59 -0
  76. data/vendor/assets/stylesheets/core/_all.scss +6 -0
  77. data/vendor/assets/stylesheets/core/_global-styles.scss +23 -0
  78. data/vendor/assets/stylesheets/core/_links.scss +31 -0
  79. data/vendor/assets/stylesheets/core/_lists.scss +58 -0
  80. data/vendor/assets/stylesheets/core/_section-break.scss +60 -0
  81. data/vendor/assets/stylesheets/core/_template.scss +35 -0
  82. data/vendor/assets/stylesheets/core/_typography.scss +190 -0
  83. data/vendor/assets/stylesheets/govuk-frontend-rails.scss +16 -0
  84. data/vendor/assets/stylesheets/helpers/_all.scss +12 -0
  85. data/vendor/assets/stylesheets/helpers/_clearfix.scss +15 -0
  86. data/vendor/assets/stylesheets/helpers/_colour.scss +51 -0
  87. data/vendor/assets/stylesheets/helpers/_device-pixels.scss +38 -0
  88. data/vendor/assets/stylesheets/helpers/_focusable.scss +34 -0
  89. data/vendor/assets/stylesheets/helpers/_font-faces.scss +67 -0
  90. data/vendor/assets/stylesheets/helpers/_grid.scss +107 -0
  91. data/vendor/assets/stylesheets/helpers/_links.scss +200 -0
  92. data/vendor/assets/stylesheets/helpers/_media-queries.scss +95 -0
  93. data/vendor/assets/stylesheets/helpers/_shape-arrow.scss +80 -0
  94. data/vendor/assets/stylesheets/helpers/_spacing.scss +152 -0
  95. data/vendor/assets/stylesheets/helpers/_typography.scss +188 -0
  96. data/vendor/assets/stylesheets/helpers/_visually-hidden.scss +82 -0
  97. data/vendor/assets/stylesheets/objects/_all.scss +4 -0
  98. data/vendor/assets/stylesheets/objects/_form-group.scss +25 -0
  99. data/vendor/assets/stylesheets/objects/_grid.scss +27 -0
  100. data/vendor/assets/stylesheets/objects/_main-wrapper.scss +53 -0
  101. data/vendor/assets/stylesheets/objects/_width-container.scss +63 -0
  102. data/vendor/assets/stylesheets/overrides/_all.scss +4 -0
  103. data/vendor/assets/stylesheets/overrides/_display.scss +18 -0
  104. data/vendor/assets/stylesheets/overrides/_spacing.scss +62 -0
  105. data/vendor/assets/stylesheets/overrides/_typography.scss +25 -0
  106. data/vendor/assets/stylesheets/overrides/_width.scss +49 -0
  107. data/vendor/assets/stylesheets/settings/_all.scss +21 -0
  108. data/vendor/assets/stylesheets/settings/_assets.scss +82 -0
  109. data/vendor/assets/stylesheets/settings/_colours-applied.scss +140 -0
  110. data/vendor/assets/stylesheets/settings/_colours-organisations.scss +136 -0
  111. data/vendor/assets/stylesheets/settings/_colours-palette.scss +37 -0
  112. data/vendor/assets/stylesheets/settings/_compatibility.scss +51 -0
  113. data/vendor/assets/stylesheets/settings/_global-styles.scss +13 -0
  114. data/vendor/assets/stylesheets/settings/_ie8.scss +18 -0
  115. data/vendor/assets/stylesheets/settings/_measurements.scss +99 -0
  116. data/vendor/assets/stylesheets/settings/_media-queries.scss +23 -0
  117. data/vendor/assets/stylesheets/settings/_spacing.scss +80 -0
  118. data/vendor/assets/stylesheets/settings/_typography-font-families.scss +22 -0
  119. data/vendor/assets/stylesheets/settings/_typography-font.scss +60 -0
  120. data/vendor/assets/stylesheets/settings/_typography-responsive.scss +180 -0
  121. data/vendor/assets/stylesheets/tools/_all.scss +8 -0
  122. data/vendor/assets/stylesheets/tools/_compatibility.scss +36 -0
  123. data/vendor/assets/stylesheets/tools/_exports.scss +33 -0
  124. data/vendor/assets/stylesheets/tools/_font-url.scss +28 -0
  125. data/vendor/assets/stylesheets/tools/_ie8.scss +51 -0
  126. data/vendor/assets/stylesheets/tools/_iff.scss +15 -0
  127. data/vendor/assets/stylesheets/tools/_image-url.scss +28 -0
  128. data/vendor/assets/stylesheets/tools/_px-to-em.scss +20 -0
  129. data/vendor/assets/stylesheets/tools/_px-to-rem.scss +20 -0
  130. data/vendor/assets/stylesheets/utilities/_all.scss +2 -0
  131. data/vendor/assets/stylesheets/utilities/_clearfix.scss +5 -0
  132. data/vendor/assets/stylesheets/utilities/_visually-hidden.scss +10 -0
  133. data/vendor/assets/stylesheets/vendor/_sass-mq.scss +351 -0
  134. metadata +204 -0
@@ -0,0 +1,6 @@
1
+ // By setting $govuk-is-ie8 to true, we create a version of the stylesheet that
2
+ // targets IE8 – e.g. conditionally including or excluding styles, and
3
+ // rasterizing media queries.
4
+ $govuk-is-ie8: true;
5
+
6
+ @import "all";
@@ -0,0 +1,11 @@
1
+ @import "settings/all";
2
+ @import "tools/all";
3
+ @import "helpers/all";
4
+
5
+ @import "core/all";
6
+ @import "objects/all";
7
+
8
+ @import "components/all";
9
+
10
+ @import "utilities/all";
11
+ @import "overrides/all";
@@ -0,0 +1,29 @@
1
+ @import "accordion/accordion";
2
+ @import "back-link/back-link";
3
+ @import "breadcrumbs/breadcrumbs";
4
+ @import "button/button";
5
+ @import "checkboxes/checkboxes";
6
+ @import "character-count/character-count";
7
+ @import "summary-list/summary-list";
8
+ @import "date-input/date-input";
9
+ @import "details/details";
10
+ @import "error-message/error-message";
11
+ @import "error-summary/error-summary";
12
+ @import "fieldset/fieldset";
13
+ @import "file-upload/file-upload";
14
+ @import "footer/footer";
15
+ @import "hint/hint";
16
+ @import "header/header";
17
+ @import "input/input";
18
+ @import "inset-text/inset-text";
19
+ @import "label/label";
20
+ @import "panel/panel";
21
+ @import "phase-banner/phase-banner";
22
+ @import "tabs/tabs";
23
+ @import "tag/tag";
24
+ @import "radios/radios";
25
+ @import "select/select";
26
+ @import "skip-link/skip-link";
27
+ @import "table/table";
28
+ @import "textarea/textarea";
29
+ @import "warning-text/warning-text";
@@ -0,0 +1,188 @@
1
+ @import "../../settings/all";
2
+ @import "../../tools/all";
3
+ @import "../../helpers/all";
4
+
5
+
6
+ @include govuk-exports("govuk/component/accordion") {
7
+
8
+ .govuk-accordion {
9
+ @include govuk-responsive-margin(6, "bottom");
10
+ }
11
+
12
+ // Borders between accordion sections
13
+ .govuk-accordion__section {
14
+ padding-top: govuk-spacing(3);
15
+ }
16
+
17
+ .govuk-accordion__section-header {
18
+ padding-bottom: govuk-spacing(3);
19
+ }
20
+
21
+ .govuk-accordion__section-heading {
22
+ margin-top: 0; // Override browser default
23
+ margin-bottom: 0; // Override browser default
24
+ }
25
+
26
+ // Buttons within the sections don’t need default styling
27
+ .govuk-accordion__section-button {
28
+ @include govuk-font($size: 24, $weight: bold);
29
+ display: inline-block;
30
+ margin-bottom: 0;
31
+ padding-top: govuk-spacing(3);
32
+ }
33
+
34
+ .govuk-accordion__section-summary {
35
+ margin-top: govuk-spacing(2);
36
+ margin-bottom: 0;
37
+ }
38
+
39
+ // Remove the bottom margin from the last item inside the content
40
+ .govuk-accordion__section-content > :last-child {
41
+ margin-bottom: 0;
42
+ }
43
+
44
+ // JavaScript enabled
45
+ .js-enabled {
46
+
47
+ .govuk-accordion {
48
+ // Border at the bottom of the whole accordion
49
+ border-bottom: 1px solid $govuk-border-colour;
50
+ }
51
+
52
+ // Borders between accordion sections
53
+ .govuk-accordion__section {
54
+ padding-top: 0;
55
+ border-top: 1px solid $govuk-border-colour;
56
+ }
57
+
58
+ // Hide the body of collapsed sections
59
+ .govuk-accordion__section-content {
60
+ display: none;
61
+ @include govuk-responsive-padding(3, "top");
62
+ @include govuk-responsive-padding(3, "bottom");
63
+ }
64
+
65
+ // Show the body of expanded sections
66
+ .govuk-accordion__section--expanded .govuk-accordion__section-content {
67
+ display: block;
68
+ }
69
+
70
+ // This is styled to look like a link not a button
71
+ .govuk-accordion__open-all {
72
+ @include govuk-font($size: 16);
73
+ @include govuk-link-common;
74
+ display: inline;
75
+ border-width: 0;
76
+ color: $govuk-link-colour;
77
+ background: none;
78
+ cursor: pointer;
79
+
80
+ &:focus {
81
+ background: none;
82
+ }
83
+ }
84
+
85
+ // Section headers have a pointer cursor as an additional affordance
86
+ .govuk-accordion__section-header {
87
+ position: relative;
88
+ // Safe area on the right to avoid clashing with icon
89
+ padding-right: 40px;
90
+ cursor: pointer;
91
+ }
92
+
93
+ // Section headers have a grey background on hover as an additional affodance
94
+ .govuk-accordion__section-header:hover {
95
+ background-color: govuk-colour("grey-4");
96
+ // For devices that can't hover such as touch devices,
97
+ // remove hover state as it can be stuck in that state (iOS).
98
+ @media (hover: none) {
99
+ background-color: initial;
100
+ }
101
+ }
102
+
103
+ // Setting focus styles on header so that summary that is not part of the button is included in focus
104
+ .govuk-accordion__section-header--focused {
105
+ // These replicate @mixin govuk-focusable (the mixin can't be used as the header doesn't get the focus)
106
+ outline: $govuk-focus-width solid $govuk-focus-colour;
107
+ outline-offset: 0;
108
+ }
109
+
110
+ // Buttons within the headers don’t need default styling
111
+ .govuk-accordion__section-button {
112
+ @include govuk-link-common;
113
+ width: 100%;
114
+ margin-top: 0;
115
+ margin-bottom: 0;
116
+ margin-left: 0;
117
+ padding-top: govuk-spacing(3);
118
+ padding-bottom: 0;
119
+ padding-left: 0;
120
+ border-width: 0;
121
+ // Headings in section headers have link colours as an additional affodance
122
+ color: $govuk-link-colour;
123
+ background: none;
124
+ text-align: left;
125
+ cursor: pointer;
126
+
127
+ &:focus {
128
+ outline: none;
129
+ background: none;
130
+ }
131
+ }
132
+
133
+ // Extend the touch area of the button to span the section header
134
+ .govuk-accordion__section-button:after {
135
+ content: "";
136
+ position: absolute;
137
+ top: 0;
138
+ right: 0;
139
+ bottom: 0;
140
+ left: 0;
141
+ }
142
+
143
+ .govuk-accordion__controls {
144
+ text-align: right;
145
+ }
146
+
147
+ // Display an icon to the right of each header to indicate open/closed status,
148
+ // and as an additional affordance.
149
+ .govuk-accordion__icon {
150
+ position: absolute;
151
+ top: 50%;
152
+ right: 15px;
153
+ width: 16px;
154
+ height: 16px;
155
+ margin-top: -8px;
156
+ }
157
+
158
+ .govuk-accordion__icon:after,
159
+ .govuk-accordion__icon:before {
160
+ content: "";
161
+ box-sizing: border-box;
162
+ position: absolute;
163
+ top: 0;
164
+ right: 0;
165
+ bottom: 0;
166
+ left: 0;
167
+ width: 25%;
168
+ height: 25%;
169
+ margin: auto;
170
+ border: 2px solid transparent;
171
+ background-color: govuk-colour("black");
172
+ }
173
+
174
+ .govuk-accordion__icon:before {
175
+ width: 100%;
176
+ }
177
+
178
+ .govuk-accordion__icon:after {
179
+ height: 100%;
180
+ }
181
+
182
+ // Vertical bar should be hidden when section is open, to display a '-' icon
183
+ .govuk-accordion__section--expanded .govuk-accordion__icon:after {
184
+ content: " ";
185
+ display: none;
186
+ }
187
+ }
188
+ }
@@ -0,0 +1,54 @@
1
+ @import "../../settings/all";
2
+ @import "../../tools/all";
3
+ @import "../../helpers/all";
4
+
5
+ @include govuk-exports("govuk/component/back-link") {
6
+
7
+ .govuk-back-link {
8
+ @include govuk-typography-responsive($size: 16);
9
+ @include govuk-link-common;
10
+ @include govuk-link-style-text;
11
+
12
+ display: inline-block;
13
+ position: relative;
14
+
15
+ margin-top: govuk-spacing(3);
16
+ margin-bottom: govuk-spacing(3);
17
+
18
+ // Allow space for the arrow
19
+ padding-left: 14px;
20
+
21
+ // Use border-bottom rather than text-decoration so that the arrow is
22
+ // underlined as well.
23
+ border-bottom: 1px solid govuk-colour("black");
24
+
25
+ // Underline is provided by a bottom border
26
+ text-decoration: none;
27
+
28
+ // Prepend left pointing arrow
29
+ &:before {
30
+ @include govuk-shape-arrow($direction: left, $base: 10px, $height: 6px);
31
+
32
+ content: "";
33
+
34
+ // Vertically align with the parent element
35
+ position: absolute;
36
+
37
+ top: -1px;
38
+ bottom: 1px;
39
+ left: 0;
40
+
41
+ margin: auto;
42
+ }
43
+ }
44
+
45
+ // Begin adjustments for font baseline offset
46
+ // These should be removed when the font is updated with the correct baseline
47
+
48
+ .govuk-back-link:before {
49
+ $offset: 1px;
50
+
51
+ top: $offset * -1;
52
+ bottom: $offset;
53
+ }
54
+ }
@@ -0,0 +1,119 @@
1
+ @import "../../settings/all";
2
+ @import "../../tools/all";
3
+ @import "../../helpers/all";
4
+
5
+ @include govuk-exports("govuk/component/breadcrumbs") {
6
+
7
+ // Size of chevron (excluding border)
8
+ $chevron-size: 7px;
9
+
10
+ // Size of chevron border
11
+ $chevron-border-width: 1px;
12
+
13
+ // Colour of chevron
14
+ $chevron-border-colour: $govuk-secondary-text-colour;
15
+
16
+ // Calculated altitude (△↕) of the right-angled isosceles chevron with sides
17
+ // of length 8 (7px + 1px border):
18
+ //
19
+ // √(8² + 8²) * 0.5 ≅ 5.655
20
+ $chevron-altitude-calculated: 5.655px;
21
+
22
+ .govuk-breadcrumbs {
23
+ @include govuk-font($size: 16);
24
+ @include govuk-text-colour;
25
+
26
+ margin-top: govuk-spacing(3);
27
+ margin-bottom: govuk-spacing(2);
28
+ }
29
+
30
+ .govuk-breadcrumbs__list {
31
+ @include govuk-clearfix;
32
+
33
+ margin: 0;
34
+ padding: 0;
35
+ list-style-type: none;
36
+ }
37
+
38
+ .govuk-breadcrumbs__list-item {
39
+
40
+ display: inline-block;
41
+ position: relative;
42
+
43
+ margin-bottom: govuk-spacing(1);
44
+
45
+ // Add both margin and padding such that the chevron appears centrally
46
+ // between each breadcrumb item
47
+ margin-left: govuk-spacing(2);
48
+ padding-left: govuk-spacing(2) + $chevron-altitude-calculated;
49
+
50
+ float: left;
51
+
52
+ // Create a chevron using a box with borders on two sides, rotated 45deg.
53
+ &:before {
54
+ content: "";
55
+ display: block;
56
+
57
+ position: absolute;
58
+
59
+ // Begin adjustments for font baseline offset
60
+ // These should be reverted when the font is updated with the correct
61
+ // baseline
62
+
63
+ // top: 0;
64
+ // bottom: 0;
65
+
66
+ top: -1px;
67
+ bottom: 1px;
68
+
69
+ // End adjustments for font baseline offset
70
+
71
+ // Offset by the difference between the width of the non-rotated square
72
+ // and its width when rotated
73
+ left: (($chevron-altitude-calculated * -2) + $chevron-size + $chevron-border-width);
74
+
75
+ width: $chevron-size;
76
+ height: $chevron-size;
77
+
78
+ margin: auto 0;
79
+
80
+ -webkit-transform: rotate(45deg);
81
+
82
+ -ms-transform: rotate(45deg);
83
+
84
+ transform: rotate(45deg);
85
+
86
+ border: solid;
87
+ border-width: $chevron-border-width $chevron-border-width 0 0;
88
+ border-color: $chevron-border-colour;
89
+
90
+ // Fall back to a greater than sign for IE8
91
+ @include govuk-if-ie8 {
92
+ content: "\003e"; // Greater than sign (>)
93
+ width: auto;
94
+ height: auto;
95
+ border: 0;
96
+ color: $chevron-border-colour;
97
+
98
+ // IE8 doesn't seem to like rendering pseudo-elements using @font-faces,
99
+ // so fall back to using another sans-serif font to render the chevron.
100
+ font-family: Arial, sans-serif;
101
+ }
102
+ }
103
+
104
+ &:first-child {
105
+ margin-left: 0;
106
+ padding-left: 0;
107
+
108
+ &:before {
109
+ content: none;
110
+ display: none;
111
+ }
112
+ }
113
+ }
114
+
115
+ .govuk-breadcrumbs__link {
116
+ @include govuk-link-common;
117
+ @include govuk-link-style-text;
118
+ }
119
+ }
@@ -0,0 +1,180 @@
1
+ @import "../../settings/all";
2
+ @import "../../tools/all";
3
+ @import "../../helpers/all";
4
+
5
+ @include govuk-exports("govuk/component/button") {
6
+
7
+ $govuk-button-colour: #00823b;
8
+ $govuk-button-hover-colour: darken($govuk-button-colour, 5%);
9
+ $govuk-button-shadow-colour: darken($govuk-button-colour, 15%);
10
+ $govuk-button-text-colour: govuk-colour("white");
11
+
12
+ // Because the shadow (s0) is visually 'part of' the button, we need to reduce
13
+ // the height of the button to compensate by adjusting its padding (s1) and
14
+ // increase the bottom margin to include it (s2).
15
+ $button-shadow-size: $govuk-border-width-form-element;
16
+
17
+ .govuk-button {
18
+ @include govuk-font($size: 19, $line-height: 19px);
19
+ @include govuk-focusable;
20
+
21
+ box-sizing: border-box;
22
+ display: inline-block;
23
+ position: relative;
24
+ width: 100%;
25
+ margin-top: 0;
26
+ @include govuk-responsive-margin(6, "bottom", $adjustment: $button-shadow-size); // s2
27
+ padding: (govuk-spacing(2) - $govuk-border-width-form-element - ($button-shadow-size / 2)) govuk-spacing(2); // s1
28
+ border: $govuk-border-width-form-element solid transparent;
29
+ border-radius: 0;
30
+ color: $govuk-button-text-colour;
31
+ background-color: $govuk-button-colour;
32
+ box-shadow: 0 $button-shadow-size 0 $govuk-button-shadow-colour; // s0
33
+ text-align: center;
34
+ vertical-align: top;
35
+ cursor: pointer;
36
+ -webkit-appearance: none;
37
+
38
+ @include govuk-if-ie8 {
39
+ border-bottom: $button-shadow-size solid $govuk-button-shadow-colour;
40
+ }
41
+
42
+ @include govuk-media-query($from: tablet) {
43
+ width: auto;
44
+ }
45
+
46
+ // Ensure that any global link styles are overridden
47
+ &:link,
48
+ &:visited,
49
+ &:active,
50
+ &:hover {
51
+ color: $govuk-button-text-colour;
52
+ text-decoration: none;
53
+ }
54
+
55
+ // alphagov/govuk_template includes a specific a:link:focus selector
56
+ // designed to make unvisited links a slightly darker blue when focussed, so
57
+ // we need to override the text colour for that combination of selectors so
58
+ // so that unvisited links styled as buttons do not end up with dark blue
59
+ // text when focussed.
60
+ @include govuk-compatibility(govuk_template) {
61
+ &:link:focus {
62
+ color: $govuk-button-text-colour;
63
+ }
64
+ }
65
+
66
+ // Fix unwanted button padding in Firefox
67
+ &::-moz-focus-inner {
68
+ padding: 0;
69
+ border: 0;
70
+ }
71
+
72
+ &:hover,
73
+ &:focus {
74
+ background-color: $govuk-button-hover-colour;
75
+ }
76
+
77
+ &:active {
78
+ top: $button-shadow-size;
79
+ box-shadow: none;
80
+
81
+ @include govuk-if-ie8 {
82
+ border-bottom-width: 0;
83
+ }
84
+ }
85
+
86
+ // The following adjustments do not work for <input type="button"> as
87
+ // non-container elements cannot include pseudo elements (i.e. ::before).
88
+
89
+ // Use a pseudo element to expand the click target area to include the
90
+ // button's shadow as well, in case users try to click it.
91
+ &::before {
92
+ content: "";
93
+ display: block;
94
+
95
+ position: absolute;
96
+
97
+ top: -$govuk-border-width-form-element;
98
+ right: -$govuk-border-width-form-element;
99
+ bottom: -($govuk-border-width-form-element + $button-shadow-size);
100
+ left: -$govuk-border-width-form-element;
101
+
102
+ background: transparent;
103
+ }
104
+
105
+ // When the button is active it is shifted down by $button-shadow-size to
106
+ // denote a 'pressed' state. If the user happened to click at the very top
107
+ // of the button, their mouse is no longer over the button (because it has
108
+ // 'moved beneath them') and so the click event is not fired.
109
+ //
110
+ // This corrects that by shifting the top of the pseudo element so that it
111
+ // continues to cover the area that the user originally clicked, which means
112
+ // the click event is still fired.
113
+ //
114
+ // 🎉
115
+ &:active::before {
116
+ top: -($govuk-border-width-form-element + $button-shadow-size);
117
+ }
118
+ }
119
+
120
+ .govuk-button--disabled,
121
+ .govuk-button[disabled="disabled"],
122
+ .govuk-button[disabled] {
123
+ opacity: (.5);
124
+ background: $govuk-button-colour;
125
+
126
+ &:hover {
127
+ background-color: $govuk-button-colour;
128
+ cursor: default;
129
+ }
130
+
131
+ &:focus {
132
+ outline: none;
133
+ }
134
+
135
+ &:active {
136
+ top: 0;
137
+ box-shadow: 0 $button-shadow-size 0 $govuk-button-shadow-colour; // s0
138
+ @include govuk-if-ie8 {
139
+ border-bottom: $button-shadow-size solid $govuk-button-shadow-colour; // s0
140
+ }
141
+ }
142
+ }
143
+
144
+ .govuk-button--start {
145
+ @include govuk-typography-weight-bold;
146
+ @include govuk-typography-responsive($size: 24, $override-line-height: 1);
147
+
148
+ min-height: auto;
149
+ padding-top: govuk-spacing(2) - $govuk-border-width-form-element;
150
+ padding-right: govuk-spacing(7);
151
+ padding-bottom: govuk-spacing(2) - $govuk-border-width-form-element;
152
+ padding-left: govuk-spacing(3);
153
+
154
+ background-image: govuk-image-url("icon-pointer.png");
155
+ background-repeat: no-repeat;
156
+ background-position: 100% 50%;
157
+
158
+ @include govuk-device-pixel-ratio {
159
+ background-image: govuk-image-url("icon-pointer-2x.png");
160
+ background-size: 30px 19px;
161
+ }
162
+ }
163
+
164
+ // Begin adjustments for font baseline offset
165
+ // These should be removed when the font is updated with the correct baseline
166
+ // For the 1px addition please see https://github.com/alphagov/govuk-frontend/pull/365#discussion_r154349428
167
+
168
+ $offset: 2;
169
+
170
+ .govuk-button {
171
+ padding-top: (govuk-spacing(2) - $govuk-border-width-form-element - ($button-shadow-size / 2) + $offset); // s1
172
+ padding-bottom: (govuk-spacing(2) - $govuk-border-width-form-element - ($button-shadow-size / 2) - $offset + 1); // s1
173
+ }
174
+
175
+ .govuk-button--start {
176
+ padding-top: (govuk-spacing(2) - $govuk-border-width-form-element - ($button-shadow-size / 2) + $offset); // s1
177
+ padding-bottom: (govuk-spacing(2) - $govuk-border-width-form-element - ($button-shadow-size / 2) - $offset + 1); // s1
178
+ }
179
+
180
+ }
@@ -0,0 +1,31 @@
1
+ @import "../../settings/all";
2
+ @import "../../tools/all";
3
+ @import "../../helpers/all";
4
+
5
+ @import "../error-message/error-message";
6
+ @import "../hint/hint";
7
+ @import "../label/label";
8
+
9
+ @include govuk-exports("govuk/component/character-count") {
10
+ .govuk-character-count {
11
+ @include govuk-responsive-margin(6, "bottom");
12
+
13
+ .govuk-form-group,
14
+ .govuk-textarea {
15
+ margin-bottom: govuk-spacing(1);
16
+ }
17
+
18
+ .govuk-textarea--error {
19
+ padding: govuk-spacing(1) - 2; // Stop a "jump" when width of border changes
20
+ }
21
+ }
22
+
23
+ .govuk-character-count__message {
24
+ margin-top: 0;
25
+ margin-bottom: 0;
26
+ }
27
+
28
+ .govuk-character-count__message--disabled {
29
+ visibility: hidden;
30
+ }
31
+ }