uswds-rails 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (168) hide show
  1. checksums.yaml +7 -0
  2. data/.codeclimate.yml +17 -0
  3. data/.editorconfig +14 -0
  4. data/.gitignore +28 -0
  5. data/.rspec +3 -0
  6. data/.rubocop +3 -0
  7. data/.rubocop.yml +16 -0
  8. data/.ruby-version +1 -0
  9. data/.simplecov +13 -0
  10. data/.travis.yml +18 -0
  11. data/CONTRIBUTING.md +50 -0
  12. data/Gemfile +4 -0
  13. data/LICENSE.md +27 -0
  14. data/README.md +64 -0
  15. data/Rakefile +8 -0
  16. data/app/assets/stylesheets/uswds/components/_accordions.scss +150 -0
  17. data/app/assets/stylesheets/uswds/components/_alerts.scss +85 -0
  18. data/app/assets/stylesheets/uswds/components/_footer.scss +382 -0
  19. data/app/assets/stylesheets/uswds/components/_forms.scss +164 -0
  20. data/app/assets/stylesheets/uswds/components/_hero.scss +43 -0
  21. data/app/assets/stylesheets/uswds/components/_navigation.scss +446 -0
  22. data/app/assets/stylesheets/uswds/components/_search.scss +106 -0
  23. data/app/assets/stylesheets/uswds/core/_utilities.scss +232 -0
  24. data/app/assets/stylesheets/uswds/core/_variables.scss +112 -0
  25. data/app/assets/stylesheets/uswds/elements/_inputs.scss +346 -0
  26. data/app/assets/stylesheets/uswds/elements/_typography.scss +257 -0
  27. data/app/assets/stylesheets/uswds/uswds.scss +44 -0
  28. data/lib/uswds-rails.rb +1 -0
  29. data/lib/uswds/rails.rb +7 -0
  30. data/lib/uswds/rails/engine.rb +17 -0
  31. data/lib/uswds/rails/version.rb +6 -0
  32. data/uswds-rails.gemspec +36 -0
  33. data/vendor/assets/fonts/uswds/merriweather-bold-webfont.eot +0 -0
  34. data/vendor/assets/fonts/uswds/merriweather-bold-webfont.ttf +0 -0
  35. data/vendor/assets/fonts/uswds/merriweather-bold-webfont.woff +0 -0
  36. data/vendor/assets/fonts/uswds/merriweather-bold-webfont.woff2 +0 -0
  37. data/vendor/assets/fonts/uswds/merriweather-italic-webfont.eot +0 -0
  38. data/vendor/assets/fonts/uswds/merriweather-italic-webfont.ttf +0 -0
  39. data/vendor/assets/fonts/uswds/merriweather-italic-webfont.woff +0 -0
  40. data/vendor/assets/fonts/uswds/merriweather-italic-webfont.woff2 +0 -0
  41. data/vendor/assets/fonts/uswds/merriweather-light-webfont.eot +0 -0
  42. data/vendor/assets/fonts/uswds/merriweather-light-webfont.ttf +0 -0
  43. data/vendor/assets/fonts/uswds/merriweather-light-webfont.woff +0 -0
  44. data/vendor/assets/fonts/uswds/merriweather-light-webfont.woff2 +0 -0
  45. data/vendor/assets/fonts/uswds/merriweather-regular-webfont.eot +0 -0
  46. data/vendor/assets/fonts/uswds/merriweather-regular-webfont.ttf +0 -0
  47. data/vendor/assets/fonts/uswds/merriweather-regular-webfont.woff +0 -0
  48. data/vendor/assets/fonts/uswds/merriweather-regular-webfont.woff2 +0 -0
  49. data/vendor/assets/fonts/uswds/sourcesanspro-bold-webfont.eot +0 -0
  50. data/vendor/assets/fonts/uswds/sourcesanspro-bold-webfont.ttf +0 -0
  51. data/vendor/assets/fonts/uswds/sourcesanspro-bold-webfont.woff +0 -0
  52. data/vendor/assets/fonts/uswds/sourcesanspro-bold-webfont.woff2 +0 -0
  53. data/vendor/assets/fonts/uswds/sourcesanspro-italic-webfont.eot +0 -0
  54. data/vendor/assets/fonts/uswds/sourcesanspro-italic-webfont.ttf +0 -0
  55. data/vendor/assets/fonts/uswds/sourcesanspro-italic-webfont.woff +0 -0
  56. data/vendor/assets/fonts/uswds/sourcesanspro-italic-webfont.woff2 +0 -0
  57. data/vendor/assets/fonts/uswds/sourcesanspro-light-webfont.eot +0 -0
  58. data/vendor/assets/fonts/uswds/sourcesanspro-light-webfont.ttf +0 -0
  59. data/vendor/assets/fonts/uswds/sourcesanspro-light-webfont.woff +0 -0
  60. data/vendor/assets/fonts/uswds/sourcesanspro-light-webfont.woff2 +0 -0
  61. data/vendor/assets/fonts/uswds/sourcesanspro-regular-webfont.eot +0 -0
  62. data/vendor/assets/fonts/uswds/sourcesanspro-regular-webfont.ttf +0 -0
  63. data/vendor/assets/fonts/uswds/sourcesanspro-regular-webfont.woff +0 -0
  64. data/vendor/assets/fonts/uswds/sourcesanspro-regular-webfont.woff2 +0 -0
  65. data/vendor/assets/images/uswds/alerts/error.png +0 -0
  66. data/vendor/assets/images/uswds/alerts/error.svg +17 -0
  67. data/vendor/assets/images/uswds/alerts/info.png +0 -0
  68. data/vendor/assets/images/uswds/alerts/info.svg +18 -0
  69. data/vendor/assets/images/uswds/alerts/success.png +0 -0
  70. data/vendor/assets/images/uswds/alerts/success.svg +12 -0
  71. data/vendor/assets/images/uswds/alerts/warning.png +0 -0
  72. data/vendor/assets/images/uswds/alerts/warning.svg +16 -0
  73. data/vendor/assets/images/uswds/angle-arrow-down-hover.png +0 -0
  74. data/vendor/assets/images/uswds/angle-arrow-down-hover.svg +1 -0
  75. data/vendor/assets/images/uswds/angle-arrow-down-primary-hover.png +0 -0
  76. data/vendor/assets/images/uswds/angle-arrow-down-primary-hover.svg +1 -0
  77. data/vendor/assets/images/uswds/angle-arrow-down-primary.png +0 -0
  78. data/vendor/assets/images/uswds/angle-arrow-down-primary.svg +1 -0
  79. data/vendor/assets/images/uswds/angle-arrow-down.png +0 -0
  80. data/vendor/assets/images/uswds/angle-arrow-down.svg +1 -0
  81. data/vendor/assets/images/uswds/angle-arrow-up-primary-hover.png +0 -0
  82. data/vendor/assets/images/uswds/angle-arrow-up-primary-hover.svg +1 -0
  83. data/vendor/assets/images/uswds/angle-arrow-up-primary.png +0 -0
  84. data/vendor/assets/images/uswds/angle-arrow-up-primary.svg +1 -0
  85. data/vendor/assets/images/uswds/arrow-down.png +0 -0
  86. data/vendor/assets/images/uswds/arrow-down.svg +1 -0
  87. data/vendor/assets/images/uswds/arrow-right.png +0 -0
  88. data/vendor/assets/images/uswds/arrow-right.svg +1 -0
  89. data/vendor/assets/images/uswds/circle-124.png +0 -0
  90. data/vendor/assets/images/uswds/close.png +0 -0
  91. data/vendor/assets/images/uswds/close.svg +1 -0
  92. data/vendor/assets/images/uswds/correct8.png +0 -0
  93. data/vendor/assets/images/uswds/correct8.svg +1 -0
  94. data/vendor/assets/images/uswds/correct9.png +0 -0
  95. data/vendor/assets/images/uswds/correct9.svg +1 -0
  96. data/vendor/assets/images/uswds/external-link-alt-hover.png +0 -0
  97. data/vendor/assets/images/uswds/external-link-alt-hover.svg +1 -0
  98. data/vendor/assets/images/uswds/external-link-alt.png +0 -0
  99. data/vendor/assets/images/uswds/external-link-alt.svg +1 -0
  100. data/vendor/assets/images/uswds/external-link-hover.png +0 -0
  101. data/vendor/assets/images/uswds/external-link-hover.svg +1 -0
  102. data/vendor/assets/images/uswds/external-link.png +0 -0
  103. data/vendor/assets/images/uswds/external-link.svg +1 -0
  104. data/vendor/assets/images/uswds/favicons/favicon-114.png +0 -0
  105. data/vendor/assets/images/uswds/favicons/favicon-144.png +0 -0
  106. data/vendor/assets/images/uswds/favicons/favicon-16.png +0 -0
  107. data/vendor/assets/images/uswds/favicons/favicon-192.png +0 -0
  108. data/vendor/assets/images/uswds/favicons/favicon-40.png +0 -0
  109. data/vendor/assets/images/uswds/favicons/favicon-57.png +0 -0
  110. data/vendor/assets/images/uswds/favicons/favicon-72.png +0 -0
  111. data/vendor/assets/images/uswds/favicons/favicon.ico +0 -0
  112. data/vendor/assets/images/uswds/favicons/favicon.png +0 -0
  113. data/vendor/assets/images/uswds/hero.png +0 -0
  114. data/vendor/assets/images/uswds/icon-dot-gov.svg +1 -0
  115. data/vendor/assets/images/uswds/icon-https.svg +1 -0
  116. data/vendor/assets/images/uswds/logo-img.png +0 -0
  117. data/vendor/assets/images/uswds/minus-alt.png +0 -0
  118. data/vendor/assets/images/uswds/minus-alt.svg +1 -0
  119. data/vendor/assets/images/uswds/minus.png +0 -0
  120. data/vendor/assets/images/uswds/minus.svg +1 -0
  121. data/vendor/assets/images/uswds/plus-alt.png +0 -0
  122. data/vendor/assets/images/uswds/plus-alt.svg +1 -0
  123. data/vendor/assets/images/uswds/plus.png +0 -0
  124. data/vendor/assets/images/uswds/plus.svg +1 -0
  125. data/vendor/assets/images/uswds/search-alt.png +0 -0
  126. data/vendor/assets/images/uswds/search-alt.svg +1 -0
  127. data/vendor/assets/images/uswds/search.png +0 -0
  128. data/vendor/assets/images/uswds/search.svg +1 -0
  129. data/vendor/assets/images/uswds/social-icons/png/facebook25.png +0 -0
  130. data/vendor/assets/images/uswds/social-icons/png/rss25.png +0 -0
  131. data/vendor/assets/images/uswds/social-icons/png/twitter16.png +0 -0
  132. data/vendor/assets/images/uswds/social-icons/png/youtube15.png +0 -0
  133. data/vendor/assets/images/uswds/social-icons/svg/facebook25.svg +1 -0
  134. data/vendor/assets/images/uswds/social-icons/svg/rss25.svg +1 -0
  135. data/vendor/assets/images/uswds/social-icons/svg/twitter16.svg +1 -0
  136. data/vendor/assets/images/uswds/social-icons/svg/youtube15.svg +1 -0
  137. data/vendor/assets/images/uswds/us_flag_small.png +0 -0
  138. data/vendor/assets/javascripts/uswds/uswds.js +1739 -0
  139. data/vendor/assets/stylesheets/uswds/components/_accordions.scss +150 -0
  140. data/vendor/assets/stylesheets/uswds/components/_alerts.scss +85 -0
  141. data/vendor/assets/stylesheets/uswds/components/_banner.scss +204 -0
  142. data/vendor/assets/stylesheets/uswds/components/_footer.scss +382 -0
  143. data/vendor/assets/stylesheets/uswds/components/_forms.scss +164 -0
  144. data/vendor/assets/stylesheets/uswds/components/_graphic-list.scss +35 -0
  145. data/vendor/assets/stylesheets/uswds/components/_header.scss +221 -0
  146. data/vendor/assets/stylesheets/uswds/components/_hero.scss +43 -0
  147. data/vendor/assets/stylesheets/uswds/components/_layout.scss +36 -0
  148. data/vendor/assets/stylesheets/uswds/components/_media-block.scss +12 -0
  149. data/vendor/assets/stylesheets/uswds/components/_navigation.scss +446 -0
  150. data/vendor/assets/stylesheets/uswds/components/_search.scss +106 -0
  151. data/vendor/assets/stylesheets/uswds/components/_section.scss +37 -0
  152. data/vendor/assets/stylesheets/uswds/components/_sidenav.scss +8 -0
  153. data/vendor/assets/stylesheets/uswds/components/_skipnav.scss +19 -0
  154. data/vendor/assets/stylesheets/uswds/core/_base.scss +30 -0
  155. data/vendor/assets/stylesheets/uswds/core/_fonts.scss +65 -0
  156. data/vendor/assets/stylesheets/uswds/core/_grid.scss +154 -0
  157. data/vendor/assets/stylesheets/uswds/core/_utilities.scss +232 -0
  158. data/vendor/assets/stylesheets/uswds/core/_variables.scss +123 -0
  159. data/vendor/assets/stylesheets/uswds/elements/_buttons.scss +191 -0
  160. data/vendor/assets/stylesheets/uswds/elements/_embed.scss +26 -0
  161. data/vendor/assets/stylesheets/uswds/elements/_figure.scss +13 -0
  162. data/vendor/assets/stylesheets/uswds/elements/_inputs.scss +346 -0
  163. data/vendor/assets/stylesheets/uswds/elements/_labels.scss +20 -0
  164. data/vendor/assets/stylesheets/uswds/elements/_list.scss +32 -0
  165. data/vendor/assets/stylesheets/uswds/elements/_table.scss +47 -0
  166. data/vendor/assets/stylesheets/uswds/elements/_typography.scss +257 -0
  167. data/vendor/assets/stylesheets/uswds/uswds.scss +41 -0
  168. metadata +394 -0
@@ -0,0 +1,106 @@
1
+ $usa-btn-small-width: 4.5rem;
2
+ $usa-btn-medium-width: 8.5rem;
3
+ $usa-btn-big-width: 11.6rem;
4
+
5
+ @mixin search-icon {
6
+ background-image: url('#{$image-path}/search.png');
7
+ background-image: url('#{$image-path}/search.svg');
8
+ background-position: 50%;
9
+ background-repeat: no-repeat;
10
+ }
11
+
12
+ .usa-search {
13
+ @include clearfix;
14
+ max-width: none;
15
+ position: relative;
16
+
17
+ [type=search],
18
+ .usa-search-input {
19
+ @include padding(0 null);
20
+ -webkit-appearance: none;
21
+ border-bottom-right-radius: 0;
22
+ border-right: none;
23
+ border-top-right-radius: 0;
24
+ box-sizing: border-box;
25
+ float: left;
26
+ font-size: $small-font-size;
27
+ height: 3.3rem;
28
+ margin: 0;
29
+ width: calc(100% - #{$usa-btn-small-width});
30
+
31
+ @include media($small-screen) {
32
+ width: calc(100% - #{$usa-btn-medium-width});
33
+ }
34
+ }
35
+
36
+ [type=submit],
37
+ .usa-search-submit {
38
+ @include search-icon;
39
+ border-bottom-left-radius: 0;
40
+ border-top-left-radius: 0;
41
+ height: 3.3rem;
42
+ margin: 0;
43
+ padding: 0;
44
+ width: $usa-btn-small-width;
45
+
46
+ @include media($small-screen) {
47
+ background-image: none;
48
+ width: $usa-btn-medium-width;
49
+ }
50
+ }
51
+
52
+ .usa-search-submit-text {
53
+ display: none;
54
+
55
+ @include media($small-screen) {
56
+ display: block;
57
+ }
58
+ }
59
+
60
+ &.usa-search-big {
61
+ @include media($small-screen) {
62
+ $height: 4.4rem;
63
+ $width: $usa-btn-big-width;
64
+
65
+ [type=search],
66
+ .usa-search-input {
67
+ font-size: $base-font-size;
68
+ height: $height;
69
+ width: calc(100% - #{$width});
70
+ }
71
+
72
+ [type=submit],
73
+ .usa-search-submit {
74
+ font-size: $h3-font-size;
75
+ height: $height;
76
+ width: $width;
77
+ }
78
+ }
79
+ }
80
+
81
+ &.usa-search-small {
82
+ @include media($small-screen) {
83
+ $width: $usa-btn-small-width;
84
+
85
+ [type=search],
86
+ .usa-search-input {
87
+ width: calc(100% - #{$width});
88
+ }
89
+
90
+ [type=submit],
91
+ .usa-search-submit {
92
+ @include search-icon;
93
+ width: $width;
94
+ }
95
+ }
96
+
97
+ $lt-nav-width: $nav-width - 1px;
98
+
99
+ @media screen and (max-width: $lt-nav-width) {
100
+ &.usa-sr-only {
101
+ left: auto;
102
+ position: relative;
103
+ }
104
+ }
105
+ }
106
+ }
@@ -0,0 +1,37 @@
1
+ .usa-section {
2
+ @include padding($site-margins null);
3
+
4
+ @include media($medium-screen) {
5
+ @include padding(6rem null);
6
+ }
7
+ }
8
+
9
+ .usa-section-light {
10
+ background-color: $color-gray-lightest;
11
+ }
12
+
13
+ .usa-section-dark {
14
+ background-color: $color-primary-darkest;
15
+ color: $color-white;
16
+
17
+ h1,
18
+ h2,
19
+ h3,
20
+ h4,
21
+ h5,
22
+ h6 {
23
+ color: $color-primary-alt;
24
+ }
25
+
26
+ p {
27
+ color: $color-white;
28
+ }
29
+
30
+ a {
31
+ color: $color-gray-lighter;
32
+
33
+ &:hover {
34
+ color: $color-white;
35
+ }
36
+ }
37
+ }
@@ -0,0 +1,8 @@
1
+
2
+ .usa-sidenav-list {
3
+ @include usa-sidenav-list;
4
+ }
5
+
6
+ .usa-sidenav-sub_list {
7
+ @include usa-sidenav-sublist;
8
+ }
@@ -0,0 +1,19 @@
1
+ .usa-skipnav {
2
+ background: transparent;
3
+ color: $color-base;
4
+ left: 0;
5
+ padding: 1rem 1.5rem;
6
+ position: absolute;
7
+ top: -4.2rem;
8
+ transition: all 0.2s ease-in-out;
9
+ z-index: 100;
10
+
11
+ &:focus {
12
+ background: $color-white;
13
+ left: 0;
14
+ outline: 0;
15
+ position: absolute;
16
+ top: 0;
17
+ transition: all 0.2s ease-in-out;
18
+ }
19
+ }
@@ -0,0 +1,30 @@
1
+ // Apply a natural box layout model to all elements, but allowing components to
2
+ // change
3
+
4
+ html {
5
+ box-sizing: border-box;
6
+ }
7
+
8
+ *,
9
+ *::before,
10
+ *::after {
11
+ box-sizing: inherit;
12
+ }
13
+
14
+ body {
15
+ background-color: $color-white;
16
+ overflow-x: hidden;
17
+ }
18
+
19
+ // Hack for clearfixes
20
+ .lt-ie9 {
21
+ * {
22
+ filter: none !important; /* stylelint-disable-line declaration-no-important */
23
+ }
24
+ }
25
+
26
+ // for IE < 11, see:
27
+ // <http://caniuse.com/#feat=hidden>
28
+ [hidden] {
29
+ display: none !important; /* stylelint-disable-line declaration-no-important */
30
+ }
@@ -0,0 +1,65 @@
1
+ /* stylelint-disable at-rule-empty-line-before */
2
+ @include font-face(
3
+ 'Source Sans Pro',
4
+ '#{$font-path}/sourcesanspro-light-webfont',
5
+ 300,
6
+ normal,
7
+ $file-formats: eot woff2 woff ttf
8
+ );
9
+
10
+ @include font-face(
11
+ 'Source Sans Pro',
12
+ '#{$font-path}/sourcesanspro-regular-webfont',
13
+ 400,
14
+ normal,
15
+ $file-formats: eot woff2 woff ttf
16
+ );
17
+
18
+ @include font-face(
19
+ 'Source Sans Pro',
20
+ '#{$font-path}/sourcesanspro-italic-webfont',
21
+ 400,
22
+ italic,
23
+ $file-formats: eot woff2 woff ttf
24
+ );
25
+
26
+ @include font-face(
27
+ 'Source Sans Pro',
28
+ '#{$font-path}/sourcesanspro-bold-webfont',
29
+ 700,
30
+ normal,
31
+ $file-formats: eot woff2 woff ttf
32
+ );
33
+
34
+ @include font-face(
35
+ 'Merriweather',
36
+ '#{$font-path}/merriweather-light-webfont',
37
+ 300,
38
+ normal,
39
+ $file-formats: eot woff2 woff ttf
40
+ );
41
+
42
+ @include font-face(
43
+ 'Merriweather',
44
+ '#{$font-path}/merriweather-regular-webfont',
45
+ 400,
46
+ normal,
47
+ $file-formats: eot woff2 woff ttf
48
+ );
49
+
50
+ @include font-face(
51
+ 'Merriweather',
52
+ '#{$font-path}/merriweather-italic-webfont',
53
+ 400,
54
+ italic,
55
+ $file-formats: eot woff2 woff ttf
56
+ );
57
+
58
+ @include font-face(
59
+ 'Merriweather',
60
+ '#{$font-path}/merriweather-bold-webfont',
61
+ 700,
62
+ normal,
63
+ $file-formats: eot woff2 woff ttf
64
+ );
65
+ /* stylelint-enable */
@@ -0,0 +1,154 @@
1
+ // Grid container
2
+ .usa-grid,
3
+ .usa-grid-full {
4
+ @include outer-container();
5
+ max-width: $site-max-width;
6
+ }
7
+
8
+ .usa-grid {
9
+ @include padding(null $site-margins-mobile);
10
+
11
+ @include media($medium-screen) {
12
+ @include padding(null $site-margins);
13
+ }
14
+ }
15
+
16
+ .usa-grid-full {
17
+ padding: 0;
18
+ }
19
+
20
+ // Grid items
21
+ @include media($medium) {
22
+ .usa-width-one-whole {
23
+ @include span-columns(6);
24
+ }
25
+
26
+ .usa-width-one-half {
27
+ @include span-columns(3);
28
+ }
29
+
30
+ .usa-width-one-third {
31
+ @include span-columns(2);
32
+ }
33
+
34
+ .usa-width-two-thirds {
35
+ @include span-columns(4);
36
+ }
37
+
38
+ .usa-width-one-fourth {
39
+ @include span-columns(3);
40
+
41
+ &:nth-child(2n) {
42
+ margin-right: 0;
43
+ }
44
+ }
45
+
46
+ .usa-width-three-fourths {
47
+ @include span-columns(6);
48
+ }
49
+
50
+ .usa-width-one-sixth {
51
+ @include span-columns(2);
52
+
53
+ &:nth-child(3n) {
54
+ margin-right: 0;
55
+ }
56
+ }
57
+
58
+ .usa-width-five-sixths {
59
+ @include span-columns(4);
60
+ }
61
+
62
+ .usa-width-one-twelfth {
63
+ @include span-columns(2);
64
+
65
+ &:nth-child(3n) {
66
+ margin-right: 0;
67
+ }
68
+ }
69
+
70
+ .usa-width-five-twelfths {
71
+ @include span-columns(2);
72
+ }
73
+
74
+ .usa-width-seven-twelfths {
75
+ @include span-columns(4);
76
+ }
77
+ }
78
+
79
+ @include media($large) {
80
+ .usa-width-one-whole {
81
+ @include span-columns(12);
82
+ }
83
+
84
+ .usa-width-one-half {
85
+ @include span-columns(6);
86
+ }
87
+
88
+ .usa-width-one-third {
89
+ @include span-columns(4);
90
+ }
91
+
92
+ .usa-width-two-thirds {
93
+ @include span-columns(8);
94
+ }
95
+
96
+ .usa-width-one-fourth {
97
+ @include span-columns(3);
98
+
99
+ &:nth-child(2n) {
100
+ @include span-columns(3);
101
+ }
102
+
103
+ &:nth-child(4n) {
104
+ margin-right: 0;
105
+ }
106
+ }
107
+
108
+ .usa-width-three-fourths {
109
+ @include span-columns(9);
110
+ }
111
+
112
+ .usa-width-one-sixth {
113
+ @include span-columns(2);
114
+
115
+ &:nth-child(3n) {
116
+ @include span-columns(2);
117
+ }
118
+
119
+ &:nth-child(6n) {
120
+ margin-right: 0;
121
+ }
122
+ }
123
+
124
+ .usa-width-five-sixths {
125
+ @include span-columns(10);
126
+ }
127
+
128
+ .usa-width-one-twelfth {
129
+ @include span-columns(1);
130
+
131
+ &:nth-child(3n) {
132
+ @include span-columns(1);
133
+ }
134
+
135
+ &:nth-child(12n) {
136
+ margin-right: 0;
137
+ }
138
+ }
139
+
140
+ .usa-width-five-twelfths {
141
+ @include span-columns(5);
142
+ }
143
+
144
+ .usa-width-seven-twelfths {
145
+ @include span-columns(7);
146
+ }
147
+ }
148
+
149
+ // Specifies end of a row.
150
+ // Required if grid-box contains multiple rows.
151
+ // Required if browser does not support :last-child
152
+ .usa-end-row {
153
+ @include omega();
154
+ }
@@ -0,0 +1,232 @@
1
+ // Heading mixins
2
+ @mixin title {
3
+ font-size: $title-font-size;
4
+ font-weight: $font-bold;
5
+ }
6
+
7
+ @mixin h1 {
8
+ font-size: $h1-font-size;
9
+ font-weight: $font-bold;
10
+ }
11
+
12
+ @mixin h2 {
13
+ font-size: $h2-font-size;
14
+ font-weight: $font-bold;
15
+ }
16
+
17
+ @mixin h3 {
18
+ font-size: $h3-font-size;
19
+ font-weight: $font-bold;
20
+ }
21
+
22
+ @mixin h4 {
23
+ font-size: $h4-font-size;
24
+ font-weight: $font-bold;
25
+ }
26
+
27
+ @mixin h5 {
28
+ font-size: $h5-font-size;
29
+ font-weight: $font-bold;
30
+ }
31
+
32
+ @mixin h6 {
33
+ font-family: $font-sans;
34
+ font-size: $h6-font-size;
35
+ font-weight: $font-normal;
36
+ text-transform: uppercase;
37
+ }
38
+
39
+ // Mobile-first media query helper
40
+ @mixin media($bp) {
41
+ @media screen and (min-width: #{$bp}) {
42
+ @content;
43
+ }
44
+ }
45
+
46
+ // Screen reader only helper
47
+ @mixin sr-only() {
48
+ position: absolute;
49
+ left: -999em;
50
+ }
51
+
52
+ .usa-sr-only {
53
+ @include sr-only();
54
+ }
55
+
56
+ // Aria hidden helper
57
+ @mixin accessibly-hidden() {
58
+ &[aria-hidden=true] {
59
+ display: none;
60
+ }
61
+ }
62
+
63
+ // Unstyled list helper
64
+ @mixin unstyled-list() {
65
+ @include margin(0 null);
66
+ list-style-type: none;
67
+ padding-left: 0;
68
+
69
+ > li {
70
+ margin-bottom: 0;
71
+ }
72
+ }
73
+
74
+ // Font smoothing mixin
75
+ // Only use for light text on dark background
76
+ // TODO: Remove after adding PostCSS
77
+ @mixin font-smoothing {
78
+ -moz-osx-font-smoothing: grayscale;
79
+ -webkit-font-smoothing: antialiased;
80
+ }
81
+
82
+ // Content size helpers
83
+ @mixin allow-layout-classes {
84
+ @include margin(null auto);
85
+
86
+ &.width-one-half {
87
+ @include media($medium-screen) {
88
+ width: 50%;
89
+ }
90
+ }
91
+
92
+ &.width-one-third {
93
+ @include media($medium-screen) {
94
+ width: 33%;
95
+ }
96
+ }
97
+
98
+ &.width-two-thirds {
99
+ @include media($medium-screen) {
100
+ width: 67%;
101
+ }
102
+ }
103
+
104
+ &.width-one-fourth {
105
+ @include media($medium-screen) {
106
+ width: 25%;
107
+ }
108
+ }
109
+
110
+ &.width-three-fourths {
111
+ @include media($medium-screen) {
112
+ width: 75%;
113
+ }
114
+ }
115
+
116
+ &.align-left {
117
+ @include media($medium-screen) {
118
+ float: left;
119
+ margin-right: 2em;
120
+ margin-top: 0.5em;
121
+ }
122
+ }
123
+
124
+ &.align-right {
125
+ @include media($medium-screen) {
126
+ float: right;
127
+ margin-left: 2em;
128
+ margin-top: 0.5em;
129
+ }
130
+ }
131
+ }
132
+
133
+ @mixin display-icon($icon, $direction, $size, $margin, $hover) {
134
+ &::#{$direction} {
135
+ background-image: url(#{$image-path}/#{$icon}.png);
136
+ background-image: url(#{$image-path}/#{$icon}.svg);
137
+ background-size: 100%;
138
+ content: '';
139
+ display: inline-block;
140
+ height: $size;
141
+ width: $size;
142
+
143
+ /* stylelint-disable block-closing-brace-newline-after, at-rule-empty-line-before */
144
+ @if $direction == 'after' {
145
+ margin-left: $margin;
146
+ } @else {
147
+ margin-right: $margin;
148
+ }
149
+ /* stylelint-enable */
150
+ }
151
+
152
+ @if $hover == 'hover' {
153
+ &:hover::#{$direction} {
154
+ background-image: url(#{$image-path}/#{$icon}-hover.png);
155
+ background-image: url(#{$image-path}/#{$icon}-hover.svg);
156
+ }
157
+ }
158
+ }
159
+
160
+ @mixin usa-sidenav-list {
161
+ @include unstyled-list();
162
+
163
+ > li {
164
+ background-color: transparent;
165
+ border-top: 1px solid $color-gray;
166
+ font-size: $h4-font-size;
167
+
168
+ &:first-child {
169
+ border-top: none;
170
+ }
171
+ }
172
+
173
+ a {
174
+ border: none;
175
+ color: $color-base;
176
+ display: block;
177
+ font-family: $font-sans;
178
+ line-height: 1.3;
179
+ padding: 0.85rem 1rem 0.85rem 1.8rem;
180
+ text-decoration: none;
181
+
182
+ &:hover {
183
+ background-color: $color-gray-lightest;
184
+ color: $color-primary;
185
+ text-decoration: none;
186
+ }
187
+
188
+ &:focus {
189
+ position: relative;
190
+ z-index: 1;
191
+ }
192
+
193
+ &.usa-current { /* stylelint-disable-line selector-no-qualifying-type */
194
+ border-left: 4px solid $color-primary;
195
+ color: $color-primary;
196
+ font-weight: $font-bold;
197
+ padding-left: 1.4rem;
198
+ }
199
+ }
200
+ }
201
+
202
+ @mixin usa-sidenav-sublist {
203
+ @include unstyled-list();
204
+ margin: 0;
205
+ width: 100%;
206
+
207
+ li {
208
+ border: none;
209
+ font-size: $h5-font-size;
210
+ }
211
+
212
+ a {
213
+ padding-left: 2.8rem;
214
+ line-height: $heading-line-height;
215
+
216
+ &:hover,
217
+ &.usa-current { /* stylelint-disable-line selector-no-qualifying-type */
218
+ border: none;
219
+ padding-left: 2.8rem;
220
+ }
221
+ }
222
+
223
+ .usa-sidenav-sub_list {
224
+ a {
225
+ padding-left: 3.8rem;
226
+
227
+ &:hover {
228
+ padding-left: 3.8rem;
229
+ }
230
+ }
231
+ }
232
+ }