uswds-jekyll 4.1.0 → 4.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +82 -48
  3. data/_includes/components/banner.html +3 -3
  4. data/_includes/components/footer--big.html +114 -0
  5. data/_includes/components/footer--medium.html +2 -2
  6. data/_includes/components/footer--slim.html +89 -0
  7. data/_includes/components/header.html +150 -0
  8. data/_includes/footer.html +7 -1
  9. data/_includes/header.html +1 -5
  10. data/_includes/meta.html +6 -0
  11. data/_includes/sidenav.html +23 -21
  12. data/_layouts/default.html +29 -1
  13. data/_layouts/home.html +0 -27
  14. data/_layouts/page.html +8 -9
  15. data/_layouts/project.html +1 -1
  16. data/_layouts/team-member.html +1 -1
  17. data/_sass/components/_side-nav.scss +5 -0
  18. data/_sass/uswds/components/_alerts.scss +4 -1
  19. data/_sass/uswds/components/_banner.scss +3 -4
  20. data/_sass/uswds/components/_footer.scss +6 -2
  21. data/_sass/uswds/components/_forms.scss +18 -38
  22. data/_sass/uswds/components/_header.scss +16 -6
  23. data/_sass/uswds/components/_navigation.scss +19 -7
  24. data/_sass/uswds/components/_search.scss +1 -1
  25. data/_sass/uswds/components/_sidenav.scss +23 -0
  26. data/_sass/uswds/core/_base.scss +1 -0
  27. data/_sass/uswds/core/_grid.scss +1 -2
  28. data/_sass/uswds/core/_utilities.scss +3 -3
  29. data/_sass/uswds/core/_variables-vendor.scss +12 -0
  30. data/_sass/uswds/core/_variables.scss +21 -17
  31. data/_sass/uswds/elements/_inputs.scss +122 -68
  32. data/_sass/uswds/elements/_list.scss +0 -13
  33. data/_sass/uswds/elements/_typography.scss +4 -26
  34. data/_sass/uswds/uswds.scss +1 -0
  35. data/assets/uswds/img/angle-arrow-down-hover.png +0 -0
  36. data/assets/uswds/img/angle-arrow-down-primary-hover.png +0 -0
  37. data/assets/uswds/img/angle-arrow-down-primary.png +0 -0
  38. data/assets/uswds/img/angle-arrow-down.png +0 -0
  39. data/assets/uswds/img/angle-arrow-up-primary-hover.png +0 -0
  40. data/assets/uswds/img/angle-arrow-up-primary.png +0 -0
  41. data/assets/uswds/img/arrow-both.png +0 -0
  42. data/assets/uswds/img/circle-124.png +0 -0
  43. data/assets/uswds/img/close-primary.png +0 -0
  44. data/assets/uswds/img/close.png +0 -0
  45. data/assets/uswds/img/correct8-alt.png +0 -0
  46. data/assets/uswds/img/correct8-alt.svg +1 -0
  47. data/assets/uswds/img/external-link-alt-hover.png +0 -0
  48. data/assets/uswds/img/external-link-alt.png +0 -0
  49. data/assets/uswds/img/external-link-hover.png +0 -0
  50. data/assets/uswds/img/external-link.png +0 -0
  51. data/assets/uswds/img/favicons/favicon-114.png +0 -0
  52. data/assets/uswds/img/favicons/favicon-40.png +0 -0
  53. data/assets/uswds/img/favicons/favicon-57.png +0 -0
  54. data/assets/uswds/img/favicons/favicon-72.png +0 -0
  55. data/assets/uswds/img/hero.png +0 -0
  56. data/assets/uswds/img/minus-alt.png +0 -0
  57. data/assets/uswds/img/plus-alt.png +0 -0
  58. data/assets/uswds/img/search-alt.png +0 -0
  59. data/assets/uswds/img/search-primary.png +0 -0
  60. data/assets/uswds/img/social-icons/png/facebook25.png +0 -0
  61. data/assets/uswds/img/social-icons/png/rss25.png +0 -0
  62. data/assets/uswds/img/social-icons/png/twitter16.png +0 -0
  63. data/assets/uswds/img/social-icons/png/youtube15.png +0 -0
  64. data/assets/uswds/js/uswds.js +532 -181
  65. data/assets/uswds/js/uswds.min.js +1 -1
  66. data/assets/uswds/js/uswds.min.js.map +1 -1
  67. metadata +9 -5
  68. data/_includes/components/header--basic.html +0 -74
  69. data/_includes/components/header--extended.html +0 -92
@@ -102,7 +102,7 @@ $z-index-nav: 9000;
102
102
  @include position(fixed, 0);
103
103
  background: $color-black;
104
104
  opacity: 0;
105
- transition: all 0.2s ease-in-out;
105
+ transition: opacity 0.2s ease-in-out;
106
106
  visibility: hidden;
107
107
  z-index: $z-index-overlay;
108
108
 
@@ -154,11 +154,10 @@ $z-index-nav: 9000;
154
154
 
155
155
  .usa-navbar {
156
156
  @include media($nav-width) {
157
- @include outer-container();
157
+ @include outer-container($site-max-width);
158
158
  @include padding(null $site-margins);
159
159
  display: block;
160
160
  height: auto;
161
- max-width: $site-max-width;
162
161
  }
163
162
  }
164
163
 
@@ -173,10 +172,8 @@ $z-index-nav: 9000;
173
172
 
174
173
  .usa-nav-inner {
175
174
  @include media($nav-width) {
176
- @include outer-container();
175
+ @include outer-container($site-max-width);
177
176
  @include padding(null $site-margins null 1.5rem);
178
- margin-top: -1px;
179
- max-width: $site-max-width;
180
177
  position: relative;
181
178
  }
182
179
  }
@@ -215,4 +212,17 @@ $z-index-nav: 9000;
215
212
  padding-left: $site-margins;
216
213
  }
217
214
  }
215
+
216
+ // Temp code for v1 to force show the search at mobile, not dekstop
217
+ /* stylelint-disable selector-no-id, declaration-no-important */
218
+ .usa-search {
219
+ &[hidden] {
220
+ display: block !important;
221
+
222
+ @include media($nav-width) {
223
+ display: none !important;
224
+ }
225
+ }
226
+ }
227
+ /* stylelint-enable */
218
228
  }
@@ -44,25 +44,32 @@
44
44
 
45
45
  .usa-nav-container {
46
46
  @include media($nav-width) {
47
- @include outer-container();
47
+ @include outer-container($site-max-width);
48
48
  @include padding(null $site-margins);
49
- max-width: $site-max-width;
50
49
  }
51
50
  }
52
51
 
53
52
  .usa-nav {
54
53
  $sliding-panel-width: 26rem;
55
54
 
56
- @include position(fixed, 0 0 0 auto);
55
+ @keyframes slidein-left {
56
+ from {
57
+ transform: translateX($sliding-panel-width);
58
+ }
59
+
60
+ to {
61
+ transform: translateX(0);
62
+ }
63
+ }
57
64
 
65
+ @include position(fixed, 0 0 0 auto);
58
66
  background: $color-white;
59
67
  border-left: 1px solid $color-gray-light;
60
68
  border-right: 0;
61
- display: flex;
69
+ display: none;
62
70
  flex-direction: column;
63
71
  overflow-y: auto;
64
72
  padding: 2rem;
65
- transform: translateX($sliding-panel-width);
66
73
  width: $sliding-panel-width;
67
74
  z-index: $z-index-nav;
68
75
 
@@ -78,8 +85,8 @@
78
85
  }
79
86
 
80
87
  &.is-visible {
81
- transform: translateX(0);
82
- transition: all 0.3s ease-in-out;
88
+ animation: slidein-left 0.3s ease-in-out;
89
+ display: flex;
83
90
  }
84
91
 
85
92
  nav {
@@ -442,11 +449,16 @@
442
449
  .usa-nav-close {
443
450
  @include button-unstyled;
444
451
  @include margin(-1.2rem -1.5rem 1.5rem auto);
452
+ color: currentColor;
445
453
  float: right;
446
454
  height: $hit-area;
447
455
  text-align: center;
448
456
  width: $hit-area;
449
457
 
458
+ &:hover {
459
+ color: currentColor;
460
+ }
461
+
450
462
  @include media($nav-width) {
451
463
  display: none;
452
464
  }
@@ -81,7 +81,7 @@ $usa-btn-big-width: 11.6rem;
81
81
  // Extra specificity to override rules set in reset.css.
82
82
  input[type=search] { /* stylelint-disable-line selector-no-qualifying-type */
83
83
  box-sizing: border-box;
84
- -webkit-appearance: none;
84
+ appearance: none;
85
85
  }
86
86
 
87
87
  [type=search],
@@ -1,8 +1,31 @@
1
1
 
2
2
  .usa-sidenav-list {
3
3
  @include usa-sidenav-list;
4
+ border-bottom: 1px solid;
5
+ border-top: 1px solid;
6
+
7
+ @include media($large-screen) {
8
+ border-bottom: none;
9
+ border-top: none;
10
+ }
11
+
12
+ .usa-grid & {
13
+ @include margin(null (-$site-margins-mobile) null (-$site-margins-mobile));
14
+
15
+ @include media($medium-screen) {
16
+ @include margin(null 0);
17
+ }
18
+ }
4
19
  }
5
20
 
6
21
  .usa-sidenav-sub_list {
7
22
  @include usa-sidenav-sublist;
8
23
  }
24
+
25
+ .usa-layout-docs-sidenav {
26
+ padding-top: 2.4rem;
27
+
28
+ @include media($large-screen) {
29
+ padding-top: 0;
30
+ }
31
+ }
@@ -13,6 +13,7 @@ html {
13
13
 
14
14
  body {
15
15
  background-color: $color-white;
16
+ color: $color-base;
16
17
  overflow-x: hidden;
17
18
  }
18
19
 
@@ -1,8 +1,7 @@
1
1
  // Grid container
2
2
  .usa-grid,
3
3
  .usa-grid-full {
4
- @include outer-container();
5
- max-width: $site-max-width;
4
+ @include outer-container($site-max-width);
6
5
  }
7
6
 
8
7
  .usa-grid {
@@ -191,7 +191,7 @@
191
191
  display: block;
192
192
  font-family: $font-sans;
193
193
  line-height: 1.3;
194
- padding: 0.85rem 1rem 0.85rem 1.8rem;
194
+ padding: 0.85rem 1rem 0.85rem $site-margins-mobile;
195
195
  text-decoration: none;
196
196
 
197
197
  &:hover {
@@ -207,10 +207,10 @@
207
207
  }
208
208
 
209
209
  &.usa-current { /* stylelint-disable-line selector-no-qualifying-type */
210
- border-left: 0.4rem solid $color-primary;
210
+ border-left: $sidenav-current-border-width solid $color-primary;
211
211
  color: $color-primary;
212
212
  font-weight: $font-bold;
213
- padding-left: 1.4rem;
213
+ padding-left: $site-margins-mobile - $sidenav-current-border-width;
214
214
  }
215
215
  }
216
216
  }
@@ -0,0 +1,12 @@
1
+ /// When set to true, it sets the box-sizing property of all elements to `border-box`. Set with a `!global` flag.
2
+ ///
3
+ /// @type Bool
4
+ ///
5
+ /// @example css - CSS Output
6
+ /// html {
7
+ /// box-sizing: border-box; }
8
+ ///
9
+ /// *, *::after, *::before {
10
+ /// box-sizing: inherit;
11
+ /// }
12
+ $border-box-sizing: false;
@@ -120,29 +120,33 @@ $small: new-breakpoint(min-width $small-screen $grid-columns-small) !default;
120
120
  $medium: new-breakpoint(min-width $medium-screen $grid-columns-medium) !default;
121
121
  $large: new-breakpoint(min-width $large-screen $grid-columns-large) !default;
122
122
 
123
+ // Set the base path for assets (used for font and image paths below)
124
+ $asset-path: '../' !default;
125
+
123
126
  // Relative font and image file paths
124
- $font-path: '../fonts' !default;
125
- $image-path: '../img' !default;
127
+ $font-path: '#{$asset-path}fonts' !default;
128
+ $image-path: '#{$asset-path}img' !default;
126
129
 
127
130
  // Set $asset-pipeline to true if you're using the Rails Asset Pipeline
128
131
  $asset-pipeline: false !default;
129
132
 
130
133
  // Magic Numbers
131
- $text-max-width: 66ch !default; // 66 characters per line
132
- $lead-max-width: 77rem !default;
133
- $site-max-width: 1040px !default;
134
- $site-margins: 3rem !default;
135
- $site-margins-mobile: 1.5rem !default;
136
- $article-max-width: 600px !default;
137
- $input-max-width: 46rem !default;
138
- $label-border-radius: 2px !default;
139
- $checkbox-border-radius: 2px !default;
140
- $border-radius: 3px !default;
141
- $button-border-radius: 5px !default;
142
- $box-shadow: 0 0 2px $color-shadow !default;
143
- $focus-outline: 2px dotted $color-gray-light;
144
- $focus-spacing: 3px;
145
- $nav-width: 951px !default;
134
+ $text-max-width: 66ch !default; // 66 characters per line
135
+ $lead-max-width: 77rem !default;
136
+ $site-max-width: 1040px !default;
137
+ $site-margins: 3rem !default;
138
+ $site-margins-mobile: 1.5rem !default;
139
+ $article-max-width: 600px !default;
140
+ $input-max-width: 46rem !default;
141
+ $label-border-radius: 2px !default;
142
+ $checkbox-border-radius: 2px !default;
143
+ $border-radius: 3px !default;
144
+ $button-border-radius: 5px !default;
145
+ $box-shadow: 0 0 2px $color-shadow !default;
146
+ $focus-outline: 2px dotted $color-gray-light !default;
147
+ $focus-spacing: 3px !default;
148
+ $nav-width: 951px !default;
149
+ $sidenav-current-border-width: 0.4rem !default; // must be in rem for math
146
150
 
147
151
  // 44 x 44 pixels hit target following Apple iOS Human Interface
148
152
  // Guidelines
@@ -86,16 +86,28 @@ select {
86
86
  padding-top: 3px;
87
87
  }
88
88
 
89
+ // Deprecated: Some screen readers can't read CSS content.
90
+ // Will be removed in 2.0.
89
91
  .usa-input-required:after {
90
92
  color: $color-secondary-darkest;
91
93
  content: ' (*required)';
92
94
  }
93
95
 
96
+ // Deprecated: Some screen readers can't read CSS content.
97
+ // Will be removed in 2.0.
94
98
  .usa-input-optional:after {
95
99
  color: $color-gray-medium;
96
100
  content: ' (optional)';
97
101
  }
98
102
 
103
+ .usa-input-label-helper {
104
+ color: $color-gray-medium;
105
+ }
106
+
107
+ .usa-input-label-required {
108
+ color: $color-secondary-darkest;
109
+ }
110
+
99
111
  label {
100
112
  display: block;
101
113
  margin-top: 3rem;
@@ -107,12 +119,12 @@ textarea {
107
119
  }
108
120
 
109
121
  select {
110
- -moz-appearance: none;
111
- -webkit-appearance: none;
112
122
  appearance: none;
113
123
  background-color: $color-white;
114
124
  background-image: url('#{$image-path}/arrow-both.png');
115
- background-image: url('#{$image-path}/arrow-both.svg');
125
+ // Ensure browsers that don't support SVG in background-image (IE 11 and below) fall back to PNG.
126
+ // See https://www.broken-links.com/2010/06/14/using-svg-in-backgrounds-with-png-fallback/
127
+ background-image: none, url('#{$image-path}/arrow-both.svg'), url('#{$image-path}/arrow-both.png');
116
128
  background-position: right 1.3rem center;
117
129
  background-repeat: no-repeat;
118
130
  background-size: 1rem;
@@ -184,15 +196,19 @@ legend {
184
196
  [type=checkbox] + label::before,
185
197
  [type=radio] + label::before {
186
198
  background: $color-white;
187
- border-radius: $checkbox-border-radius;
188
- box-shadow: 0 0 0 1px $color-gray-medium;
189
199
  content: '\a0';
190
200
  display: inline-block;
201
+ text-indent: 0.15em;
202
+ vertical-align: middle\0; // Target IE 11 and below to vertically center inputs
203
+ }
204
+
205
+ [type=checkbox] + label::before {
206
+ border-radius: $checkbox-border-radius;
207
+ box-shadow: 0 0 0 1px $color-gray-medium;
191
208
  height: $spacing-medium;
192
209
  line-height: $spacing-medium;
210
+ margin-left: 1px;
193
211
  margin-right: 0.6em;
194
- text-indent: 0.15em;
195
- vertical-align: middle\0; // Target IE 11 and below to vertically center inputs
196
212
  width: $spacing-medium;
197
213
  }
198
214
 
@@ -201,6 +217,7 @@ legend {
201
217
  box-shadow: 0 0 0 2px $color-white, 0 0 0 3px $color-gray-medium;
202
218
  height: 1.4rem; // Size overrides to account for shape + checked styling
203
219
  line-height: 1.4rem;
220
+ margin-left: 3px;
204
221
  margin-right: 0.75em;
205
222
  width: 1.4rem;
206
223
  }
@@ -244,96 +261,133 @@ legend {
244
261
  cursor: not-allowed;
245
262
  }
246
263
 
247
- // Range inputs
248
-
249
- [type=range] {
250
- -webkit-appearance: none;
251
- border: none;
252
- padding-left: 0;
253
- width: 100%;
254
- }
255
-
256
- [type=range]::-webkit-slider-runnable-track {
257
- background: $color-gray-light;
258
- border: 1px solid $color-gray-medium;
259
- cursor: pointer;
260
- height: 1.2rem;
261
- width: 100%;
264
+ @media print {
265
+ [type=checkbox]:checked + label::before,
266
+ [type=checkbox]:checked:disabled + label::before {
267
+ background-image: none;
268
+ background-color: $color-white;
269
+ content: url('#{$image-path}/correct8-alt.png');
270
+ content: url('#{$image-path}/correct8-alt.svg');
271
+ text-indent: 0;
272
+ }
262
273
  }
263
274
 
264
- [type=range]::-moz-range-track {
265
- background: $color-primary;
266
- border: 1px solid $color-gray-medium;
267
- cursor: pointer;
268
- height: 1.2rem;
269
- width: 100%;
270
- }
275
+ // Range inputs
271
276
 
272
- [type=range]::-ms-track {
273
- background: transparent;
274
- color: transparent;
275
- cursor: pointer;
276
- height: 1.2rem;
277
- width: 100%;
277
+ // Change to $color-focus in 2.0
278
+ @mixin range-focus {
279
+ box-shadow: 0 0 0 2px $color-primary;
278
280
  }
279
281
 
280
- [type=range]::-webkit-slider-thumb {
281
- -webkit-appearance: none;
282
+ @mixin range-track {
283
+ background: $color-gray-lighter;
282
284
  border: 1px solid $color-gray-medium;
283
- height: 2.2rem;
284
- border-radius: 1.5rem;
285
- background: $color-gray-lightest;
286
285
  cursor: pointer;
287
- margin-top: -.65rem;
288
- width: 2.2rem;
289
- }
290
-
291
- [type=range]::-moz-range-thumb {
292
- background: $color-gray-lightest;
293
- border: 1px solid $color-gray-medium;
294
- border-radius: 1.5rem;
295
- cursor: pointer;
296
- height: 2.2rem;
297
- width: 2.2rem;
286
+ height: 1.6rem;
287
+ width: 100%;
298
288
  }
299
289
 
300
- [type=range]::-ms-thumb {
290
+ @mixin range-thumb {
301
291
  background: $color-gray-lightest;
302
- border: 1px solid $color-gray-medium;
292
+ box-shadow: 0 0 0 1px $color-gray-medium;
303
293
  border-radius: 1.5rem;
304
294
  cursor: pointer;
305
- height: 2.2rem;
306
- width: 2.2rem;
295
+ height: 2.5rem;
296
+ width: 2.5rem;
307
297
  }
308
298
 
309
- [type=range]::-ms-fill-lower {
299
+ @mixin range-ms-fill {
310
300
  background: $color-gray-light;
311
301
  border: 1px solid $color-gray-medium;
312
302
  border-radius: 2rem;
313
303
  }
314
304
 
315
- [type=range]::-ms-fill-upper {
316
- background: $color-gray-light;
317
- border: 1px solid $color-gray-medium;
318
- border-radius: 2rem;
305
+ [type=range] {
306
+ appearance: none;
307
+ border: none;
308
+ padding-left: 0;
309
+ overflow: hidden;
310
+ width: 100%;
311
+
312
+ &:focus {
313
+ outline: none;
314
+
315
+ &::-webkit-slider-thumb {
316
+ @include range-focus;
317
+ }
318
+
319
+ &::-moz-range-thumb {
320
+ @include range-focus;
321
+ }
322
+
323
+ &::-ms-thumb {
324
+ @include range-focus;
325
+ }
326
+ }
327
+
328
+ &::-webkit-slider-runnable-track {
329
+ @include range-track;
330
+ }
331
+
332
+ &::-moz-range-track {
333
+ @include range-track;
334
+ }
335
+
336
+ &::-ms-track {
337
+ @include range-track;
338
+ }
339
+
340
+ &::-webkit-slider-thumb {
341
+ @include range-thumb;
342
+ appearance: none;
343
+ margin-top: -0.6rem;
344
+ }
345
+
346
+ &::-moz-range-thumb {
347
+ @include range-thumb;
348
+ }
349
+
350
+ &::-ms-thumb {
351
+ @include range-thumb;
352
+ }
353
+
354
+ &::-ms-fill-lower {
355
+ @include range-ms-fill;
356
+ }
357
+
358
+ &::-ms-fill-upper {
359
+ @include range-ms-fill;
360
+ }
361
+ }
362
+
363
+ // File input type
364
+ [type='file'] {
365
+ border: none;
366
+ padding-left: 0;
319
367
  }
320
368
 
321
369
  // Memorable dates
322
370
 
323
- .usa-date-of-birth {
371
+ .usa-date-of-birth { /* stylelint-disable-line */
324
372
  label {
325
373
  margin-top: 0;
326
374
  }
327
375
 
328
- [type=number]::-webkit-inner-spin-button,
329
- [type=number]::-webkit-outer-spin-button {
330
- -webkit-appearance: none;
331
- appearance: none;
332
- margin: 0;
333
- }
334
-
335
376
  [type=number] {
336
377
  -moz-appearance: textfield;
378
+
379
+ &::-webkit-inner-spin-button {
380
+ appearance: none;
381
+ }
382
+
383
+ &::-webkit-contacts-auto-fill-button {
384
+ visibility: hidden;
385
+ display: none !important; /* stylelint-disable-line declaration-no-important */
386
+ pointer-events: none;
387
+ height: 0;
388
+ width: 0;
389
+ margin: 0;
390
+ }
337
391
  }
338
392
  }
339
393