govuk_elements_rails 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENCE +20 -0
- data/README.md +54 -0
- data/lib/govuk_elements_rails.rb +4 -0
- data/lib/govuk_elements_rails/engine.rb +4 -0
- data/lib/govuk_elements_rails/version.rb +5 -0
- data/vendor/assets/javascripts/bind.js +40 -0
- data/vendor/assets/javascripts/details.polyfill.js +158 -0
- data/vendor/assets/javascripts/selection-buttons.js +137 -0
- data/vendor/assets/stylesheets/elements-page-ie6.scss +5 -0
- data/vendor/assets/stylesheets/elements-page-ie7.scss +4 -0
- data/vendor/assets/stylesheets/elements-page-ie8.scss +4 -0
- data/vendor/assets/stylesheets/elements-page.scss +333 -0
- data/vendor/assets/stylesheets/elements/_buttons.scss +44 -0
- data/vendor/assets/stylesheets/elements/_details.scss +39 -0
- data/vendor/assets/stylesheets/elements/_elements-typography.scss +179 -0
- data/vendor/assets/stylesheets/elements/_forms.scss +166 -0
- data/vendor/assets/stylesheets/elements/_helpers.scss +46 -0
- data/vendor/assets/stylesheets/elements/_icons.scss +224 -0
- data/vendor/assets/stylesheets/elements/_layout.scss +67 -0
- data/vendor/assets/stylesheets/elements/_lists.scss +32 -0
- data/vendor/assets/stylesheets/elements/_panels.scss +29 -0
- data/vendor/assets/stylesheets/elements/_reset.scss +33 -0
- data/vendor/assets/stylesheets/elements/_tables.scss +26 -0
- data/vendor/assets/stylesheets/elements/forms/_form-block-labels.scss +67 -0
- data/vendor/assets/stylesheets/elements/forms/_form-date.scss +46 -0
- data/vendor/assets/stylesheets/elements/forms/_form-validation.scss +68 -0
- data/vendor/assets/stylesheets/main-ie6.scss +5 -0
- data/vendor/assets/stylesheets/main-ie7.scss +4 -0
- data/vendor/assets/stylesheets/main-ie8.scss +4 -0
- data/vendor/assets/stylesheets/main.scss +36 -0
- data/vendor/assets/stylesheets/prism.scss +144 -0
- data/vendor/assets/stylesheets/service-design-manual/helpers/_breadcrumbs.scss +81 -0
- data/vendor/assets/stylesheets/service-design-manual/helpers/_page-header.scss +28 -0
- data/vendor/assets/stylesheets/service-design-manual/styleguide/_colours.scss +3 -0
- metadata +122 -0
@@ -0,0 +1,166 @@
|
|
1
|
+
// Forms
|
2
|
+
// ==========================================================================
|
3
|
+
// GOV.UK front end toolkit dependencies
|
4
|
+
@import "helpers";
|
5
|
+
@import "colours";
|
6
|
+
|
7
|
+
// Fieldset is used to group more than one .form-group
|
8
|
+
fieldset {
|
9
|
+
width: 100%;
|
10
|
+
@extend %contain-floats;
|
11
|
+
}
|
12
|
+
|
13
|
+
// Form group is used to wrap label and input pairs
|
14
|
+
.form-group {
|
15
|
+
float: left;
|
16
|
+
width: 100%;
|
17
|
+
@extend %contain-floats;
|
18
|
+
margin-bottom: $gutter-half;
|
19
|
+
@include media(tablet) {
|
20
|
+
margin-bottom: $gutter;
|
21
|
+
}
|
22
|
+
}
|
23
|
+
|
24
|
+
.form-group-related {
|
25
|
+
margin-bottom: 10px;
|
26
|
+
@include media(tablet) {
|
27
|
+
margin-bottom: 20px;
|
28
|
+
}
|
29
|
+
}
|
30
|
+
|
31
|
+
.form-group-compound {
|
32
|
+
margin-bottom: 10px;
|
33
|
+
}
|
34
|
+
|
35
|
+
|
36
|
+
// Form title
|
37
|
+
.form-title {
|
38
|
+
margin-bottom: $gutter;
|
39
|
+
@include media(tablet) {
|
40
|
+
margin-bottom: ($gutter*1.5);
|
41
|
+
}
|
42
|
+
}
|
43
|
+
|
44
|
+
|
45
|
+
// Labels
|
46
|
+
|
47
|
+
// Form labels, or for legends styled to look like labels
|
48
|
+
.form-label {
|
49
|
+
@include core-19;
|
50
|
+
display: block;
|
51
|
+
margin-bottom: 5px;
|
52
|
+
}
|
53
|
+
|
54
|
+
.form-label-bold {
|
55
|
+
@include bold-24;
|
56
|
+
display: block;
|
57
|
+
margin-bottom: 0;
|
58
|
+
.form-hint {
|
59
|
+
@include core-19;
|
60
|
+
}
|
61
|
+
}
|
62
|
+
|
63
|
+
// Used for paragraphs in-between form elements
|
64
|
+
.form-block {
|
65
|
+
float: left;
|
66
|
+
width: 100%;
|
67
|
+
@extend %contain-floats;
|
68
|
+
}
|
69
|
+
|
70
|
+
|
71
|
+
// Hints
|
72
|
+
|
73
|
+
// Form hints & examples are light grey and sit above a form control
|
74
|
+
.form-hint {
|
75
|
+
display: block;
|
76
|
+
color: $secondary-text-colour;
|
77
|
+
margin-bottom: 5px;
|
78
|
+
@include media (tablet) {
|
79
|
+
margin-top: 8px;
|
80
|
+
}
|
81
|
+
}
|
82
|
+
|
83
|
+
|
84
|
+
// Form controls
|
85
|
+
|
86
|
+
// By default, form controls are 50% width for desktop,
|
87
|
+
// and 100% width for mobile
|
88
|
+
.form-control {
|
89
|
+
@include core-19;
|
90
|
+
|
91
|
+
width: 100%;
|
92
|
+
@include box-sizing(border-box);
|
93
|
+
padding: 4px;
|
94
|
+
background-color: $white;
|
95
|
+
border: 1px solid $border-colour;
|
96
|
+
|
97
|
+
// Disable webkit appearance and remove rounded corners
|
98
|
+
-webkit-appearance: none;
|
99
|
+
border-radius: 0;
|
100
|
+
|
101
|
+
@include media(tablet) {
|
102
|
+
width: 50%;
|
103
|
+
}
|
104
|
+
}
|
105
|
+
|
106
|
+
|
107
|
+
// Form control widths
|
108
|
+
.form-control-3-4 {
|
109
|
+
width: 100%;
|
110
|
+
@include media(tablet) {
|
111
|
+
width: 75%;
|
112
|
+
}
|
113
|
+
}
|
114
|
+
|
115
|
+
.form-control-1-2 {
|
116
|
+
width: 100%;
|
117
|
+
@include media(tablet) {
|
118
|
+
width: 50%;
|
119
|
+
}
|
120
|
+
}
|
121
|
+
|
122
|
+
.form-control-1-4 {
|
123
|
+
width: 25%;
|
124
|
+
}
|
125
|
+
|
126
|
+
.form-control-1-8 {
|
127
|
+
width: 12.5%;
|
128
|
+
}
|
129
|
+
|
130
|
+
|
131
|
+
// Radio buttons
|
132
|
+
.form-radio {
|
133
|
+
display: block;
|
134
|
+
margin: 10px 0;
|
135
|
+
}
|
136
|
+
.form-radio input {
|
137
|
+
vertical-align: middle;
|
138
|
+
margin: -4px 5px 0 0;
|
139
|
+
}
|
140
|
+
|
141
|
+
|
142
|
+
// Checkboxes
|
143
|
+
.form-checkbox {
|
144
|
+
display: block;
|
145
|
+
margin: $gutter-half 0;
|
146
|
+
}
|
147
|
+
.form-checkbox input {
|
148
|
+
vertical-align: middle;
|
149
|
+
margin: -2px 5px 0 0;
|
150
|
+
}
|
151
|
+
|
152
|
+
// Buttons
|
153
|
+
.form .button {
|
154
|
+
@include media(mobile) {
|
155
|
+
width: 100%;
|
156
|
+
}
|
157
|
+
}
|
158
|
+
|
159
|
+
|
160
|
+
// Form validation
|
161
|
+
@import "forms/form-validation";
|
162
|
+
|
163
|
+
|
164
|
+
// Form patterns
|
165
|
+
@import "forms/form-date";
|
166
|
+
@import "forms/form-block-labels";
|
@@ -0,0 +1,46 @@
|
|
1
|
+
// Helpers
|
2
|
+
// ==========================================================================
|
3
|
+
// GOV.UK front end toolkit dependencies
|
4
|
+
@import "colours";
|
5
|
+
@import "shims";
|
6
|
+
@import "measurements";
|
7
|
+
@import "typography";
|
8
|
+
@import "css3";
|
9
|
+
|
10
|
+
// Return ems from a pixel value
|
11
|
+
// This assumes a base of 19px
|
12
|
+
@function em($px, $base: 19) {
|
13
|
+
@return ($px / $base) + em;
|
14
|
+
}
|
15
|
+
|
16
|
+
// Want to see how the grid works?
|
17
|
+
// add this class to the body to see how grid padding is set
|
18
|
+
.example-highlight-grid {
|
19
|
+
.grid-row {
|
20
|
+
background: $grey-2;
|
21
|
+
}
|
22
|
+
.column-highlight {
|
23
|
+
background: $grey-3;
|
24
|
+
width: 100%;
|
25
|
+
}
|
26
|
+
}
|
27
|
+
|
28
|
+
// Used to space the "back" link on example pages
|
29
|
+
.example-back-link {
|
30
|
+
@include inline-block;
|
31
|
+
margin-top: $gutter;
|
32
|
+
}
|
33
|
+
|
34
|
+
// Hide, but not for screenreaders
|
35
|
+
.visuallyhidden {
|
36
|
+
position: absolute;
|
37
|
+
overflow: hidden;
|
38
|
+
clip: rect(0 0 0 0);
|
39
|
+
height: 1px; width: 1px;
|
40
|
+
margin: -1px; padding: 0; border: 0;
|
41
|
+
}
|
42
|
+
|
43
|
+
// Hide, only when JavaScript is enabled
|
44
|
+
.js-enabled .js-hidden {
|
45
|
+
display: none;
|
46
|
+
}
|
@@ -0,0 +1,224 @@
|
|
1
|
+
// GOV.UK icons
|
2
|
+
// GOV.UK front end toolkit dependencies
|
3
|
+
@import "device-pixels";
|
4
|
+
|
5
|
+
.icon {
|
6
|
+
background-position: 0 0;
|
7
|
+
background-repeat: no-repeat;
|
8
|
+
}
|
9
|
+
|
10
|
+
.icon-calendar {
|
11
|
+
background-image: file-url("icons/icon-calendar.png");
|
12
|
+
@include device-pixel-ratio() {
|
13
|
+
background-image: file-url("icons/icon-calendar-2x.png");
|
14
|
+
background-size: 100%;
|
15
|
+
}
|
16
|
+
width: 27px;
|
17
|
+
height: 27px;
|
18
|
+
}
|
19
|
+
|
20
|
+
.icon-download {
|
21
|
+
background-image: file-url("icons/icon-file-download.png");
|
22
|
+
@include device-pixel-ratio() {
|
23
|
+
background-image: file-url("icons/icon-file-download-2x.png");
|
24
|
+
background-size: 100%;
|
25
|
+
}
|
26
|
+
width: 30px;
|
27
|
+
height: 39px;
|
28
|
+
}
|
29
|
+
|
30
|
+
.icon-important {
|
31
|
+
background-image: file-url("icons/icon-important.png");
|
32
|
+
@include device-pixel-ratio() {
|
33
|
+
background-image: file-url("icons/icon-important-2x.png");
|
34
|
+
background-size: 100%;
|
35
|
+
}
|
36
|
+
width: 34px;
|
37
|
+
height: 34px;
|
38
|
+
}
|
39
|
+
|
40
|
+
.icon-information {
|
41
|
+
background-image: file-url("icons/icon-information.png");
|
42
|
+
@include device-pixel-ratio() {
|
43
|
+
background-image: file-url("icons/icon-information-2x.png");
|
44
|
+
background-size: 100%;
|
45
|
+
}
|
46
|
+
width: 27px;
|
47
|
+
height: 27px;
|
48
|
+
}
|
49
|
+
|
50
|
+
.icon-locator {
|
51
|
+
background-image: file-url("icons/icon-locator.png");
|
52
|
+
@include device-pixel-ratio() {
|
53
|
+
background-image: file-url("icons/icon-locator-2x.png");
|
54
|
+
background-size: 100%;
|
55
|
+
}
|
56
|
+
width: 26px;
|
57
|
+
height: 36px;
|
58
|
+
}
|
59
|
+
|
60
|
+
.icon-search {
|
61
|
+
background-image: file-url("icons/icon-search.png");
|
62
|
+
@include device-pixel-ratio() {
|
63
|
+
background-image: file-url("icons/icon-search-2x.png");
|
64
|
+
background-size: 100%;
|
65
|
+
}
|
66
|
+
width: 30px;
|
67
|
+
height: 22px;
|
68
|
+
background-color: black;
|
69
|
+
}
|
70
|
+
|
71
|
+
// GOV.UK arrow icons
|
72
|
+
.icon-pointer {
|
73
|
+
background-image: file-url("icons/icon-pointer.png");
|
74
|
+
@include device-pixel-ratio() {
|
75
|
+
background-image: file-url("icons/icon-pointer-2x.png");
|
76
|
+
background-size: 100%;
|
77
|
+
}
|
78
|
+
width: 30px;
|
79
|
+
height: 19px;
|
80
|
+
background-color: black;
|
81
|
+
}
|
82
|
+
.icon-pointer-black {
|
83
|
+
background-image: file-url("icons/icon-pointer-black.png");
|
84
|
+
@include device-pixel-ratio() {
|
85
|
+
background-image: file-url("icons/icon-pointer-black-2x.png");
|
86
|
+
background-size: 100%;
|
87
|
+
}
|
88
|
+
width: 23px;
|
89
|
+
height: 23px;
|
90
|
+
}
|
91
|
+
|
92
|
+
// GOV.UK external link icons
|
93
|
+
// TODO (Are these provided by the template?)
|
94
|
+
|
95
|
+
// GOV.UK step icons
|
96
|
+
.icon-step-1 {
|
97
|
+
background-image: file-url("icons/icon-steps/icon-step-1.png");
|
98
|
+
@include device-pixel-ratio() {
|
99
|
+
background-image: file-url("icons/icon-steps/icon-step-1-2x.png");
|
100
|
+
background-size: 100%;
|
101
|
+
}
|
102
|
+
width: 23px;
|
103
|
+
height: 23px;
|
104
|
+
}
|
105
|
+
|
106
|
+
.icon-step-2 {
|
107
|
+
background-image: file-url("icons/icon-steps/icon-step-2.png");
|
108
|
+
@include device-pixel-ratio() {
|
109
|
+
background-image: file-url("icons/icon-steps/icon-step-2-2x.png");
|
110
|
+
background-size: 100%;
|
111
|
+
}
|
112
|
+
width: 23px;
|
113
|
+
height: 23px;
|
114
|
+
}
|
115
|
+
|
116
|
+
.icon-step-3 {
|
117
|
+
background-image: file-url("icons/icon-steps/icon-step-3.png");
|
118
|
+
@include device-pixel-ratio() {
|
119
|
+
background-image: file-url("icons/icon-steps/icon-step-3-2x.png");
|
120
|
+
background-size: 100%;
|
121
|
+
}
|
122
|
+
width: 23px;
|
123
|
+
height: 23px;
|
124
|
+
}
|
125
|
+
|
126
|
+
.icon-step-4 {
|
127
|
+
background-image: file-url("icons/icon-steps/icon-step-4.png");
|
128
|
+
@include device-pixel-ratio() {
|
129
|
+
background-image: file-url("icons/icon-steps/icon-step-4-2x.png");
|
130
|
+
background-size: 100%;
|
131
|
+
}
|
132
|
+
width: 23px;
|
133
|
+
height: 23px;
|
134
|
+
}
|
135
|
+
|
136
|
+
.icon-step-5 {
|
137
|
+
background-image: file-url("icons/icon-steps/icon-step-5.png");
|
138
|
+
@include device-pixel-ratio() {
|
139
|
+
background-image: file-url("icons/icon-steps/icon-step-5-2x.png");
|
140
|
+
background-size: 100%;
|
141
|
+
}
|
142
|
+
width: 23px;
|
143
|
+
height: 23px;
|
144
|
+
}
|
145
|
+
|
146
|
+
.icon-step-6 {
|
147
|
+
background-image: file-url("icons/icon-steps/icon-step-6.png");
|
148
|
+
@include device-pixel-ratio() {
|
149
|
+
background-image: file-url("icons/icon-steps/icon-step-6-2x.png");
|
150
|
+
background-size: 100%;
|
151
|
+
}
|
152
|
+
width: 23px;
|
153
|
+
height: 23px;
|
154
|
+
}
|
155
|
+
|
156
|
+
.icon-step-7 {
|
157
|
+
background-image: file-url("icons/icon-steps/icon-step-7.png");
|
158
|
+
@include device-pixel-ratio() {
|
159
|
+
background-image: file-url("icons/icon-steps/icon-step-7-2x.png");
|
160
|
+
background-size: 100%;
|
161
|
+
}
|
162
|
+
width: 23px;
|
163
|
+
height: 23px;
|
164
|
+
}
|
165
|
+
|
166
|
+
.icon-step-8 {
|
167
|
+
background-image: file-url("icons/icon-steps/icon-step-8.png");
|
168
|
+
@include device-pixel-ratio() {
|
169
|
+
background-image: file-url("icons/icon-steps/icon-step-8-2x.png");
|
170
|
+
background-size: 100%;
|
171
|
+
}
|
172
|
+
width: 23px;
|
173
|
+
height: 23px;
|
174
|
+
}
|
175
|
+
|
176
|
+
.icon-step-9 {
|
177
|
+
background-image: file-url("icons/icon-steps/icon-step-9.png");
|
178
|
+
@include device-pixel-ratio() {
|
179
|
+
background-image: file-url("icons/icon-steps/icon-step-9-2x.png");
|
180
|
+
background-size: 100%;
|
181
|
+
}
|
182
|
+
width: 23px;
|
183
|
+
height: 23px;
|
184
|
+
}
|
185
|
+
|
186
|
+
.icon-step-10 {
|
187
|
+
background-image: file-url("icons/icon-steps/icon-step-10.png");
|
188
|
+
@include device-pixel-ratio() {
|
189
|
+
background-image: file-url("icons/icon-steps/icon-step-10-2x.png");
|
190
|
+
background-size: 100%;
|
191
|
+
}
|
192
|
+
width: 23px;
|
193
|
+
height: 23px;
|
194
|
+
}
|
195
|
+
|
196
|
+
.icon-step-11 {
|
197
|
+
background-image: file-url("icons/icon-steps/icon-step-11.png");
|
198
|
+
@include device-pixel-ratio() {
|
199
|
+
background-image: file-url("icons/icon-steps/icon-step-11-2x.png");
|
200
|
+
background-size: 100%;
|
201
|
+
}
|
202
|
+
width: 23px;
|
203
|
+
height: 23px;
|
204
|
+
}
|
205
|
+
|
206
|
+
.icon-step-12 {
|
207
|
+
background-image: file-url("icons/icon-steps/icon-step-12.png");
|
208
|
+
@include device-pixel-ratio() {
|
209
|
+
background-image: file-url("icons/icon-steps/icon-step-12-2x.png");
|
210
|
+
background-size: 100%;
|
211
|
+
}
|
212
|
+
width: 23px;
|
213
|
+
height: 23px;
|
214
|
+
}
|
215
|
+
|
216
|
+
.icon-step-13 {
|
217
|
+
background-image: file-url("icons/icon-steps/icon-step-13.png");
|
218
|
+
@include device-pixel-ratio() {
|
219
|
+
background-image: file-url("icons/icon-steps/icon-step-13-2x.png");
|
220
|
+
background-size: 100%;
|
221
|
+
}
|
222
|
+
width: 23px;
|
223
|
+
height: 23px;
|
224
|
+
}
|
@@ -0,0 +1,67 @@
|
|
1
|
+
// Layout
|
2
|
+
// ==========================================================================
|
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
|
+
// Page container
|
13
|
+
// ==========================================================================
|
14
|
+
|
15
|
+
// Page container wraps the entire site content block
|
16
|
+
#page-container {
|
17
|
+
@extend %site-width-container;
|
18
|
+
@extend %contain-floats;
|
19
|
+
padding-bottom: $gutter;
|
20
|
+
@include media(desktop) {
|
21
|
+
padding-bottom: $gutter*3;
|
22
|
+
}
|
23
|
+
}
|
24
|
+
|
25
|
+
|
26
|
+
// Phase banner
|
27
|
+
// ==========================================================================
|
28
|
+
|
29
|
+
.phase-banner {
|
30
|
+
@include phase-banner(alpha);
|
31
|
+
}
|
32
|
+
|
33
|
+
|
34
|
+
// Grid layout
|
35
|
+
// ==========================================================================
|
36
|
+
|
37
|
+
// Usage:
|
38
|
+
// For two equal columns
|
39
|
+
|
40
|
+
// <div class="grid-row">
|
41
|
+
// <div class="column-half">
|
42
|
+
//
|
43
|
+
// </div>
|
44
|
+
// <div class="column-half">
|
45
|
+
//
|
46
|
+
// </div>
|
47
|
+
// </div>
|
48
|
+
|
49
|
+
// Use .grid-row to define a row for grid columns to sit in
|
50
|
+
.grid-row {
|
51
|
+
@extend %grid-row;
|
52
|
+
}
|
53
|
+
|
54
|
+
// Use .grid-column to create a grid column with 15px gutter
|
55
|
+
// By default grid columns break to become full width at tablet size
|
56
|
+
.column-quarter {
|
57
|
+
@include grid-column( 1/4 );
|
58
|
+
}
|
59
|
+
.column-half {
|
60
|
+
@include grid-column( 1/2 );
|
61
|
+
}
|
62
|
+
.column-third {
|
63
|
+
@include grid-column( 1/3 );
|
64
|
+
}
|
65
|
+
.column-two-thirds {
|
66
|
+
@include grid-column( 2/3 );
|
67
|
+
}
|