govuk_elements_rails 0.1.0
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.
- 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,32 @@
|
|
1
|
+
// Lists
|
2
|
+
// ==========================================================================
|
3
|
+
|
4
|
+
ul,
|
5
|
+
ol {
|
6
|
+
list-style-type: none;
|
7
|
+
padding: 0;
|
8
|
+
}
|
9
|
+
|
10
|
+
// Bulleted lists
|
11
|
+
.list-bullet {
|
12
|
+
list-style-type: disc;
|
13
|
+
margin-left: 20px;
|
14
|
+
}
|
15
|
+
|
16
|
+
// Numbered lists
|
17
|
+
.list-number {
|
18
|
+
list-style-type: decimal;
|
19
|
+
margin-left: 25px;
|
20
|
+
}
|
21
|
+
|
22
|
+
.list-bullet,
|
23
|
+
.list-number {
|
24
|
+
margin-top: 5px;
|
25
|
+
margin-bottom: 20px;
|
26
|
+
}
|
27
|
+
|
28
|
+
.list-bullet li,
|
29
|
+
.list-number li {
|
30
|
+
margin-bottom: 5px;
|
31
|
+
}
|
32
|
+
|
@@ -0,0 +1,29 @@
|
|
1
|
+
// Panels
|
2
|
+
// ==========================================================================
|
3
|
+
// GOV.UK front end toolkit dependencies
|
4
|
+
@import "helpers";
|
5
|
+
|
6
|
+
|
7
|
+
// Indented panels with a grey left hand border
|
8
|
+
.panel-indent {
|
9
|
+
@extend %contain-floats;
|
10
|
+
clear: both;
|
11
|
+
border-left: 4px solid $border-colour;
|
12
|
+
|
13
|
+
padding: 10px 0 10px $gutter-half;
|
14
|
+
margin: ($gutter $gutter-half $gutter*1.5 0);
|
15
|
+
}
|
16
|
+
|
17
|
+
.panel-indent legend {
|
18
|
+
margin-top: 0;
|
19
|
+
}
|
20
|
+
|
21
|
+
// Remove bottom margin on last paragraph
|
22
|
+
.panel-indent p:only-child,
|
23
|
+
.panel-indent p:last-child {
|
24
|
+
margin-bottom: 0;
|
25
|
+
}
|
26
|
+
|
27
|
+
.panel-indent .form-group:last-child {
|
28
|
+
margin-bottom: 0;
|
29
|
+
}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
// Reset
|
2
|
+
// ==========================================================================
|
3
|
+
// flatten all browser defaults and styles inherited from gov.uk template
|
4
|
+
|
5
|
+
/* Borrowed from http://meyerweb.com/eric/tools/css/reset/ */
|
6
|
+
div, span,
|
7
|
+
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
|
8
|
+
a, abbr, acronym, address, big, cite, code,
|
9
|
+
del, dfn, em, img, ins, kbd, q, s, samp,
|
10
|
+
small, strike, strong, sub, sup, tt, var,
|
11
|
+
b, u, i, center,
|
12
|
+
dl, dt, dd, ol, ul, li,
|
13
|
+
fieldset, form, label, legend,
|
14
|
+
table, caption, tbody, tfoot, thead, tr, th, td,
|
15
|
+
article, aside, canvas, details, embed,
|
16
|
+
figure, figcaption, footer, header, hgroup,
|
17
|
+
menu, nav, output, ruby, section, summary,
|
18
|
+
time, mark {
|
19
|
+
border: none;
|
20
|
+
margin: 0;
|
21
|
+
padding: 0;
|
22
|
+
}
|
23
|
+
|
24
|
+
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
|
25
|
+
small, strike, strong, sub, sup, tt, var,
|
26
|
+
b, u, i, center,
|
27
|
+
input, textarea,
|
28
|
+
table, caption, tbody, tfoot, thead, tr, th, td {
|
29
|
+
font-size: inherit;
|
30
|
+
font-family: inherit;
|
31
|
+
line-height: inherit;
|
32
|
+
font-weight: normal;
|
33
|
+
}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
// Tables
|
2
|
+
// ==========================================================================
|
3
|
+
// GOV.UK front end toolkit dependencies
|
4
|
+
@import "typography";
|
5
|
+
@import "colours";
|
6
|
+
|
7
|
+
|
8
|
+
table {
|
9
|
+
border-collapse: collapse;
|
10
|
+
border-spacing: 0;
|
11
|
+
width: 100%;
|
12
|
+
}
|
13
|
+
|
14
|
+
table th,
|
15
|
+
table td {
|
16
|
+
@include core-16;
|
17
|
+
padding: em(14) em(20) em(10) 0;
|
18
|
+
|
19
|
+
text-align: left;
|
20
|
+
color: #0b0c0c;
|
21
|
+
border-bottom: 1px solid $border-colour;
|
22
|
+
}
|
23
|
+
|
24
|
+
table th {
|
25
|
+
font-weight: 700;
|
26
|
+
}
|
@@ -0,0 +1,67 @@
|
|
1
|
+
// Large hit area
|
2
|
+
// Radio buttons & checkboxes
|
3
|
+
|
4
|
+
@import "colours";
|
5
|
+
@import "measurements";
|
6
|
+
@import "conditionals";
|
7
|
+
|
8
|
+
// By default, block labels stack vertically
|
9
|
+
.block-label {
|
10
|
+
|
11
|
+
display: block;
|
12
|
+
float: none;
|
13
|
+
clear: left;
|
14
|
+
position: relative;
|
15
|
+
|
16
|
+
background: $panel-colour;
|
17
|
+
border: 1px solid $panel-colour;
|
18
|
+
padding: (18px $gutter $gutter-half $gutter*1.5);
|
19
|
+
margin-top: 10px;
|
20
|
+
margin-bottom: 10px;
|
21
|
+
|
22
|
+
cursor: pointer; // Encourage clicking on block labels
|
23
|
+
|
24
|
+
@include media(tablet) {
|
25
|
+
float: left;
|
26
|
+
margin-top: 5px;
|
27
|
+
margin-bottom: 5px;
|
28
|
+
// width: 25%; - Test : check that text within labels will wrap
|
29
|
+
}
|
30
|
+
|
31
|
+
// Absolutely position inputs within label, to allow text to wrap
|
32
|
+
input {
|
33
|
+
position: absolute;
|
34
|
+
top: 18px;
|
35
|
+
left: $gutter-half;
|
36
|
+
cursor: pointer;
|
37
|
+
}
|
38
|
+
|
39
|
+
// Change border on hover
|
40
|
+
&:hover {
|
41
|
+
border-color: $black;
|
42
|
+
}
|
43
|
+
}
|
44
|
+
|
45
|
+
// To stack horizontally, use .inline on parent, to sit block labels next to each other
|
46
|
+
.inline .block-label {
|
47
|
+
clear: none;
|
48
|
+
margin-right: $gutter-half;
|
49
|
+
}
|
50
|
+
|
51
|
+
// Selected and focused states
|
52
|
+
|
53
|
+
// Add selected state
|
54
|
+
.js-enabled label.selected {
|
55
|
+
background: $white;
|
56
|
+
border-color: $black;
|
57
|
+
}
|
58
|
+
|
59
|
+
// Add focus to block labels
|
60
|
+
.js-enabled label.focused {
|
61
|
+
outline: 3px solid $yellow;
|
62
|
+
}
|
63
|
+
|
64
|
+
// Remove focus from radio/checkboxes
|
65
|
+
.js-enabled .focused input:focus {
|
66
|
+
outline: none;
|
67
|
+
}
|
@@ -0,0 +1,46 @@
|
|
1
|
+
// Date of birth
|
2
|
+
|
3
|
+
.form-date label {
|
4
|
+
display: block;
|
5
|
+
margin-bottom: 5px;
|
6
|
+
}
|
7
|
+
|
8
|
+
.form-date .form-group {
|
9
|
+
width: 50px;
|
10
|
+
float: left;
|
11
|
+
margin-right: 20px;
|
12
|
+
margin-bottom: 0;
|
13
|
+
clear: none;
|
14
|
+
}
|
15
|
+
|
16
|
+
.form-date .form-group-year {
|
17
|
+
width: 70px;
|
18
|
+
}
|
19
|
+
|
20
|
+
.form-date .form-group input {
|
21
|
+
width: 100%;
|
22
|
+
}
|
23
|
+
|
24
|
+
|
25
|
+
// Use Modernizr to detect for touch events
|
26
|
+
// Build: http://modernizr.com/download/#-touch-cssclasses-teststyles-prefixes
|
27
|
+
|
28
|
+
// Hide date of birth
|
29
|
+
.touch .form-date {
|
30
|
+
display: none;
|
31
|
+
}
|
32
|
+
|
33
|
+
// Hide native date of birth
|
34
|
+
.no-touch .native-date-picker {
|
35
|
+
display: none;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Show native date of birth
|
39
|
+
.touch .native-date-picker {
|
40
|
+
display: block;
|
41
|
+
}
|
42
|
+
|
43
|
+
// Set a minimum height for date inputs
|
44
|
+
.touch input[type="date"] {
|
45
|
+
min-height: 36px;
|
46
|
+
}
|
@@ -0,0 +1,68 @@
|
|
1
|
+
// Validation summary box
|
2
|
+
|
3
|
+
@import "colours";
|
4
|
+
@import "measurements";
|
5
|
+
@import "conditionals";
|
6
|
+
@import "typography";
|
7
|
+
|
8
|
+
.validation-summary {
|
9
|
+
border: 3px solid $error-colour;
|
10
|
+
padding: $gutter-half $gutter;
|
11
|
+
margin-bottom: $gutter;
|
12
|
+
|
13
|
+
@include ie-lte(6){
|
14
|
+
zoom: 1;
|
15
|
+
}
|
16
|
+
}
|
17
|
+
|
18
|
+
.validation-summary ul {
|
19
|
+
margin-top: 10px;
|
20
|
+
}
|
21
|
+
|
22
|
+
.validation-summary li,
|
23
|
+
.validation-summary p {
|
24
|
+
@include core-16;
|
25
|
+
}
|
26
|
+
|
27
|
+
.validation-summary p {
|
28
|
+
margin-top: $gutter-half;
|
29
|
+
margin-bottom: 5px;
|
30
|
+
}
|
31
|
+
|
32
|
+
.validation-summary a {
|
33
|
+
color: $error-colour;
|
34
|
+
@include ie-lte(6) {
|
35
|
+
color: $error-colour !important;
|
36
|
+
}
|
37
|
+
}
|
38
|
+
|
39
|
+
.validation-summary .heading-small {
|
40
|
+
margin-top: $gutter-half;
|
41
|
+
}
|
42
|
+
|
43
|
+
|
44
|
+
// Validation error message box
|
45
|
+
// .validation-error {
|
46
|
+
// clear: both;
|
47
|
+
// @extend %contain-floats;
|
48
|
+
// border-left: 3px solid $error-colour;
|
49
|
+
// padding: $gutter- $gutter;
|
50
|
+
// margin-bottom: $gutter-half;
|
51
|
+
// margin-left: -($gutter);
|
52
|
+
// }
|
53
|
+
|
54
|
+
// .validation-error .form-group {
|
55
|
+
// margin-bottom: 20px;
|
56
|
+
// }
|
57
|
+
|
58
|
+
// .validation-error p {
|
59
|
+
// margin-bottom: 10px;
|
60
|
+
// }
|
61
|
+
|
62
|
+
|
63
|
+
// Validation message
|
64
|
+
.validation-message {
|
65
|
+
display: block;
|
66
|
+
@include core-16;
|
67
|
+
color: $error-colour;
|
68
|
+
}
|
@@ -0,0 +1,36 @@
|
|
1
|
+
// Helpers
|
2
|
+
@import "elements/helpers";
|
3
|
+
|
4
|
+
// Reset
|
5
|
+
@import "elements/reset";
|
6
|
+
|
7
|
+
// Typography
|
8
|
+
@import "elements/elements-typography";
|
9
|
+
|
10
|
+
// Layout
|
11
|
+
@import "elements/layout";
|
12
|
+
|
13
|
+
// Modules
|
14
|
+
// ==========================================================================
|
15
|
+
|
16
|
+
// Forms
|
17
|
+
@import "elements/forms";
|
18
|
+
|
19
|
+
// Tables
|
20
|
+
@import "elements/tables";
|
21
|
+
|
22
|
+
// Buttons
|
23
|
+
@import "elements/buttons";
|
24
|
+
|
25
|
+
// Details
|
26
|
+
@import "elements/details";
|
27
|
+
|
28
|
+
// Lists
|
29
|
+
@import "elements/lists";
|
30
|
+
|
31
|
+
// Panels
|
32
|
+
@import "elements/panels";
|
33
|
+
|
34
|
+
// Icons
|
35
|
+
@import "elements/icons";
|
36
|
+
|
@@ -0,0 +1,144 @@
|
|
1
|
+
// http://prismjs.com/download.html?themes=prism&languages=markup+css+scss
|
2
|
+
//
|
3
|
+
// prism.js default theme for JavaScript, CSS and HTML
|
4
|
+
// Based on dabblet (http://dabblet.com)
|
5
|
+
// @author Lea Verou
|
6
|
+
//
|
7
|
+
|
8
|
+
// Create extra spacing under snippets
|
9
|
+
.example {
|
10
|
+
margin-bottom: 20px;
|
11
|
+
}
|
12
|
+
|
13
|
+
code[class*="language-"],
|
14
|
+
pre[class*="language-"] {
|
15
|
+
color: black;
|
16
|
+
text-shadow: 0 1px white;
|
17
|
+
font-family: Consolas, Monaco, 'Andale Mono', monospace;
|
18
|
+
direction: ltr;
|
19
|
+
text-align: left;
|
20
|
+
white-space: pre;
|
21
|
+
word-spacing: normal;
|
22
|
+
word-break: normal;
|
23
|
+
|
24
|
+
|
25
|
+
-moz-tab-size: 4;
|
26
|
+
-o-tab-size: 4;
|
27
|
+
tab-size: 4;
|
28
|
+
|
29
|
+
-webkit-hyphens: none;
|
30
|
+
-moz-hyphens: none;
|
31
|
+
-ms-hyphens: none;
|
32
|
+
hyphens: none;
|
33
|
+
}
|
34
|
+
|
35
|
+
pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection,
|
36
|
+
code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection {
|
37
|
+
text-shadow: none;
|
38
|
+
background: #b3d4fc;
|
39
|
+
}
|
40
|
+
|
41
|
+
pre[class*="language-"]::selection, pre[class*="language-"] ::selection,
|
42
|
+
code[class*="language-"]::selection, code[class*="language-"] ::selection {
|
43
|
+
text-shadow: none;
|
44
|
+
background: #b3d4fc;
|
45
|
+
}
|
46
|
+
|
47
|
+
@media print {
|
48
|
+
code[class*="language-"],
|
49
|
+
pre[class*="language-"] {
|
50
|
+
text-shadow: none;
|
51
|
+
}
|
52
|
+
}
|
53
|
+
|
54
|
+
/* Code blocks */
|
55
|
+
pre[class*="language-"] {
|
56
|
+
padding: 1em;
|
57
|
+
margin: .5em 0;
|
58
|
+
overflow: auto;
|
59
|
+
}
|
60
|
+
|
61
|
+
:not(pre) > code[class*="language-"],
|
62
|
+
pre[class*="language-"] {
|
63
|
+
background: #f5f2f0;
|
64
|
+
}
|
65
|
+
|
66
|
+
/* Inline code */
|
67
|
+
:not(pre) > code[class*="language-"] {
|
68
|
+
padding: .1em;
|
69
|
+
border-radius: .3em;
|
70
|
+
}
|
71
|
+
|
72
|
+
// Undo GOV.UK elements styles being inherited here
|
73
|
+
pre,
|
74
|
+
code {
|
75
|
+
font-size: 14px;
|
76
|
+
border: 0;
|
77
|
+
background: none;
|
78
|
+
line-height: inherit;
|
79
|
+
padding: 0;
|
80
|
+
}
|
81
|
+
|
82
|
+
.token.comment,
|
83
|
+
.token.prolog,
|
84
|
+
.token.doctype,
|
85
|
+
.token.cdata {
|
86
|
+
color: slategray;
|
87
|
+
}
|
88
|
+
|
89
|
+
.token.punctuation {
|
90
|
+
color: #999;
|
91
|
+
}
|
92
|
+
|
93
|
+
.namespace {
|
94
|
+
opacity: .7;
|
95
|
+
}
|
96
|
+
|
97
|
+
.token.property,
|
98
|
+
.token.tag,
|
99
|
+
.token.boolean,
|
100
|
+
.token.number,
|
101
|
+
.token.constant,
|
102
|
+
.token.symbol {
|
103
|
+
color: #905;
|
104
|
+
}
|
105
|
+
|
106
|
+
.token.selector,
|
107
|
+
.token.attr-name,
|
108
|
+
.token.string,
|
109
|
+
.token.builtin {
|
110
|
+
color: #690;
|
111
|
+
}
|
112
|
+
|
113
|
+
.token.operator,
|
114
|
+
.token.entity,
|
115
|
+
.token.url,
|
116
|
+
.language-css .token.string,
|
117
|
+
.style .token.string,
|
118
|
+
.token.variable {
|
119
|
+
color: #a67f59;
|
120
|
+
background: hsla(0,0%,100%,.5);
|
121
|
+
}
|
122
|
+
|
123
|
+
.token.atrule,
|
124
|
+
.token.attr-value,
|
125
|
+
.token.keyword {
|
126
|
+
color: #07a;
|
127
|
+
}
|
128
|
+
|
129
|
+
.token.function {
|
130
|
+
color: #DD4A68;
|
131
|
+
}
|
132
|
+
|
133
|
+
.token.regex,
|
134
|
+
.token.important {
|
135
|
+
color: #e90;
|
136
|
+
}
|
137
|
+
|
138
|
+
.token.important {
|
139
|
+
font-weight: bold;
|
140
|
+
}
|
141
|
+
|
142
|
+
.token.entity {
|
143
|
+
cursor: help;
|
144
|
+
}
|