govuk_elements_rails 0.3.0 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +19 -0
  3. data/README.md +165 -46
  4. data/lib/govuk_elements_rails.rb +0 -1
  5. data/lib/govuk_elements_rails/engine.rb +0 -10
  6. data/vendor/assets/javascripts/details.polyfill.js +29 -43
  7. data/vendor/assets/stylesheets/_govuk-elements.scss +54 -0
  8. data/vendor/assets/stylesheets/elements/_base.scss +126 -0
  9. data/vendor/assets/stylesheets/elements/_breadcrumbs.scss +6 -0
  10. data/vendor/assets/stylesheets/elements/_buttons.scss +5 -5
  11. data/vendor/assets/stylesheets/elements/_components.scss +9 -0
  12. data/vendor/assets/stylesheets/elements/_details.scss +3 -9
  13. data/vendor/assets/stylesheets/elements/_elements-typography.scss +102 -9
  14. data/vendor/assets/stylesheets/elements/_forms.scss +84 -61
  15. data/vendor/assets/stylesheets/elements/_helpers.scss +6 -12
  16. data/vendor/assets/stylesheets/elements/_icons.scss +63 -207
  17. data/vendor/assets/stylesheets/elements/_layout.scss +9 -22
  18. data/vendor/assets/stylesheets/elements/_lists.scss +10 -13
  19. data/vendor/assets/stylesheets/elements/_panels.scss +24 -17
  20. data/vendor/assets/stylesheets/elements/_phase-banner.scss +10 -0
  21. data/vendor/assets/stylesheets/elements/_tables.scss +1 -5
  22. data/vendor/assets/stylesheets/elements/forms/_form-block-labels.scss +8 -7
  23. data/vendor/assets/stylesheets/elements/forms/_form-validation.scss +0 -3
  24. metadata +33 -49
  25. data/LICENCE +0 -20
  26. data/app/builders/govuk_elements_form_builder.rb +0 -77
  27. data/app/builders/labelling_form_builder.rb +0 -316
  28. data/lib/govuk_elements_rails/version.rb +0 -5
  29. data/vendor/assets/images/icons/accordian-arrow-2x.png +0 -0
  30. data/vendor/assets/images/icons/accordian-arrow.png +0 -0
  31. data/vendor/assets/images/icons/arrow-sprite.png +0 -0
  32. data/vendor/assets/images/icons/icon-calendar-2x.png +0 -0
  33. data/vendor/assets/images/icons/icon-calendar.png +0 -0
  34. data/vendor/assets/images/icons/icon-file-download-2x.png +0 -0
  35. data/vendor/assets/images/icons/icon-file-download.png +0 -0
  36. data/vendor/assets/images/icons/icon-important-2x.png +0 -0
  37. data/vendor/assets/images/icons/icon-important.png +0 -0
  38. data/vendor/assets/images/icons/icon-information-2x.png +0 -0
  39. data/vendor/assets/images/icons/icon-information.png +0 -0
  40. data/vendor/assets/images/icons/icon-locator-2x.png +0 -0
  41. data/vendor/assets/images/icons/icon-locator.png +0 -0
  42. data/vendor/assets/images/icons/icon-pointer-2x.png +0 -0
  43. data/vendor/assets/images/icons/icon-pointer-black-2x.png +0 -0
  44. data/vendor/assets/images/icons/icon-pointer-black.png +0 -0
  45. data/vendor/assets/images/icons/icon-pointer-indexed.png +0 -0
  46. data/vendor/assets/images/icons/icon-pointer.png +0 -0
  47. data/vendor/assets/images/icons/icon-search-2x.png +0 -0
  48. data/vendor/assets/images/icons/icon-search.png +0 -0
  49. data/vendor/assets/images/icons/player-icon-forward.png +0 -0
  50. data/vendor/assets/images/icons/player-icon-pause.png +0 -0
  51. data/vendor/assets/images/icons/player-icon-play.png +0 -0
  52. data/vendor/assets/images/icons/player-icon-rewind.png +0 -0
  53. data/vendor/assets/images/icons/player-icon-volume.png +0 -0
  54. data/vendor/assets/javascripts/application.js +0 -157
  55. data/vendor/assets/javascripts/bind.js +0 -40
  56. data/vendor/assets/javascripts/selection-buttons.js +0 -111
  57. data/vendor/assets/stylesheets/elements-page-ie6.scss +0 -5
  58. data/vendor/assets/stylesheets/elements-page-ie7.scss +0 -4
  59. data/vendor/assets/stylesheets/elements-page-ie8.scss +0 -4
  60. data/vendor/assets/stylesheets/elements-page.scss +0 -386
  61. data/vendor/assets/stylesheets/main-ie6.scss +0 -5
  62. data/vendor/assets/stylesheets/main-ie7.scss +0 -4
  63. data/vendor/assets/stylesheets/main-ie8.scss +0 -4
  64. data/vendor/assets/stylesheets/main.scss +0 -36
  65. data/vendor/assets/stylesheets/prism.scss +0 -144
  66. data/vendor/assets/stylesheets/service-design-manual/helpers/_breadcrumbs.scss +0 -81
  67. data/vendor/assets/stylesheets/service-design-manual/helpers/_page-header.scss +0 -28
  68. data/vendor/assets/stylesheets/service-design-manual/styleguide/_colours.scss +0 -3
@@ -1,16 +1,9 @@
1
1
  // Helpers
2
2
  // ==========================================================================
3
- // GOV.UK front end toolkit dependencies
4
- @import "colours";
5
- @import "shims";
6
- @import "measurements";
7
- @import "typography";
8
- @import "css3";
9
- @import "url-helpers";
10
3
 
11
4
  // Path to assets for use with file-url() is not already defined
12
5
  @if ($path == false) {
13
- $path: "/public/images/";
6
+ $path: "/public/images/";
14
7
  }
15
8
 
16
9
  // Return ems from a pixel value
@@ -33,13 +26,14 @@
33
26
 
34
27
  }
35
28
 
36
- // Used to space the "back" link on example pages
37
- .example-back-link {
38
- @include inline-block;
39
- margin-top: $gutter;
29
+ // Hide for both screenreaders and browsers
30
+ .hidden {
31
+ display: none;
32
+ visibility: hidden;
40
33
  }
41
34
 
42
35
  // Hide, but not for screenreaders
36
+ .visually-hidden,
43
37
  .visuallyhidden {
44
38
  position: absolute;
45
39
  overflow: hidden;
@@ -1,246 +1,102 @@
1
- // GOV.UK icons
2
- // GOV.UK front end toolkit dependencies
3
- @import "device-pixels";
1
+ // Icons
2
+ // ==========================================================================
4
3
 
5
- .icon {
6
- background-position: 0 0;
7
- background-repeat: no-repeat;
8
- }
4
+ // Icon mixin
5
+ @mixin icon($icon-name, $icon-width, $icon-height, $icon-sub-folder:false) {
9
6
 
10
- .icon-calendar {
11
- width: 27px;
12
- height: 27px;
13
- background-image: file-url("icons/icon-calendar.png");
7
+ width: #{$icon-width}px;
8
+ height: #{$icon-height}px;
14
9
 
15
- @include device-pixel-ratio() {
16
- background-image: file-url("icons/icon-calendar-2x.png");
17
- background-size: 100%;
18
- }
19
- }
10
+ @if $icon-sub-folder {
11
+ background-image: file-url("icons/#{$icon-sub-folder}/#{$icon-name}.png");
20
12
 
21
- .icon-download {
22
- width: 30px;
23
- height: 39px;
24
- background-image: file-url("icons/icon-file-download.png");
13
+ @include device-pixel-ratio() {
14
+ background-image: file-url("icons/#{$icon-sub-folder}/#{$icon-name}-2x.png");
15
+ background-size: 100%;
16
+ }
25
17
 
26
- @include device-pixel-ratio() {
27
- background-image: file-url("icons/icon-file-download-2x.png");
28
- background-size: 100%;
29
- }
30
- }
18
+ } @else {
19
+ background-image: file-url("icons/#{$icon-name}.png");
31
20
 
32
- .icon-important {
33
- width: 34px;
34
- height: 34px;
35
- background-image: file-url("icons/icon-important.png");
36
-
37
- @include device-pixel-ratio() {
38
- background-image: file-url("icons/icon-important-2x.png");
39
- background-size: 100%;
40
- }
41
- }
42
-
43
- .icon-information {
44
- width: 27px;
45
- height: 27px;
46
- background-image: file-url("icons/icon-information.png");
47
-
48
- @include device-pixel-ratio() {
49
- background-image: file-url("icons/icon-information-2x.png");
50
- background-size: 100%;
21
+ @include device-pixel-ratio() {
22
+ background-image: file-url("icons/#{$icon-name}-2x.png");
23
+ background-size: 100%;
24
+ }
51
25
  }
52
26
  }
53
27
 
54
- .icon-locator {
55
- width: 26px;
56
- height: 36px;
57
- background-image: file-url("icons/icon-locator.png");
58
-
59
- @include device-pixel-ratio() {
60
- background-image: file-url("icons/icon-locator-2x.png");
61
- background-size: 100%;
62
- }
63
- }
64
-
65
- .icon-search {
66
- width: 30px;
67
- height: 22px;
68
- background-color: $black;
69
- background-image: file-url("icons/icon-search.png");
70
-
71
- @include device-pixel-ratio() {
72
- background-image: file-url("icons/icon-search-2x.png");
73
- background-size: 100%;
74
- }
75
- }
76
-
77
- // GOV.UK arrow icons
78
- .icon-pointer {
79
- width: 30px;
80
- height: 19px;
81
- background-color: $black;
82
- background-image: file-url("icons/icon-pointer.png");
83
-
84
- @include device-pixel-ratio() {
85
- background-image: file-url("icons/icon-pointer-2x.png");
86
- background-size: 100%;
87
- }
88
- }
89
-
90
- .icon-pointer-black {
91
- width: 23px;
92
- height: 23px;
93
- background-image: file-url("icons/icon-pointer-black.png");
28
+ .icon {
29
+ display: inline-block;
94
30
 
95
- @include device-pixel-ratio() {
96
- background-image: file-url("icons/icon-pointer-black-2x.png");
97
- background-size: 100%;
98
- }
31
+ background-position: 0 0;
32
+ background-repeat: no-repeat;
99
33
  }
100
34
 
101
- // GOV.UK external link icons
102
- // TODO (Are these provided by the template?)
103
-
104
- // GOV.UK step icons
105
- .icon-step-1 {
106
- width: 23px;
107
- height: 23px;
108
- background-image: file-url("icons/icon-steps/icon-step-1.png");
109
-
110
- @include device-pixel-ratio() {
111
- background-image: file-url("icons/icon-steps/icon-step-1-2x.png");
112
- background-size: 100%;
113
- }
35
+ // GOV.UK front end toolkit icons
36
+ .icon-calendar {
37
+ @include icon(icon-calendar, 27, 27);
114
38
  }
115
39
 
116
- .icon-step-2 {
117
- width: 23px;
118
- height: 23px;
119
- background-image: file-url("icons/icon-steps/icon-step-2.png");
120
-
121
- @include device-pixel-ratio() {
122
- background-image: file-url("icons/icon-steps/icon-step-2-2x.png");
123
- background-size: 100%;
124
- }
40
+ .icon-file-download {
41
+ @include icon(icon-file-download, 30, 39);
125
42
  }
126
43
 
127
- .icon-step-3 {
128
- width: 23px;
129
- height: 23px;
130
- background-image: file-url("icons/icon-steps/icon-step-3.png");
131
-
132
- @include device-pixel-ratio() {
133
- background-image: file-url("icons/icon-steps/icon-step-3-2x.png");
134
- background-size: 100%;
135
- }
44
+ .icon-important {
45
+ @include icon(icon-important, 35, 35);
136
46
  }
137
47
 
138
- .icon-step-4 {
139
- width: 23px;
140
- height: 23px;
141
- background-image: file-url("icons/icon-steps/icon-step-4.png");
142
-
143
- @include device-pixel-ratio() {
144
- background-image: file-url("icons/icon-steps/icon-step-4-2x.png");
145
- background-size: 100%;
146
- }
48
+ .icon-information {
49
+ @include icon(icon-information, 27, 27);
147
50
  }
148
51
 
149
- .icon-step-5 {
150
- width: 23px;
151
- height: 23px;
152
- background-image: file-url("icons/icon-steps/icon-step-5.png");
153
-
154
- @include device-pixel-ratio() {
155
- background-image: file-url("icons/icon-steps/icon-step-5-2x.png");
156
- background-size: 100%;
157
- }
52
+ .icon-locator {
53
+ @include icon(icon-locator, 26, 36);
158
54
  }
159
55
 
160
- .icon-step-6 {
161
- width: 23px;
162
- height: 23px;
163
- background-image: file-url("icons/icon-steps/icon-step-6.png");
164
-
165
- @include device-pixel-ratio() {
166
- background-image: file-url("icons/icon-steps/icon-step-6-2x.png");
167
- background-size: 100%;
168
- }
56
+ .icon-pointer {
57
+ @include icon(icon-pointer, 30, 19);
169
58
  }
170
59
 
171
- .icon-step-7 {
172
- width: 23px;
173
- height: 23px;
174
- background-image: file-url("icons/icon-steps/icon-step-7.png");
175
-
176
- @include device-pixel-ratio() {
177
- background-image: file-url("icons/icon-steps/icon-step-7-2x.png");
178
- background-size: 100%;
179
- }
60
+ .icon-pointer-black {
61
+ @include icon(icon-pointer-black, 23, 23);
180
62
  }
181
63
 
182
- .icon-step-8 {
183
- width: 23px;
184
- height: 23px;
185
- background-image: file-url("icons/icon-steps/icon-step-8.png");
186
-
187
- @include device-pixel-ratio() {
188
- background-image: file-url("icons/icon-steps/icon-step-8-2x.png");
189
- background-size: 100%;
190
- }
64
+ .icon-search {
65
+ @include icon(icon-search, 30, 22);
191
66
  }
192
67
 
193
- .icon-step-9 {
194
- width: 23px;
195
- height: 23px;
196
- background-image: file-url("icons/icon-steps/icon-step-9.png");
197
68
 
198
- @include device-pixel-ratio() {
199
- background-image: file-url("icons/icon-steps/icon-step-9-2x.png");
200
- background-size: 100%;
69
+ // GOV.UK step icons
70
+ @for $i from 1 through 14 {
71
+ .icon-step-#{$i} {
72
+ @include icon(icon-step-#{$i}, 23, 23, icon-steps);
201
73
  }
202
74
  }
203
75
 
204
- .icon-step-10 {
205
- width: 23px;
206
- height: 23px;
207
- background-image: file-url("icons/icon-steps/icon-step-10.png");
76
+ // Propose replacing step icons with circles
77
+ .circle {
78
+ display: inline-block;
79
+ @include border-radius(50%);
208
80
 
209
- @include device-pixel-ratio() {
210
- background-image: file-url("icons/icon-steps/icon-step-10-2x.png");
211
- background-size: 100%;
212
- }
213
- }
81
+ background: $black;
82
+ color: $white;
214
83
 
215
- .icon-step-11 {
216
- width: 23px;
217
- height: 23px;
218
- background-image: file-url("icons/icon-steps/icon-step-11.png");
219
-
220
- @include device-pixel-ratio() {
221
- background-image: file-url("icons/icon-steps/icon-step-11-2x.png");
222
- background-size: 100%;
223
- }
84
+ font-family: $NTA-Light-Tabular;
85
+ font-size: 12px;
86
+ font-weight: bold;
87
+ text-align: center;
224
88
  }
225
89
 
226
- .icon-step-12 {
227
- width: 23px;
228
- height: 23px;
229
- background-image: file-url("icons/icon-steps/icon-step-12.png");
230
-
231
- @include device-pixel-ratio() {
232
- background-image: file-url("icons/icon-steps/icon-step-12-2x.png");
233
- background-size: 100%;
234
- }
90
+ // All step circles are 24px x 24px
91
+ .circle-step {
92
+ min-width: 24px;
93
+ min-height: 24px;
94
+ line-height: 24px;
235
95
  }
236
96
 
237
- .icon-step-13 {
238
- width: 23px;
239
- height: 23px;
240
- background-image: file-url("icons/icon-steps/icon-step-13.png");
241
-
242
- @include device-pixel-ratio() {
243
- background-image: file-url("icons/icon-steps/icon-step-13-2x.png");
244
- background-size: 100%;
245
- }
97
+ .circle-step-large {
98
+ font-size: 19px;
99
+ min-width: 38px;
100
+ min-height: 38px;
101
+ line-height: 38px;
246
102
  }
@@ -1,14 +1,6 @@
1
1
  // Layout
2
2
  // ==========================================================================
3
3
 
4
- // GOV.UK front end toolkit dependencies
5
- @import "measurements";
6
- @import "conditionals";
7
- @import "grid_layout";
8
- @import "helpers";
9
- @import "design-patterns/alpha-beta";
10
-
11
-
12
4
  // Content
13
5
  // ==========================================================================
14
6
 
@@ -17,21 +9,13 @@
17
9
  @extend %site-width-container;
18
10
  @extend %contain-floats;
19
11
  padding-bottom: $gutter;
20
-
12
+
21
13
  @include media(desktop) {
22
14
  padding-bottom: $gutter*3;
23
15
  }
24
16
  }
25
17
 
26
18
 
27
- // Phase banner
28
- // ==========================================================================
29
-
30
- .phase-banner {
31
- @include phase-banner(alpha);
32
- }
33
-
34
-
35
19
  // Grid layout
36
20
  // ==========================================================================
37
21
 
@@ -39,10 +23,10 @@
39
23
  // For two equal columns
40
24
 
41
25
  // <div class="grid-row">
42
- // <div class="column-half">
26
+ // <div class="column-one-half">
43
27
  //
44
28
  // </div>
45
- // <div class="column-half">
29
+ // <div class="column-one-half">
46
30
  //
47
31
  // </div>
48
32
  // </div>
@@ -54,15 +38,18 @@
54
38
 
55
39
  // Use .grid-column to create a grid column with 15px gutter
56
40
  // By default grid columns break to become full width at tablet size
57
- .column-quarter {
41
+ .column-quarter,
42
+ .column-one-quarter {
58
43
  @include grid-column(1/4);
59
44
  }
60
45
 
61
- .column-half {
46
+ .column-half,
47
+ .column-one-half {
62
48
  @include grid-column(1/2);
63
49
  }
64
50
 
65
- .column-third {
51
+ .column-third,
52
+ .column-one-third {
66
53
  @include grid-column(1/3);
67
54
  }
68
55
 
@@ -4,7 +4,16 @@
4
4
  ul,
5
5
  ol {
6
6
  list-style-type: none;
7
+ }
8
+
9
+ .list {
7
10
  padding: 0;
11
+ margin-top: 5px;
12
+ margin-bottom: 20px;
13
+ }
14
+
15
+ .list li {
16
+ margin-bottom: 5px;
8
17
  }
9
18
 
10
19
  // Bulleted lists
@@ -17,20 +26,8 @@ ol {
17
26
  .list-number {
18
27
  list-style-type: decimal;
19
28
  padding-left: 20px;
20
-
29
+
21
30
  @include ie-lte(7) {
22
31
  padding-left: 28px;
23
32
  }
24
33
  }
25
-
26
- .list-bullet,
27
- .list-number {
28
- margin-top: 5px;
29
- margin-bottom: 20px;
30
- }
31
-
32
- .list-bullet li,
33
- .list-number li {
34
- margin-bottom: 5px;
35
- }
36
-