govuk_frontend_toolkit 0.41.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (142) hide show
  1. data/.gitignore +3 -0
  2. data/.gitmodules +3 -0
  3. data/CONTRIBUTING.md +13 -0
  4. data/Gemfile +4 -0
  5. data/LICENCE +20 -0
  6. data/README.md +46 -0
  7. data/Rakefile +16 -0
  8. data/app/assets/.gitignore +1 -0
  9. data/app/assets/.travis.yml +3 -0
  10. data/app/assets/CONTRIBUTING.md +18 -0
  11. data/app/assets/Gruntfile.js +19 -0
  12. data/app/assets/LICENCE +20 -0
  13. data/app/assets/README.md +675 -0
  14. data/app/assets/images/crests/bis_crest_13px.png +0 -0
  15. data/app/assets/images/crests/bis_crest_13px_x2.png +0 -0
  16. data/app/assets/images/crests/bis_crest_18px.png +0 -0
  17. data/app/assets/images/crests/bis_crest_18px_x2.png +0 -0
  18. data/app/assets/images/crests/bis_crest_27px.png +0 -0
  19. data/app/assets/images/crests/bis_crest_27px_x2.png +0 -0
  20. data/app/assets/images/crests/coastguard_13px.png +0 -0
  21. data/app/assets/images/crests/coastguard_13px_x2.png +0 -0
  22. data/app/assets/images/crests/coastguard_18px.png +0 -0
  23. data/app/assets/images/crests/coastguard_18px_x2.png +0 -0
  24. data/app/assets/images/crests/coastguard_27px.png +0 -0
  25. data/app/assets/images/crests/coastguard_27px_x2.png +0 -0
  26. data/app/assets/images/crests/hmrc_crest_13px.png +0 -0
  27. data/app/assets/images/crests/hmrc_crest_13px_x2.png +0 -0
  28. data/app/assets/images/crests/hmrc_crest_18px.png +0 -0
  29. data/app/assets/images/crests/hmrc_crest_18px_x2.png +0 -0
  30. data/app/assets/images/crests/hmrc_crest_27px.png +0 -0
  31. data/app/assets/images/crests/hmrc_crest_27px_x2.png +0 -0
  32. data/app/assets/images/crests/ho_crest_13px.png +0 -0
  33. data/app/assets/images/crests/ho_crest_13px_x2.png +0 -0
  34. data/app/assets/images/crests/ho_crest_18px.png +0 -0
  35. data/app/assets/images/crests/ho_crest_18px_x2.png +0 -0
  36. data/app/assets/images/crests/ho_crest_27px.png +0 -0
  37. data/app/assets/images/crests/ho_crest_27px_x2.png +0 -0
  38. data/app/assets/images/crests/mod_crest_13px.png +0 -0
  39. data/app/assets/images/crests/mod_crest_13px_x2.png +0 -0
  40. data/app/assets/images/crests/mod_crest_18px.png +0 -0
  41. data/app/assets/images/crests/mod_crest_18px_x2.png +0 -0
  42. data/app/assets/images/crests/mod_crest_27px.png +0 -0
  43. data/app/assets/images/crests/mod_crest_27px_x2.png +0 -0
  44. data/app/assets/images/crests/org_crest_13px.png +0 -0
  45. data/app/assets/images/crests/org_crest_13px_x2.png +0 -0
  46. data/app/assets/images/crests/org_crest_18px.png +0 -0
  47. data/app/assets/images/crests/org_crest_18px_x2.png +0 -0
  48. data/app/assets/images/crests/org_crest_27px.png +0 -0
  49. data/app/assets/images/crests/org_crest_27px_x2.png +0 -0
  50. data/app/assets/images/crests/portcullis_13px.png +0 -0
  51. data/app/assets/images/crests/portcullis_13px_x2.png +0 -0
  52. data/app/assets/images/crests/portcullis_18px.png +0 -0
  53. data/app/assets/images/crests/portcullis_18px_x2.png +0 -0
  54. data/app/assets/images/crests/portcullis_27px.png +0 -0
  55. data/app/assets/images/crests/portcullis_27px_x2.png +0 -0
  56. data/app/assets/images/crests/so_crest_13px.png +0 -0
  57. data/app/assets/images/crests/so_crest_13px_x2.png +0 -0
  58. data/app/assets/images/crests/so_crest_18px.png +0 -0
  59. data/app/assets/images/crests/so_crest_18px_x2.png +0 -0
  60. data/app/assets/images/crests/so_crest_27px.png +0 -0
  61. data/app/assets/images/crests/so_crest_27px_x2.png +0 -0
  62. data/app/assets/images/crests/ukaea_crest_13px.png +0 -0
  63. data/app/assets/images/crests/ukaea_crest_13px_x2.png +0 -0
  64. data/app/assets/images/crests/ukaea_crest_18px.png +0 -0
  65. data/app/assets/images/crests/ukaea_crest_18px_x2.png +0 -0
  66. data/app/assets/images/crests/ukaea_crest_27px.png +0 -0
  67. data/app/assets/images/crests/ukaea_crest_27px_x2.png +0 -0
  68. data/app/assets/images/crests/ukho_13px.png +0 -0
  69. data/app/assets/images/crests/ukho_13px_x2.png +0 -0
  70. data/app/assets/images/crests/ukho_18px.png +0 -0
  71. data/app/assets/images/crests/ukho_18px_x2.png +0 -0
  72. data/app/assets/images/crests/ukho_27px.png +0 -0
  73. data/app/assets/images/crests/ukho_27px_x2.png +0 -0
  74. data/app/assets/images/crests/wales_crest_13px.png +0 -0
  75. data/app/assets/images/crests/wales_crest_13px_x2.png +0 -0
  76. data/app/assets/images/crests/wales_crest_18px.png +0 -0
  77. data/app/assets/images/crests/wales_crest_18px_x2.png +0 -0
  78. data/app/assets/images/crests/wales_crest_27px.png +0 -0
  79. data/app/assets/images/crests/wales_crest_27px_x2.png +0 -0
  80. data/app/assets/images/external-links/external-link-24x24.png +0 -0
  81. data/app/assets/images/external-links/external-link-black-12x12.png +0 -0
  82. data/app/assets/images/external-links/external-link-black-24x24.png +0 -0
  83. data/app/assets/images/external-links/external-link.png +0 -0
  84. data/app/assets/images/icon-steps/icon-step-1-2x.png +0 -0
  85. data/app/assets/images/icon-steps/icon-step-1.png +0 -0
  86. data/app/assets/images/icon-steps/icon-step-10-2x.png +0 -0
  87. data/app/assets/images/icon-steps/icon-step-10.png +0 -0
  88. data/app/assets/images/icon-steps/icon-step-11-2x.png +0 -0
  89. data/app/assets/images/icon-steps/icon-step-11.png +0 -0
  90. data/app/assets/images/icon-steps/icon-step-12-2x.png +0 -0
  91. data/app/assets/images/icon-steps/icon-step-12.png +0 -0
  92. data/app/assets/images/icon-steps/icon-step-13-2x.png +0 -0
  93. data/app/assets/images/icon-steps/icon-step-13.png +0 -0
  94. data/app/assets/images/icon-steps/icon-step-14-2x.png +0 -0
  95. data/app/assets/images/icon-steps/icon-step-14.png +0 -0
  96. data/app/assets/images/icon-steps/icon-step-2-2x.png +0 -0
  97. data/app/assets/images/icon-steps/icon-step-2.png +0 -0
  98. data/app/assets/images/icon-steps/icon-step-3-2x.png +0 -0
  99. data/app/assets/images/icon-steps/icon-step-3.png +0 -0
  100. data/app/assets/images/icon-steps/icon-step-4-2x.png +0 -0
  101. data/app/assets/images/icon-steps/icon-step-4.png +0 -0
  102. data/app/assets/images/icon-steps/icon-step-5-2x.png +0 -0
  103. data/app/assets/images/icon-steps/icon-step-5.png +0 -0
  104. data/app/assets/images/icon-steps/icon-step-6-2x.png +0 -0
  105. data/app/assets/images/icon-steps/icon-step-6.png +0 -0
  106. data/app/assets/images/icon-steps/icon-step-7-2x.png +0 -0
  107. data/app/assets/images/icon-steps/icon-step-7.png +0 -0
  108. data/app/assets/images/icon-steps/icon-step-8-2x.png +0 -0
  109. data/app/assets/images/icon-steps/icon-step-8.png +0 -0
  110. data/app/assets/images/icon-steps/icon-step-9-2x.png +0 -0
  111. data/app/assets/images/icon-steps/icon-step-9.png +0 -0
  112. data/app/assets/images/player-icon-forward.png +0 -0
  113. data/app/assets/images/player-icon-pause.png +0 -0
  114. data/app/assets/images/player-icon-play.png +0 -0
  115. data/app/assets/images/player-icon-rewind.png +0 -0
  116. data/app/assets/images/player-icon-volume.png +0 -0
  117. data/app/assets/javascripts/govuk/multivariate-test.js +101 -0
  118. data/app/assets/javascripts/govuk/stop-scrolling-at-footer.js +138 -0
  119. data/app/assets/javascripts/govuk_toolkit.js +1 -0
  120. data/app/assets/javascripts/stageprompt.js +63 -0
  121. data/app/assets/javascripts/vendor/jquery/jquery.player.min.js +25 -0
  122. data/app/assets/jenkins.sh +5 -0
  123. data/app/assets/package.json +14 -0
  124. data/app/assets/spec/MultivariateTestSpec.js +166 -0
  125. data/app/assets/stylesheets/.gitkeep +0 -0
  126. data/app/assets/stylesheets/_colours.scss +104 -0
  127. data/app/assets/stylesheets/_conditionals.scss +85 -0
  128. data/app/assets/stylesheets/_css3.scss +61 -0
  129. data/app/assets/stylesheets/_device-pixels.scss +11 -0
  130. data/app/assets/stylesheets/_font_stack.scss +40 -0
  131. data/app/assets/stylesheets/_measurements.scss +7 -0
  132. data/app/assets/stylesheets/_shims.scss +57 -0
  133. data/app/assets/stylesheets/_typography.scss +400 -0
  134. data/app/assets/stylesheets/design-patterns/_alpha-beta.scss +49 -0
  135. data/app/assets/stylesheets/design-patterns/_buttons.scss +142 -0
  136. data/app/assets/stylesheets/design-patterns/_media-player.scss +232 -0
  137. data/govuk_frontend_toolkit.gemspec +50 -0
  138. data/jenkins.sh +8 -0
  139. data/lib/govuk_frontend_toolkit.rb +4 -0
  140. data/lib/govuk_frontend_toolkit/engine.rb +4 -0
  141. data/lib/govuk_frontend_toolkit/version.rb +3 -0
  142. metadata +273 -0
@@ -0,0 +1,49 @@
1
+ @import "../_colours";
2
+ @import "../_typography";
3
+ @import "../_shims";
4
+
5
+ @mixin phase-banner($state: alpha) {
6
+ padding: 8px 0;
7
+
8
+ @if $state == alpha {
9
+ background-color: $alpha-colour;
10
+ } @else if $state == beta {
11
+ background-color: $beta-colour;
12
+ }
13
+
14
+ p {
15
+ max-width: 960px;
16
+ margin: 0 auto;
17
+ padding: 0 15px;
18
+
19
+ color: $text-colour;
20
+ @include core-16;
21
+ }
22
+
23
+ a, a:link, a:visited, a:active {
24
+ color: $text-colour;
25
+ }
26
+
27
+ a:hover {
28
+ color: $text-colour;
29
+ }
30
+ }
31
+
32
+ @mixin phase-tag($state: alpha) {
33
+ @include inline-block;
34
+
35
+ @if $state == alpha {
36
+ background-color: $alpha-colour;
37
+ } @else if $state == beta {
38
+ background-color: $beta-colour;
39
+ }
40
+
41
+ color: #fff;
42
+ @include bold-16($line-height: 20/16);
43
+ text-transform: uppercase;
44
+ letter-spacing: 1px;
45
+ text-decoration: none;
46
+
47
+ margin: 3px 10px 0 5px;
48
+ padding: 2px 5px 0;
49
+ }
@@ -0,0 +1,142 @@
1
+ @import '../_shims.scss';
2
+ @import '../_css3.scss';
3
+ @import '../_conditionals.scss';
4
+
5
+ /*
6
+
7
+ Mixin and defaults for making buttons on GOV.UK services.
8
+
9
+ For guidance, see: https://www.gov.uk/service-manual/design-and-content/resources/buttons.html
10
+
11
+ Example usage:
12
+
13
+ .button{
14
+ @include button;
15
+ }
16
+ .button-secondary{
17
+ @include button($grey-3);
18
+ }
19
+ .button-warning{
20
+ @include button($red);
21
+ }
22
+
23
+ */
24
+
25
+ @mixin button($colour: $button-colour){
26
+ // Colour
27
+ background-color: $colour;
28
+
29
+ // Size and shape
30
+ position: relative;
31
+ @include inline-block;
32
+ padding: 0.35em 0.5em 0.15em 0.5em;
33
+ border: none;
34
+ @include border-radius(0);
35
+ -webkit-appearance: none;
36
+
37
+ // Bottom edge effect
38
+ @include box-shadow(0 2px 0 darken($colour, 15%));
39
+ @include ie-lte(8) {
40
+ border-bottom: 2px solid darken($colour, 15%);
41
+ }
42
+
43
+ // Text
44
+ font-size: 1em; // inherit from parent
45
+ line-height: 1.25;
46
+ text-decoration: none;
47
+ -webkit-font-smoothing: antialiased;
48
+
49
+ // Interaction
50
+ cursor: pointer;
51
+ &:visited{
52
+ background-color: $colour;
53
+ }
54
+ &:hover,
55
+ &:focus {
56
+ background-color: darken($colour, 5%);
57
+ }
58
+ &:active {
59
+ top: 2px;
60
+ @include box-shadow(0 0 0 $colour);
61
+ }
62
+
63
+ // Disabled button styles
64
+ &.disabled,
65
+ &[disabled="disabled"],
66
+ &[disabled] {
67
+ @include opacity(0.5);
68
+ &:hover{
69
+ cursor: default;
70
+ background-color: $colour;
71
+ }
72
+ &:active {
73
+ top: 0;
74
+ @include box-shadow(0 2px 0 darken($colour, 15%));
75
+ @include ie-lte(8) {
76
+ border-bottom: 2px solid darken($colour, 15%);
77
+ }
78
+ }
79
+ }
80
+
81
+ // Set text colour depending on background colour
82
+ @if lightness($colour) < 50% {
83
+ color: $white;
84
+ &:hover,
85
+ &:focus,
86
+ &:visited{
87
+ color: $white;
88
+ }
89
+ } @else {
90
+ color: $text-colour;
91
+ &:hover,
92
+ &:focus,
93
+ &:visited{
94
+ color: $text-colour;
95
+ }
96
+ }
97
+
98
+ // making the click target bigger than the button
99
+ // (and fill the space made when the button moves)
100
+ &:before {
101
+ content: "";
102
+ height: 110%;
103
+ width: 100%;
104
+ display: block;
105
+ background: transparent;
106
+ position: absolute;
107
+ top: 0;
108
+ left: 0;
109
+ }
110
+ &:active:before {
111
+ top: -10%;
112
+ height: 120%;
113
+
114
+ // IE6 ignores the :before psuedo-class but applies the block to :active
115
+ // It therefore needs to be reset
116
+ @include ie(6) {
117
+ top: auto;
118
+ height: 100%;
119
+ }
120
+ }
121
+
122
+ // Reset styles applied to external links
123
+ &[rel="external"]:after {
124
+ display: none;
125
+ content: none;
126
+ margin-left: 0;
127
+ margin-right: 0;
128
+ }
129
+
130
+ // Fixes a bug where IE puts a black border around certain elements
131
+ @include ie-lte(8) {
132
+ &[type="submit"],
133
+ &[type="reset"],
134
+ &[type="button"] {
135
+ filter:chroma(color=#000000);
136
+ }
137
+
138
+ &[type=submit].button {
139
+ filter: none;
140
+ }
141
+ }
142
+ }
@@ -0,0 +1,232 @@
1
+ /* Player overrides */
2
+
3
+ @mixin media-player {
4
+ display: block;
5
+ overflow: hidden;
6
+ margin: 30px 0;
7
+
8
+ &.player-wide {
9
+ min-width: 580px;
10
+ }
11
+
12
+ span {
13
+ display: block;
14
+ margin: 0;
15
+ padding: 0;
16
+ }
17
+
18
+ .video {
19
+ position: relative;
20
+ z-index: 3000;
21
+
22
+ iframe {
23
+ display: block;
24
+ }
25
+ }
26
+
27
+ .logo {
28
+ display: none;
29
+ }
30
+
31
+ .control-bar {
32
+ position: relative;
33
+ width: 100%;
34
+ height: 60px;
35
+ border-bottom: 1px solid $border-colour;
36
+
37
+ button {
38
+ background: transparent;
39
+ border: none;
40
+ padding: 0;
41
+ cursor: pointer;
42
+ }
43
+
44
+ button, a {
45
+ &:focus {
46
+ background-color: orange;
47
+ outline: none;
48
+ }
49
+ }
50
+
51
+ .player-controls {
52
+ .play, .pause {
53
+ position: absolute;
54
+ bottom: 0;
55
+ left: 0;
56
+ width: 40px;
57
+ height: 40px;
58
+ overflow: hidden;
59
+ text-indent: -5000%;
60
+ background-repeat: no-repeat;
61
+ background-position: center left;
62
+ }
63
+
64
+ .play {
65
+ background-image: image-url('player-icon-play.png');
66
+ }
67
+
68
+ .pause {
69
+ background-image: image-url('player-icon-pause.png');
70
+ }
71
+
72
+ .rewind, .forward {
73
+ position: absolute;
74
+ top: 0;
75
+ z-index: 30;
76
+ height: 20px;
77
+ width: 40px;
78
+ overflow: hidden;
79
+ text-indent: -5000%;
80
+ background-repeat: no-repeat;
81
+ background-position: center left;
82
+ }
83
+
84
+ .rewind {
85
+ left: 0;
86
+ background-image: image-url('player-icon-rewind.png');
87
+ }
88
+
89
+ .forward {
90
+ left: 100%;
91
+ margin-left: -40px;
92
+ background-image: image-url('player-icon-forward.png');
93
+ }
94
+ }
95
+
96
+ .volume-controls {
97
+ position: absolute;
98
+ bottom: 0;
99
+ right: 0;
100
+ height: 40px;
101
+ width: 180px;
102
+ overflow: visible;
103
+
104
+ .mute {
105
+ position: absolute;
106
+ bottom: 0;
107
+ left: 120px;
108
+ height: 40px;
109
+ width: 50px;
110
+ padding-top: 1px;
111
+ font-size: 14px;
112
+ line-height: 40px;
113
+ text-align: center;
114
+ }
115
+
116
+ .muted {
117
+ color: $light-blue;
118
+ }
119
+
120
+ .muted::after {
121
+ content: "d";
122
+ }
123
+
124
+ .muted ~ * {
125
+ opacity: 0.333;
126
+ }
127
+
128
+ .vol-down, .vol-up {
129
+ position: absolute;
130
+ bottom: 0;
131
+ height: 40px;
132
+ width: 60px;
133
+ padding-top: 2px;
134
+ font-size: 24px;
135
+ line-height: 40px;
136
+ text-align: center;
137
+ z-index: 10;
138
+
139
+ &:hover, &:focus {
140
+ color: $light-blue;
141
+ }
142
+ }
143
+
144
+ .vol-down {
145
+ text-align: left;
146
+ padding-left: 10px;
147
+ left: 0;
148
+ }
149
+
150
+ .vol-up {
151
+ text-align: right;
152
+ padding-right: 10px;
153
+ left: 60px;
154
+ }
155
+
156
+ .vol-display {
157
+ position: absolute;
158
+ bottom: 0;
159
+ left: 20px;
160
+ height: 40px;
161
+ width: 0;
162
+ padding-left: 35px;
163
+ overflow: visible;
164
+ font-size: 14px;
165
+ font-weight: bold;
166
+ line-height: 40px;
167
+ background-repeat: no-repeat;
168
+ background-position: center left;
169
+ background-image: image-url('player-icon-volume.png');
170
+ }
171
+
172
+ .muted ~ .vol-display {
173
+ text-decoration: line-through;
174
+ }
175
+ }
176
+
177
+ .current-time {
178
+ position: absolute;
179
+ bottom: 0;
180
+ left: 50px;
181
+ height: 40px;
182
+ font-size: 14px;
183
+ line-height: 40px;
184
+ font-weight: bold;
185
+ }
186
+
187
+ .duration-time {
188
+ display: none;
189
+ position: absolute;
190
+ bottom: 0;
191
+ right: 10px;
192
+ height: 40px;
193
+ line-height: 40px;
194
+ font-size: 16px;
195
+ font-weight: bold;
196
+ }
197
+
198
+ .ui-slider {
199
+ position: absolute;
200
+ top: 0;
201
+ right: 0;
202
+ width: 100%;
203
+ height: 20px;
204
+ overflow: hidden;
205
+ background: $border-colour;
206
+
207
+ .progress-bar {
208
+ position: absolute;
209
+ top: 0;
210
+ left: 0;
211
+ height: 100%;
212
+ padding-bottom: 1px;
213
+ background: $light-blue;
214
+ }
215
+
216
+ .ui-slider-handle {
217
+ position: absolute;
218
+ top: 0;
219
+ height: 100%;
220
+ padding-bottom: 1px;
221
+ width: 20px;
222
+ color: rgba(0,0,0,0.5);
223
+ z-index: 10;
224
+ }
225
+ }
226
+ }
227
+
228
+ .ui-helper-hidden-accessible {
229
+ position: absolute;
230
+ left: -5000%;
231
+ }
232
+ }
@@ -0,0 +1,50 @@
1
+ $:.push File.expand_path("../lib", __FILE__)
2
+
3
+ require "govuk_frontend_toolkit/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "govuk_frontend_toolkit"
7
+ s.version = GovUKFrontendToolkit::VERSION
8
+ s.summary = 'Tools for building frontend applications'
9
+ s.authors = ['Bradley Wright']
10
+ s.email = 'bradley.wright@digital.cabinet-office.gov.uk'
11
+ s.homepage = 'https://github.com/alphagov/govuk_frontend_toolkit'
12
+ s.license = 'MIT'
13
+
14
+ s.add_dependency "rails", ">= 3.1.0"
15
+ s.add_dependency "sass", ">= 3.2.0"
16
+ s.add_development_dependency "gem_publisher", "1.2.0"
17
+ s.add_development_dependency "rake", "0.9.2.2"
18
+ s.add_development_dependency "gemfury", "0.4.12"
19
+
20
+ s.require_paths = ["lib", "app"]
21
+ s.files = `git ls-files`.split($\)
22
+
23
+ # We need to include the files from the submodules, example from:
24
+ # http://somethingaboutcode.wordpress.com/2012/09/27/include-files-from-git-submodules-when-building-a-ruby-gem/
25
+
26
+ gemroot_path = `pwd`.strip
27
+ # get an array of submodule dirs by executing 'pwd' inside each submodule
28
+ `git submodule --quiet foreach pwd`.split($\).each do |submodule_path|
29
+ # for each submodule, change working directory to that submodule
30
+ Dir.chdir(submodule_path) do
31
+
32
+ # issue git ls-files in submodule's directory
33
+ submodule_files = `git ls-files`.split($\)
34
+
35
+ # prepend the submodule path to create absolute file paths
36
+ submodule_files_fullpaths = submodule_files.map do |filename|
37
+ "#{submodule_path}/#{filename}"
38
+ end
39
+
40
+ # remove leading path parts to get paths relative to the gem's root dir
41
+ # (this assumes, that the gemspec resides in the gem's root dir)
42
+ submodule_files_paths = submodule_files_fullpaths.map do |filename|
43
+ filename.gsub "#{gemroot_path}/", ""
44
+ end
45
+
46
+ # add relative paths to gem.files
47
+ s.files += submodule_files_paths
48
+ end
49
+ end
50
+ end