uswds-jekyll 4.1.0 → 5.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (801) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +345 -315
  3. data/_includes/analytics.html +7 -10
  4. data/_includes/components/banner.html +38 -13
  5. data/_includes/components/footer--big.html +142 -0
  6. data/_includes/components/footer--default.html +104 -0
  7. data/_includes/components/footer--slim.html +93 -0
  8. data/_includes/components/github-edit.html +3 -0
  9. data/_includes/components/graphic-list.html +13 -11
  10. data/_includes/components/header.html +161 -0
  11. data/_includes/components/hero.html +6 -13
  12. data/_includes/components/search.html +31 -0
  13. data/_includes/footer.html +7 -1
  14. data/_includes/header.html +1 -5
  15. data/_includes/meta.html +7 -1
  16. data/_includes/scripts.html +23 -14
  17. data/_includes/sidenav.html +23 -21
  18. data/_includes/styles.html +1 -1
  19. data/_layouts/default.html +39 -3
  20. data/_layouts/home.html +5 -26
  21. data/_layouts/page.html +19 -13
  22. data/_layouts/project.html +1 -2
  23. data/_layouts/team-member.html +1 -2
  24. data/_sass/_uswds-theme-custom-styles.scss +0 -0
  25. data/_sass/_uswds-theme-override-settings.scss +2 -0
  26. data/_sass/_uswds-theme-packages.scss +1 -0
  27. data/_sass/_uswds-theme-settings.scss +0 -0
  28. data/_sass/uswds/components/_all.scss +8 -0
  29. data/_sass/{components → uswds/components}/_alt-color-section.scss +6 -7
  30. data/_sass/{components → uswds/components}/_card.scss +14 -17
  31. data/_sass/uswds/components/_footer.scss +16 -502
  32. data/_sass/uswds/components/_header.scss +30 -198
  33. data/_sass/uswds/components/_hero.scss +37 -29
  34. data/_sass/{components → uswds/components}/_nav-buttons.scss +6 -6
  35. data/_sass/uswds/components/_side-nav.scss +46 -0
  36. data/_sass/uswds/components/_site-width.scss +6 -0
  37. data/_sass/uswds/components/_top-nav.scss +84 -0
  38. data/_sass/uswds/components/_usa-banner.scss +30 -0
  39. data/_sass/uswds/custom/_uswds-theme-custom-styles.scss +47 -0
  40. data/_sass/uswds/settings/_uswds-conversion-variables.scss +0 -0
  41. data/_sass/uswds/src/base/_accessibility.scss +3 -0
  42. data/_sass/uswds/src/base/_body.scss +5 -0
  43. data/_sass/uswds/src/components/_accordions.scss +116 -0
  44. data/_sass/uswds/src/components/_alerts.scss +143 -0
  45. data/_sass/uswds/src/components/_banner.scss +297 -0
  46. data/_sass/uswds/src/components/_breadcrumb.scss +168 -0
  47. data/_sass/uswds/src/components/_button-groups.scss +134 -0
  48. data/_sass/uswds/src/components/_card.scss +346 -0
  49. data/_sass/uswds/src/components/_checklist.scss +17 -0
  50. data/_sass/uswds/src/components/_footer.scss +359 -0
  51. data/_sass/uswds/src/components/_forms.scss +54 -0
  52. data/_sass/uswds/src/components/_graphic-list.scss +42 -0
  53. data/_sass/uswds/src/components/_header.scss +287 -0
  54. data/_sass/uswds/src/components/_hero.scss +32 -0
  55. data/_sass/uswds/src/components/_identifier.scss +146 -0
  56. data/_sass/uswds/src/components/_layout.scss +15 -0
  57. data/_sass/uswds/src/components/_media-block.scss +12 -0
  58. data/_sass/uswds/src/components/_megamenu.scss +45 -0
  59. data/_sass/uswds/src/components/_nav-container.scss +7 -0
  60. data/_sass/uswds/src/components/_navbar.scss +16 -0
  61. data/_sass/uswds/src/components/_navigation.scss +348 -0
  62. data/_sass/uswds/src/components/_search.scss +98 -0
  63. data/_sass/uswds/src/components/_section.scss +42 -0
  64. data/_sass/uswds/src/components/_sidenav.scss +19 -0
  65. data/_sass/uswds/src/components/_skipnav.scss +20 -0
  66. data/_sass/uswds/src/components/_step-indicator.scss +444 -0
  67. data/_sass/uswds/src/components/_tooltip.scss +114 -0
  68. data/_sass/uswds/{core → src/core}/_defaults.scss +1 -1
  69. data/_sass/uswds/src/core/_deprecated.scss +33 -0
  70. data/_sass/uswds/src/core/_functions.scss +1954 -0
  71. data/_sass/uswds/src/core/_notifications.scss +100 -0
  72. data/_sass/uswds/src/core/_properties.scss +699 -0
  73. data/_sass/uswds/src/core/_system-tokens.scss +1658 -0
  74. data/_sass/uswds/src/core/_variables.scss +636 -0
  75. data/_sass/uswds/src/core/mixins/_add-aspect.scss +17 -0
  76. data/_sass/uswds/src/core/mixins/_add-background-svg.scss +9 -0
  77. data/_sass/uswds/src/core/mixins/_add-bar.scss +43 -0
  78. data/_sass/uswds/src/core/mixins/_add-checkbox-placeholder.scss +15 -0
  79. data/_sass/uswds/src/core/mixins/_add-kerning.scss +4 -0
  80. data/_sass/uswds/src/core/mixins/_add-knockout-font-smoothing.scss +9 -0
  81. data/_sass/uswds/src/core/mixins/_add-link-styles.scss +20 -0
  82. data/_sass/uswds/src/core/mixins/_add-list-reset.scss +15 -0
  83. data/_sass/uswds/src/core/mixins/_add-responsive-site-margins.scss +6 -0
  84. data/_sass/uswds/src/core/mixins/_add-success-mark.scss +7 -0
  85. data/_sass/uswds/src/core/mixins/_all.scss +90 -0
  86. data/_sass/uswds/src/core/mixins/_at-media.scss +36 -0
  87. data/_sass/uswds/src/core/mixins/_border-box-sizing.scss +19 -0
  88. data/_sass/uswds/src/core/mixins/_button-disabled.scss +17 -0
  89. data/_sass/uswds/src/core/mixins/_button-unstyled.scss +20 -0
  90. data/_sass/uswds/src/core/mixins/_clearfix.scss +7 -0
  91. data/_sass/uswds/src/core/mixins/_embed-container.scss +3 -0
  92. data/_sass/uswds/src/core/mixins/_external-link.scss +21 -0
  93. data/_sass/uswds/src/core/mixins/_focus.scss +14 -0
  94. data/_sass/uswds/src/core/mixins/_font-face.scss +103 -0
  95. data/_sass/uswds/src/core/mixins/_icon.scss +183 -0
  96. data/_sass/uswds/src/core/mixins/_layout-grid.scss +128 -0
  97. data/_sass/uswds/src/core/mixins/_media-block-img.scss +4 -0
  98. data/_sass/uswds/{elements/_figure.scss → src/core/mixins/_media-link.scss} +0 -8
  99. data/_sass/uswds/src/core/mixins/_nav-list.scss +95 -0
  100. data/_sass/uswds/src/core/mixins/_override-prose.scss +6 -0
  101. data/_sass/uswds/src/core/mixins/_screen-reader.scss +23 -0
  102. data/_sass/uswds/src/core/mixins/_set-link-from-bg.scss +30 -0
  103. data/_sass/uswds/src/core/mixins/_set-text-from-bg.scss +28 -0
  104. data/_sass/uswds/src/core/mixins/_typography.scss +161 -0
  105. data/_sass/uswds/src/core/mixins/_unstyled-list.scss +11 -0
  106. data/_sass/uswds/src/core/mixins/_usa-list-styles.scss +10 -0
  107. data/_sass/uswds/src/core/mixins/_usa-table-styles.scss +8 -0
  108. data/_sass/uswds/src/core/mixins/_usa-typography.scss +54 -0
  109. data/_sass/uswds/src/core/mixins/_utility-builder.scss +369 -0
  110. data/_sass/uswds/src/core/mixins/layout-grid/_grid-container.scss +14 -0
  111. data/_sass/uswds/src/core/mixins/layout-grid/_grid-row.scss +7 -0
  112. data/_sass/uswds/src/core/mixins/utilities/_align-items.scss +11 -0
  113. data/_sass/uswds/src/core/mixins/utilities/_align-self.scss +11 -0
  114. data/_sass/uswds/src/core/mixins/utilities/_background-color.scss +9 -0
  115. data/_sass/uswds/src/core/mixins/utilities/_border-color.scss +11 -0
  116. data/_sass/uswds/src/core/mixins/utilities/_border-radius.scss +55 -0
  117. data/_sass/uswds/src/core/mixins/utilities/_border-width.scss +32 -0
  118. data/_sass/uswds/src/core/mixins/utilities/_border.scss +142 -0
  119. data/_sass/uswds/src/core/mixins/utilities/_bottom.scss +10 -0
  120. data/_sass/uswds/src/core/mixins/utilities/_circle.scss +9 -0
  121. data/_sass/uswds/src/core/mixins/utilities/_color.scss +10 -0
  122. data/_sass/uswds/src/core/mixins/utilities/_cursor.scss +10 -0
  123. data/_sass/uswds/src/core/mixins/utilities/_display.scss +11 -0
  124. data/_sass/uswds/src/core/mixins/utilities/_flex-direction.scss +10 -0
  125. data/_sass/uswds/src/core/mixins/utilities/_flex.scss +55 -0
  126. data/_sass/uswds/src/core/mixins/utilities/_float.scss +10 -0
  127. data/_sass/uswds/src/core/mixins/utilities/_font-weight.scss +10 -0
  128. data/_sass/uswds/src/core/mixins/utilities/_font.scss +42 -0
  129. data/_sass/uswds/src/core/mixins/utilities/_height.scss +11 -0
  130. data/_sass/uswds/src/core/mixins/utilities/_justify-content.scss +10 -0
  131. data/_sass/uswds/src/core/mixins/utilities/_left.scss +10 -0
  132. data/_sass/uswds/src/core/mixins/utilities/_line-height.scss +13 -0
  133. data/_sass/uswds/src/core/mixins/utilities/_margin.scss +85 -0
  134. data/_sass/uswds/src/core/mixins/utilities/_max-height.scss +10 -0
  135. data/_sass/uswds/src/core/mixins/utilities/_max-width.scss +10 -0
  136. data/_sass/uswds/src/core/mixins/utilities/_measure.scss +10 -0
  137. data/_sass/uswds/src/core/mixins/utilities/_min-height.scss +10 -0
  138. data/_sass/uswds/src/core/mixins/utilities/_min-width.scss +10 -0
  139. data/_sass/uswds/src/core/mixins/utilities/_order.scss +10 -0
  140. data/_sass/uswds/src/core/mixins/utilities/_outline-color.scss +10 -0
  141. data/_sass/uswds/src/core/mixins/utilities/_outline.scss +35 -0
  142. data/_sass/uswds/src/core/mixins/utilities/_overflow.scss +28 -0
  143. data/_sass/uswds/src/core/mixins/utilities/_padding.scss +49 -0
  144. data/_sass/uswds/src/core/mixins/utilities/_pin.scss +82 -0
  145. data/_sass/uswds/src/core/mixins/utilities/_position.scss +10 -0
  146. data/_sass/uswds/src/core/mixins/utilities/_right.scss +10 -0
  147. data/_sass/uswds/src/core/mixins/utilities/_shadow.scss +10 -0
  148. data/_sass/uswds/src/core/mixins/utilities/_square.scss +7 -0
  149. data/_sass/uswds/src/core/mixins/utilities/_text-align.scss +10 -0
  150. data/_sass/uswds/src/core/mixins/utilities/_text-decoration-color.scss +10 -0
  151. data/_sass/uswds/src/core/mixins/utilities/_text-decoration.scss +17 -0
  152. data/_sass/uswds/src/core/mixins/utilities/_text-indent.scss +10 -0
  153. data/_sass/uswds/src/core/mixins/utilities/_text.scss +77 -0
  154. data/_sass/uswds/src/core/mixins/utilities/_top.scss +10 -0
  155. data/_sass/uswds/src/core/mixins/utilities/_vertical-align.scss +10 -0
  156. data/_sass/uswds/src/core/mixins/utilities/_white-space.scss +10 -0
  157. data/_sass/uswds/src/core/mixins/utilities/_width.scss +11 -0
  158. data/_sass/uswds/src/core/mixins/utilities/_z-index.scss +10 -0
  159. data/_sass/uswds/src/core/placeholders/_all.scss +2 -0
  160. data/_sass/uswds/src/core/placeholders/_list.scss +23 -0
  161. data/_sass/uswds/src/core/placeholders/_table.scss +58 -0
  162. data/_sass/uswds/src/core/system-tokens/_blue-cool.scss +26 -0
  163. data/_sass/uswds/src/core/system-tokens/_blue-warm.scss +26 -0
  164. data/_sass/uswds/src/core/system-tokens/_blue.scss +26 -0
  165. data/_sass/uswds/src/core/system-tokens/_cyan.scss +26 -0
  166. data/_sass/uswds/src/core/system-tokens/_gold.scss +26 -0
  167. data/_sass/uswds/src/core/system-tokens/_gray-cool.scss +18 -0
  168. data/_sass/uswds/src/core/system-tokens/_gray-warm.scss +18 -0
  169. data/_sass/uswds/src/core/system-tokens/_gray.scss +19 -0
  170. data/_sass/uswds/src/core/system-tokens/_green-cool.scss +26 -0
  171. data/_sass/uswds/src/core/system-tokens/_green-warm.scss +26 -0
  172. data/_sass/uswds/src/core/system-tokens/_green.scss +26 -0
  173. data/_sass/uswds/src/core/system-tokens/_indigo-cool.scss +26 -0
  174. data/_sass/uswds/src/core/system-tokens/_indigo-warm.scss +26 -0
  175. data/_sass/uswds/src/core/system-tokens/_indigo.scss +26 -0
  176. data/_sass/uswds/src/core/system-tokens/_magenta.scss +26 -0
  177. data/_sass/uswds/src/core/system-tokens/_mint-cool.scss +26 -0
  178. data/_sass/uswds/src/core/system-tokens/_mint.scss +26 -0
  179. data/_sass/uswds/src/core/system-tokens/_orange-warm.scss +26 -0
  180. data/_sass/uswds/src/core/system-tokens/_orange.scss +26 -0
  181. data/_sass/uswds/src/core/system-tokens/_red-cool.scss +26 -0
  182. data/_sass/uswds/src/core/system-tokens/_red-warm.scss +26 -0
  183. data/_sass/uswds/src/core/system-tokens/_red.scss +26 -0
  184. data/_sass/uswds/src/core/system-tokens/_violet-warm.scss +26 -0
  185. data/_sass/uswds/src/core/system-tokens/_violet.scss +26 -0
  186. data/_sass/uswds/src/core/system-tokens/_yellow.scss +26 -0
  187. data/_sass/uswds/src/elements/_buttons.scss +224 -0
  188. data/_sass/uswds/{elements → src/elements}/_embed.scss +0 -4
  189. data/_sass/uswds/src/elements/_figure.scss +7 -0
  190. data/_sass/uswds/src/elements/_layout-grid.scss +159 -0
  191. data/_sass/uswds/src/elements/_table.scss +7 -0
  192. data/_sass/uswds/src/elements/_tags.scss +18 -0
  193. data/_sass/uswds/src/elements/form-controls/_all.scss +11 -0
  194. data/_sass/uswds/src/elements/form-controls/_character-count.scss +9 -0
  195. data/_sass/uswds/src/elements/form-controls/_checkbox-and-radio.scss +117 -0
  196. data/_sass/uswds/src/elements/form-controls/_combo-box.scss +126 -0
  197. data/_sass/uswds/src/elements/form-controls/_date-input.scss +31 -0
  198. data/_sass/uswds/src/elements/form-controls/_date-picker.scss +325 -0
  199. data/_sass/uswds/src/elements/form-controls/_dropdown.scss +25 -0
  200. data/_sass/uswds/src/elements/form-controls/_file-input.scss +199 -0
  201. data/_sass/uswds/src/elements/form-controls/_global.scss +91 -0
  202. data/_sass/uswds/src/elements/form-controls/_range-input.scss +89 -0
  203. data/_sass/uswds/src/elements/form-controls/_text-input.scss +13 -0
  204. data/_sass/uswds/src/elements/form-controls/_time-picker.scss +3 -0
  205. data/_sass/uswds/src/elements/typography/_content.scss +62 -0
  206. data/_sass/uswds/src/elements/typography/_links.scss +15 -0
  207. data/_sass/uswds/src/elements/typography/_list.scss +14 -0
  208. data/_sass/uswds/src/elements/typography/_prose.scss +6 -0
  209. data/_sass/uswds/src/global/_focus.scss +24 -0
  210. data/_sass/uswds/src/global/_font-face.scss +11 -0
  211. data/_sass/uswds/src/global/_sizing.scss +14 -0
  212. data/_sass/uswds/src/global/_typography.scss +32 -0
  213. data/_sass/uswds/src/lib/_normalize.scss +349 -0
  214. data/_sass/uswds/src/packages/_form-controls.scss +4 -0
  215. data/_sass/uswds/src/packages/_form-templates.scss +8 -0
  216. data/_sass/uswds/src/packages/_global.scss +7 -0
  217. data/_sass/uswds/src/packages/_layout-grid.scss +4 -0
  218. data/_sass/uswds/src/packages/_required.scss +21 -0
  219. data/_sass/uswds/src/packages/_typography.scss +7 -0
  220. data/_sass/uswds/src/packages/_usa-accordion.scss +4 -0
  221. data/_sass/uswds/src/packages/_usa-alert.scss +4 -0
  222. data/_sass/uswds/src/packages/_usa-banner.scss +7 -0
  223. data/_sass/uswds/src/packages/_usa-breadcrumb.scss +4 -0
  224. data/_sass/uswds/src/packages/_usa-button-group.scss +2 -0
  225. data/_sass/uswds/src/packages/_usa-button.scss +4 -0
  226. data/_sass/uswds/src/packages/_usa-card.scss +4 -0
  227. data/_sass/uswds/src/packages/_usa-checklist.scss +4 -0
  228. data/_sass/uswds/src/packages/_usa-footer.scss +10 -0
  229. data/_sass/uswds/src/packages/_usa-header.scss +13 -0
  230. data/_sass/uswds/src/packages/_usa-hero.scss +6 -0
  231. data/_sass/uswds/src/packages/_usa-identifier.scss +1 -0
  232. data/_sass/uswds/src/packages/_usa-media-block.scss +5 -0
  233. data/_sass/uswds/src/packages/_usa-megamenu.scss +4 -0
  234. data/_sass/uswds/src/packages/_usa-nav-container.scss +4 -0
  235. data/_sass/uswds/src/packages/_usa-nav.scss +5 -0
  236. data/_sass/uswds/src/packages/_usa-navbar.scss +4 -0
  237. data/_sass/uswds/src/packages/_usa-search.scss +8 -0
  238. data/_sass/uswds/src/packages/_usa-sidenav.scss +4 -0
  239. data/_sass/uswds/src/packages/_usa-skipnav.scss +4 -0
  240. data/_sass/uswds/src/packages/_usa-step-indicator.scss +2 -0
  241. data/_sass/uswds/src/packages/_usa-table.scss +4 -0
  242. data/_sass/uswds/src/packages/_usa-tag.scss +4 -0
  243. data/_sass/uswds/src/packages/_usa-tooltip.scss +2 -0
  244. data/_sass/uswds/src/packages/_uswds-components.scss +48 -0
  245. data/_sass/uswds/src/packages/_uswds-fonts.scss +2 -0
  246. data/_sass/uswds/src/packages/_uswds-utilities.scss +6 -0
  247. data/_sass/uswds/src/packages/_validation.scss +8 -0
  248. data/_sass/uswds/src/settings/_settings-color.scss +138 -0
  249. data/_sass/uswds/src/settings/_settings-components.scss +129 -0
  250. data/_sass/uswds/src/settings/_settings-general.scss +101 -0
  251. data/_sass/uswds/src/settings/_settings-spacing.scss +93 -0
  252. data/_sass/uswds/src/settings/_settings-typography.scss +422 -0
  253. data/_sass/uswds/src/settings/_settings-utilities.scss +867 -0
  254. data/_sass/uswds/src/theme/_uswds-theme-color.scss +136 -0
  255. data/_sass/uswds/src/theme/_uswds-theme-components.scss +129 -0
  256. data/_sass/uswds/src/theme/_uswds-theme-custom-styles.scss +21 -0
  257. data/_sass/uswds/src/theme/_uswds-theme-general.scss +101 -0
  258. data/_sass/uswds/src/theme/_uswds-theme-spacing.scss +93 -0
  259. data/_sass/uswds/src/theme/_uswds-theme-typography.scss +422 -0
  260. data/_sass/uswds/src/theme/_uswds-theme-utilities.scss +867 -0
  261. data/_sass/uswds/src/theme/styles.scss +76 -0
  262. data/_sass/uswds/src/uswds.scss +17 -0
  263. data/_sass/uswds/src/utilities/palettes/_all.scss +41 -0
  264. data/_sass/uswds/src/utilities/palettes/_default-palettes.scss +73 -0
  265. data/_sass/uswds/src/utilities/palettes/_font-palettes.scss +2762 -0
  266. data/_sass/uswds/src/utilities/palettes/_palette-registry.scss +46 -0
  267. data/_sass/uswds/src/utilities/palettes/_spacing-palettes.scss +135 -0
  268. data/_sass/uswds/src/utilities/palettes/colors/_all-colors-palettes.scss +56 -0
  269. data/_sass/uswds/src/utilities/palettes/colors/_black-transparent-palettes.scss +16 -0
  270. data/_sass/uswds/src/utilities/palettes/colors/_blue-cool-palettes.scss +69 -0
  271. data/_sass/uswds/src/utilities/palettes/colors/_blue-palettes.scss +66 -0
  272. data/_sass/uswds/src/utilities/palettes/colors/_blue-warm-palettes.scss +69 -0
  273. data/_sass/uswds/src/utilities/palettes/colors/_cyan-palettes.scss +66 -0
  274. data/_sass/uswds/src/utilities/palettes/colors/_gold-palettes.scss +66 -0
  275. data/_sass/uswds/src/utilities/palettes/colors/_gray-cool-palettes.scss +40 -0
  276. data/_sass/uswds/src/utilities/palettes/colors/_gray-palettes.scss +40 -0
  277. data/_sass/uswds/src/utilities/palettes/colors/_gray-warm-palettes.scss +40 -0
  278. data/_sass/uswds/src/utilities/palettes/colors/_green-cool-palettes.scss +69 -0
  279. data/_sass/uswds/src/utilities/palettes/colors/_green-palettes.scss +66 -0
  280. data/_sass/uswds/src/utilities/palettes/colors/_green-warm-palettes.scss +69 -0
  281. data/_sass/uswds/src/utilities/palettes/colors/_indigo-cool-palettes.scss +70 -0
  282. data/_sass/uswds/src/utilities/palettes/colors/_indigo-palettes.scss +66 -0
  283. data/_sass/uswds/src/utilities/palettes/colors/_indigo-warm-palettes.scss +70 -0
  284. data/_sass/uswds/src/utilities/palettes/colors/_magenta-palettes.scss +67 -0
  285. data/_sass/uswds/src/utilities/palettes/colors/_mint-cool-palettes.scss +69 -0
  286. data/_sass/uswds/src/utilities/palettes/colors/_mint-palettes.scss +66 -0
  287. data/_sass/uswds/src/utilities/palettes/colors/_orange-palettes.scss +66 -0
  288. data/_sass/uswds/src/utilities/palettes/colors/_orange-warm-palettes.scss +70 -0
  289. data/_sass/uswds/src/utilities/palettes/colors/_red-cool-palettes.scss +68 -0
  290. data/_sass/uswds/src/utilities/palettes/colors/_red-palettes.scss +66 -0
  291. data/_sass/uswds/src/utilities/palettes/colors/_red-warm-palettes.scss +68 -0
  292. data/_sass/uswds/src/utilities/palettes/colors/_violet-palettes.scss +66 -0
  293. data/_sass/uswds/src/utilities/palettes/colors/_violet-warm-palettes.scss +70 -0
  294. data/_sass/uswds/src/utilities/palettes/colors/_white-transparent-palettes.scss +16 -0
  295. data/_sass/uswds/src/utilities/palettes/colors/_yellow-palettes.scss +66 -0
  296. data/_sass/uswds/src/utilities/rules/_all.scss +57 -0
  297. data/_sass/uswds/src/utilities/rules/_package.scss +62 -0
  298. data/_sass/uswds/src/utilities/rules/add-aspect.scss +84 -0
  299. data/_sass/uswds/src/utilities/rules/add-list-reset.scss +39 -0
  300. data/_sass/uswds/src/utilities/rules/align-items.scss +30 -0
  301. data/_sass/uswds/src/utilities/rules/align-self.scss +27 -0
  302. data/_sass/uswds/src/utilities/rules/background-color.scss +32 -0
  303. data/_sass/uswds/src/utilities/rules/border-color.scss +32 -0
  304. data/_sass/uswds/src/utilities/rules/border-radius.scss +51 -0
  305. data/_sass/uswds/src/utilities/rules/border-style.scss +30 -0
  306. data/_sass/uswds/src/utilities/rules/border-width.scss +44 -0
  307. data/_sass/uswds/src/utilities/rules/border.scss +47 -0
  308. data/_sass/uswds/src/utilities/rules/bottom.scss +28 -0
  309. data/_sass/uswds/src/utilities/rules/box-shadow.scss +27 -0
  310. data/_sass/uswds/src/utilities/rules/circle.scss +35 -0
  311. data/_sass/uswds/src/utilities/rules/clearfix.scss +35 -0
  312. data/_sass/uswds/src/utilities/rules/color.scss +32 -0
  313. data/_sass/uswds/src/utilities/rules/cursor.scss +26 -0
  314. data/_sass/uswds/src/utilities/rules/display.scss +26 -0
  315. data/_sass/uswds/src/utilities/rules/flex-direction.scss +30 -0
  316. data/_sass/uswds/src/utilities/rules/flex-wrap.scss +27 -0
  317. data/_sass/uswds/src/utilities/rules/flex.scss +32 -0
  318. data/_sass/uswds/src/utilities/rules/float.scss +26 -0
  319. data/_sass/uswds/src/utilities/rules/font-family.scss +38 -0
  320. data/_sass/uswds/src/utilities/rules/font-feature.scss +31 -0
  321. data/_sass/uswds/src/utilities/rules/font-style.scss +29 -0
  322. data/_sass/uswds/src/utilities/rules/font-weight.scss +30 -0
  323. data/_sass/uswds/src/utilities/rules/font.scss +38 -0
  324. data/_sass/uswds/src/utilities/rules/height.scss +26 -0
  325. data/_sass/uswds/src/utilities/rules/justify-content.scss +32 -0
  326. data/_sass/uswds/src/utilities/rules/left.scss +28 -0
  327. data/_sass/uswds/src/utilities/rules/letter-spacing.scss +30 -0
  328. data/_sass/uswds/src/utilities/rules/line-height.scss +30 -0
  329. data/_sass/uswds/src/utilities/rules/margin.scss +70 -0
  330. data/_sass/uswds/src/utilities/rules/max-height.scss +27 -0
  331. data/_sass/uswds/src/utilities/rules/max-width.scss +27 -0
  332. data/_sass/uswds/src/utilities/rules/measure.scss +28 -0
  333. data/_sass/uswds/src/utilities/rules/min-height.scss +27 -0
  334. data/_sass/uswds/src/utilities/rules/min-width.scss +27 -0
  335. data/_sass/uswds/src/utilities/rules/opacity.scss +26 -0
  336. data/_sass/uswds/src/utilities/rules/order.scss +29 -0
  337. data/_sass/uswds/src/utilities/rules/outline-color.scss +33 -0
  338. data/_sass/uswds/src/utilities/rules/outline.scss +30 -0
  339. data/_sass/uswds/src/utilities/rules/overflow.scss +31 -0
  340. data/_sass/uswds/src/utilities/rules/padding.scss +43 -0
  341. data/_sass/uswds/src/utilities/rules/pin.scss +101 -0
  342. data/_sass/uswds/src/utilities/rules/position.scss +27 -0
  343. data/_sass/uswds/src/utilities/rules/right.scss +28 -0
  344. data/_sass/uswds/src/utilities/rules/square.scss +33 -0
  345. data/_sass/uswds/src/utilities/rules/text-align.scss +27 -0
  346. data/_sass/uswds/src/utilities/rules/text-decoration-color.scss +31 -0
  347. data/_sass/uswds/src/utilities/rules/text-decoration.scss +30 -0
  348. data/_sass/uswds/src/utilities/rules/text-indent.scss +30 -0
  349. data/_sass/uswds/src/utilities/rules/text-transform.scss +30 -0
  350. data/_sass/uswds/src/utilities/rules/top.scss +28 -0
  351. data/_sass/uswds/src/utilities/rules/vertical-align.scss +30 -0
  352. data/_sass/uswds/src/utilities/rules/whitespace.scss +27 -0
  353. data/_sass/uswds/src/utilities/rules/width.scss +26 -0
  354. data/_sass/uswds/src/utilities/rules/z-index.scss +28 -0
  355. data/_sass/uswds/src/utilities/utility-fonts.scss +20 -0
  356. data/assets/css/uswds-theme.scss +185 -0
  357. data/assets/js/{main.js → anchor.js} +0 -0
  358. data/assets/js/private_eye_conf.js +39 -0
  359. data/assets/js/vendor/private_eye.js +106 -0
  360. data/assets/uswds/fonts/merriweather/Latin-Merriweather-Black.ttf +0 -0
  361. data/assets/uswds/fonts/merriweather/Latin-Merriweather-Black.woff +0 -0
  362. data/assets/uswds/fonts/merriweather/Latin-Merriweather-Black.woff2 +0 -0
  363. data/assets/uswds/fonts/merriweather/Latin-Merriweather-BlackItalic.ttf +0 -0
  364. data/assets/uswds/fonts/merriweather/Latin-Merriweather-BlackItalic.woff +0 -0
  365. data/assets/uswds/fonts/merriweather/Latin-Merriweather-BlackItalic.woff2 +0 -0
  366. data/assets/uswds/fonts/merriweather/Latin-Merriweather-Bold.ttf +0 -0
  367. data/assets/uswds/fonts/merriweather/Latin-Merriweather-Bold.woff +0 -0
  368. data/assets/uswds/fonts/merriweather/Latin-Merriweather-Bold.woff2 +0 -0
  369. data/assets/uswds/fonts/merriweather/Latin-Merriweather-BoldItalic.ttf +0 -0
  370. data/assets/uswds/fonts/merriweather/Latin-Merriweather-BoldItalic.woff +0 -0
  371. data/assets/uswds/fonts/merriweather/Latin-Merriweather-BoldItalic.woff2 +0 -0
  372. data/assets/uswds/fonts/merriweather/Latin-Merriweather-Italic.ttf +0 -0
  373. data/assets/uswds/fonts/merriweather/Latin-Merriweather-Italic.woff +0 -0
  374. data/assets/uswds/fonts/merriweather/Latin-Merriweather-Italic.woff2 +0 -0
  375. data/assets/uswds/fonts/merriweather/Latin-Merriweather-Light.ttf +0 -0
  376. data/assets/uswds/fonts/merriweather/Latin-Merriweather-Light.woff +0 -0
  377. data/assets/uswds/fonts/merriweather/Latin-Merriweather-Light.woff2 +0 -0
  378. data/assets/uswds/fonts/merriweather/Latin-Merriweather-LightItalic.ttf +0 -0
  379. data/assets/uswds/fonts/merriweather/Latin-Merriweather-LightItalic.woff +0 -0
  380. data/assets/uswds/fonts/merriweather/Latin-Merriweather-LightItalic.woff2 +0 -0
  381. data/assets/uswds/fonts/merriweather/Latin-Merriweather-Regular.ttf +0 -0
  382. data/assets/uswds/fonts/merriweather/Latin-Merriweather-Regular.woff +0 -0
  383. data/assets/uswds/fonts/merriweather/Latin-Merriweather-Regular.woff2 +0 -0
  384. data/assets/uswds/fonts/public-sans/PublicSans-Black.ttf +0 -0
  385. data/assets/uswds/fonts/public-sans/PublicSans-Black.woff +0 -0
  386. data/assets/uswds/fonts/public-sans/PublicSans-Black.woff2 +0 -0
  387. data/assets/uswds/fonts/public-sans/PublicSans-BlackItalic.ttf +0 -0
  388. data/assets/uswds/fonts/public-sans/PublicSans-BlackItalic.woff +0 -0
  389. data/assets/uswds/fonts/public-sans/PublicSans-BlackItalic.woff2 +0 -0
  390. data/assets/uswds/fonts/public-sans/PublicSans-Bold.ttf +0 -0
  391. data/assets/uswds/fonts/public-sans/PublicSans-Bold.woff +0 -0
  392. data/assets/uswds/fonts/public-sans/PublicSans-Bold.woff2 +0 -0
  393. data/assets/uswds/fonts/public-sans/PublicSans-BoldItalic.ttf +0 -0
  394. data/assets/uswds/fonts/public-sans/PublicSans-BoldItalic.woff +0 -0
  395. data/assets/uswds/fonts/public-sans/PublicSans-BoldItalic.woff2 +0 -0
  396. data/assets/uswds/fonts/public-sans/PublicSans-ExtraBold.ttf +0 -0
  397. data/assets/uswds/fonts/public-sans/PublicSans-ExtraBold.woff +0 -0
  398. data/assets/uswds/fonts/public-sans/PublicSans-ExtraBold.woff2 +0 -0
  399. data/assets/uswds/fonts/public-sans/PublicSans-ExtraBoldItalic.ttf +0 -0
  400. data/assets/uswds/fonts/public-sans/PublicSans-ExtraBoldItalic.woff +0 -0
  401. data/assets/uswds/fonts/public-sans/PublicSans-ExtraBoldItalic.woff2 +0 -0
  402. data/assets/uswds/fonts/public-sans/PublicSans-ExtraLight.ttf +0 -0
  403. data/assets/uswds/fonts/public-sans/PublicSans-ExtraLight.woff +0 -0
  404. data/assets/uswds/fonts/public-sans/PublicSans-ExtraLight.woff2 +0 -0
  405. data/assets/uswds/fonts/public-sans/PublicSans-ExtraLightItalic.ttf +0 -0
  406. data/assets/uswds/fonts/public-sans/PublicSans-ExtraLightItalic.woff +0 -0
  407. data/assets/uswds/fonts/public-sans/PublicSans-ExtraLightItalic.woff2 +0 -0
  408. data/assets/uswds/fonts/public-sans/PublicSans-Italic.ttf +0 -0
  409. data/assets/uswds/fonts/public-sans/PublicSans-Italic.woff +0 -0
  410. data/assets/uswds/fonts/public-sans/PublicSans-Italic.woff2 +0 -0
  411. data/assets/uswds/fonts/public-sans/PublicSans-Light.ttf +0 -0
  412. data/assets/uswds/fonts/public-sans/PublicSans-Light.woff +0 -0
  413. data/assets/uswds/fonts/public-sans/PublicSans-Light.woff2 +0 -0
  414. data/assets/uswds/fonts/public-sans/PublicSans-LightItalic.ttf +0 -0
  415. data/assets/uswds/fonts/public-sans/PublicSans-LightItalic.woff +0 -0
  416. data/assets/uswds/fonts/public-sans/PublicSans-LightItalic.woff2 +0 -0
  417. data/assets/uswds/fonts/public-sans/PublicSans-Medium.ttf +0 -0
  418. data/assets/uswds/fonts/public-sans/PublicSans-Medium.woff +0 -0
  419. data/assets/uswds/fonts/public-sans/PublicSans-Medium.woff2 +0 -0
  420. data/assets/uswds/fonts/public-sans/PublicSans-MediumItalic.ttf +0 -0
  421. data/assets/uswds/fonts/public-sans/PublicSans-MediumItalic.woff +0 -0
  422. data/assets/uswds/fonts/public-sans/PublicSans-MediumItalic.woff2 +0 -0
  423. data/assets/uswds/fonts/public-sans/PublicSans-Regular.ttf +0 -0
  424. data/assets/uswds/fonts/public-sans/PublicSans-Regular.woff +0 -0
  425. data/assets/uswds/fonts/public-sans/PublicSans-Regular.woff2 +0 -0
  426. data/assets/uswds/fonts/public-sans/PublicSans-SemiBold.ttf +0 -0
  427. data/assets/uswds/fonts/public-sans/PublicSans-SemiBold.woff +0 -0
  428. data/assets/uswds/fonts/public-sans/PublicSans-SemiBold.woff2 +0 -0
  429. data/assets/uswds/fonts/public-sans/PublicSans-SemiBoldItalic.ttf +0 -0
  430. data/assets/uswds/fonts/public-sans/PublicSans-SemiBoldItalic.woff +0 -0
  431. data/assets/uswds/fonts/public-sans/PublicSans-SemiBoldItalic.woff2 +0 -0
  432. data/assets/uswds/fonts/public-sans/PublicSans-Thin.ttf +0 -0
  433. data/assets/uswds/fonts/public-sans/PublicSans-Thin.woff +0 -0
  434. data/assets/uswds/fonts/public-sans/PublicSans-Thin.woff2 +0 -0
  435. data/assets/uswds/fonts/public-sans/PublicSans-ThinItalic.ttf +0 -0
  436. data/assets/uswds/fonts/public-sans/PublicSans-ThinItalic.woff +0 -0
  437. data/assets/uswds/fonts/public-sans/PublicSans-ThinItalic.woff2 +0 -0
  438. data/assets/uswds/fonts/roboto-mono/roboto-mono-v5-latin-100.ttf +0 -0
  439. data/assets/uswds/fonts/roboto-mono/roboto-mono-v5-latin-100.woff +0 -0
  440. data/assets/uswds/fonts/roboto-mono/roboto-mono-v5-latin-100.woff2 +0 -0
  441. data/assets/uswds/fonts/roboto-mono/roboto-mono-v5-latin-100italic.ttf +0 -0
  442. data/assets/uswds/fonts/roboto-mono/roboto-mono-v5-latin-100italic.woff +0 -0
  443. data/assets/uswds/fonts/roboto-mono/roboto-mono-v5-latin-100italic.woff2 +0 -0
  444. data/assets/uswds/fonts/roboto-mono/roboto-mono-v5-latin-300.ttf +0 -0
  445. data/assets/uswds/fonts/roboto-mono/roboto-mono-v5-latin-300.woff +0 -0
  446. data/assets/uswds/fonts/roboto-mono/roboto-mono-v5-latin-300.woff2 +0 -0
  447. data/assets/uswds/fonts/roboto-mono/roboto-mono-v5-latin-300italic.ttf +0 -0
  448. data/assets/uswds/fonts/roboto-mono/roboto-mono-v5-latin-300italic.woff +0 -0
  449. data/assets/uswds/fonts/roboto-mono/roboto-mono-v5-latin-300italic.woff2 +0 -0
  450. data/assets/uswds/fonts/roboto-mono/roboto-mono-v5-latin-500.ttf +0 -0
  451. data/assets/uswds/fonts/roboto-mono/roboto-mono-v5-latin-500.woff +0 -0
  452. data/assets/uswds/fonts/roboto-mono/roboto-mono-v5-latin-500.woff2 +0 -0
  453. data/assets/uswds/fonts/roboto-mono/roboto-mono-v5-latin-500italic.ttf +0 -0
  454. data/assets/uswds/fonts/roboto-mono/roboto-mono-v5-latin-500italic.woff +0 -0
  455. data/assets/uswds/fonts/roboto-mono/roboto-mono-v5-latin-500italic.woff2 +0 -0
  456. data/assets/uswds/fonts/roboto-mono/roboto-mono-v5-latin-700.ttf +0 -0
  457. data/assets/uswds/fonts/roboto-mono/roboto-mono-v5-latin-700.woff +0 -0
  458. data/assets/uswds/fonts/roboto-mono/roboto-mono-v5-latin-700.woff2 +0 -0
  459. data/assets/uswds/fonts/roboto-mono/roboto-mono-v5-latin-700italic.ttf +0 -0
  460. data/assets/uswds/fonts/roboto-mono/roboto-mono-v5-latin-700italic.woff +0 -0
  461. data/assets/uswds/fonts/roboto-mono/roboto-mono-v5-latin-700italic.woff2 +0 -0
  462. data/assets/uswds/fonts/roboto-mono/roboto-mono-v5-latin-italic.ttf +0 -0
  463. data/assets/uswds/fonts/roboto-mono/roboto-mono-v5-latin-italic.woff +0 -0
  464. data/assets/uswds/fonts/roboto-mono/roboto-mono-v5-latin-italic.woff2 +0 -0
  465. data/assets/uswds/fonts/roboto-mono/roboto-mono-v5-latin-regular.ttf +0 -0
  466. data/assets/uswds/fonts/roboto-mono/roboto-mono-v5-latin-regular.woff +0 -0
  467. data/assets/uswds/fonts/roboto-mono/roboto-mono-v5-latin-regular.woff2 +0 -0
  468. data/assets/uswds/fonts/source-sans-pro/sourcesanspro-black-webfont.ttf +0 -0
  469. data/assets/uswds/fonts/source-sans-pro/sourcesanspro-black-webfont.woff +0 -0
  470. data/assets/uswds/fonts/source-sans-pro/sourcesanspro-black-webfont.woff2 +0 -0
  471. data/assets/uswds/fonts/source-sans-pro/sourcesanspro-blackitalic-webfont.ttf +0 -0
  472. data/assets/uswds/fonts/source-sans-pro/sourcesanspro-blackitalic-webfont.woff +0 -0
  473. data/assets/uswds/fonts/source-sans-pro/sourcesanspro-blackitalic-webfont.woff2 +0 -0
  474. data/assets/uswds/fonts/source-sans-pro/sourcesanspro-bold-webfont.ttf +0 -0
  475. data/assets/uswds/fonts/source-sans-pro/sourcesanspro-bold-webfont.woff +0 -0
  476. data/assets/uswds/fonts/source-sans-pro/sourcesanspro-bold-webfont.woff2 +0 -0
  477. data/assets/uswds/fonts/source-sans-pro/sourcesanspro-bolditalic-webfont.ttf +0 -0
  478. data/assets/uswds/fonts/source-sans-pro/sourcesanspro-bolditalic-webfont.woff +0 -0
  479. data/assets/uswds/fonts/source-sans-pro/sourcesanspro-bolditalic-webfont.woff2 +0 -0
  480. data/assets/uswds/fonts/source-sans-pro/sourcesanspro-extralight-webfont.ttf +0 -0
  481. data/assets/uswds/fonts/source-sans-pro/sourcesanspro-extralight-webfont.woff +0 -0
  482. data/assets/uswds/fonts/source-sans-pro/sourcesanspro-extralight-webfont.woff2 +0 -0
  483. data/assets/uswds/fonts/source-sans-pro/sourcesanspro-extralightitalic-webfont.ttf +0 -0
  484. data/assets/uswds/fonts/source-sans-pro/sourcesanspro-extralightitalic-webfont.woff +0 -0
  485. data/assets/uswds/fonts/source-sans-pro/sourcesanspro-extralightitalic-webfont.woff2 +0 -0
  486. data/assets/uswds/fonts/source-sans-pro/sourcesanspro-italic-webfont.ttf +0 -0
  487. data/assets/uswds/fonts/source-sans-pro/sourcesanspro-italic-webfont.woff +0 -0
  488. data/assets/uswds/fonts/source-sans-pro/sourcesanspro-italic-webfont.woff2 +0 -0
  489. data/assets/uswds/fonts/source-sans-pro/sourcesanspro-light-webfont.ttf +0 -0
  490. data/assets/uswds/fonts/source-sans-pro/sourcesanspro-light-webfont.woff +0 -0
  491. data/assets/uswds/fonts/source-sans-pro/sourcesanspro-light-webfont.woff2 +0 -0
  492. data/assets/uswds/fonts/source-sans-pro/sourcesanspro-lightitalic-webfont.ttf +0 -0
  493. data/assets/uswds/fonts/source-sans-pro/sourcesanspro-lightitalic-webfont.woff +0 -0
  494. data/assets/uswds/fonts/source-sans-pro/sourcesanspro-lightitalic-webfont.woff2 +0 -0
  495. data/assets/uswds/fonts/source-sans-pro/sourcesanspro-regular-webfont.ttf +0 -0
  496. data/assets/uswds/fonts/source-sans-pro/sourcesanspro-regular-webfont.woff +0 -0
  497. data/assets/uswds/fonts/source-sans-pro/sourcesanspro-regular-webfont.woff2 +0 -0
  498. data/assets/uswds/fonts/source-sans-pro/sourcesanspro-semibold-webfont.ttf +0 -0
  499. data/assets/uswds/fonts/source-sans-pro/sourcesanspro-semibold-webfont.woff +0 -0
  500. data/assets/uswds/fonts/source-sans-pro/sourcesanspro-semibold-webfont.woff2 +0 -0
  501. data/assets/uswds/fonts/source-sans-pro/sourcesanspro-semibolditalic-webfont.ttf +0 -0
  502. data/assets/uswds/fonts/source-sans-pro/sourcesanspro-semibolditalic-webfont.woff +0 -0
  503. data/assets/uswds/fonts/source-sans-pro/sourcesanspro-semibolditalic-webfont.woff2 +0 -0
  504. data/assets/uswds/img/alerts/error.svg +4 -17
  505. data/assets/uswds/img/alerts/info.svg +4 -18
  506. data/assets/uswds/img/alerts/success.svg +1 -12
  507. data/assets/uswds/img/alerts/warning.svg +4 -16
  508. data/assets/uswds/img/angle-arrow-down-gray-90.svg +1 -0
  509. data/assets/uswds/img/angle-arrow-down-hover.svg +1 -1
  510. data/assets/uswds/img/angle-arrow-down-primary-hover.svg +1 -1
  511. data/assets/uswds/img/angle-arrow-down-primary.svg +1 -1
  512. data/assets/uswds/img/angle-arrow-down-white.svg +1 -0
  513. data/assets/uswds/img/angle-arrow-down.svg +1 -1
  514. data/assets/uswds/img/angle-arrow-right-white.svg +1 -0
  515. data/assets/uswds/img/angle-arrow-right.svg +1 -0
  516. data/assets/uswds/img/angle-arrow-up-primary-hover.svg +1 -1
  517. data/assets/uswds/img/angle-arrow-up-primary.svg +1 -1
  518. data/assets/uswds/img/angle-arrow-up-white.svg +1 -0
  519. data/assets/uswds/img/angle-double-left-solid.svg +1 -0
  520. data/assets/uswds/img/angle-double-right-solid.svg +1 -0
  521. data/assets/uswds/img/angle-left-solid.svg +1 -0
  522. data/assets/uswds/img/angle-right-solid.svg +1 -0
  523. data/assets/uswds/img/arrow-both.svg +1 -1
  524. data/assets/uswds/img/arrow-down-gray-60.svg +1 -0
  525. data/assets/uswds/img/arrow-down.svg +1 -1
  526. data/assets/uswds/img/arrow-left-indigo-cool-50v.svg +1 -0
  527. data/assets/uswds/img/arrow-left-white.svg +1 -0
  528. data/assets/uswds/img/arrow-left.svg +1 -0
  529. data/assets/uswds/img/arrow-right.svg +1 -1
  530. data/assets/uswds/img/calendar-alt-solid.svg +1 -0
  531. data/assets/uswds/img/checkbox-check-print.svg +1 -0
  532. data/assets/uswds/img/chevron-right-white.svg +1 -0
  533. data/assets/uswds/img/chevron-right.svg +1 -0
  534. data/assets/uswds/img/chevron-white.svg +1 -0
  535. data/assets/uswds/img/chevron.svg +1 -0
  536. data/assets/uswds/img/circle-124.png +0 -0
  537. data/assets/uswds/img/circle-gray-20.svg +1 -0
  538. data/assets/uswds/img/close-alt-blue-60v.svg +3 -0
  539. data/assets/uswds/img/close-alt.svg +3 -0
  540. data/assets/uswds/img/close-blue-30-alt.svg +3 -0
  541. data/assets/uswds/img/close-blue-40v-alt.svg +3 -0
  542. data/assets/uswds/img/close-blue-50-alt.svg +3 -0
  543. data/assets/uswds/img/close-blue-50v-alt.svg +3 -0
  544. data/assets/uswds/img/close-blue-60-alt.svg +3 -0
  545. data/assets/uswds/img/close-blue-60v-alt.svg +3 -0
  546. data/assets/uswds/img/close-gray-60.svg +1 -0
  547. data/assets/uswds/img/close-gray-90-alt.svg +3 -0
  548. data/assets/uswds/img/close-primary.svg +1 -16
  549. data/assets/uswds/img/close-white-alt.svg +3 -0
  550. data/assets/uswds/img/close-white.svg +3 -0
  551. data/assets/uswds/img/close.svg +1 -12
  552. data/assets/uswds/img/correct8-alt.png +0 -0
  553. data/assets/uswds/img/correct8-alt.svg +1 -0
  554. data/assets/uswds/img/correct8.svg +1 -1
  555. data/assets/uswds/img/correct9.svg +1 -1
  556. data/assets/uswds/img/external-link-alt-hover.svg +1 -1
  557. data/assets/uswds/img/external-link-alt.svg +1 -1
  558. data/assets/uswds/img/external-link-hover.svg +1 -1
  559. data/assets/uswds/img/external-link.svg +1 -1
  560. data/assets/uswds/img/favicons/favicon-114.png +0 -0
  561. data/assets/uswds/img/favicons/favicon-144.png +0 -0
  562. data/assets/uswds/img/favicons/favicon-16.png +0 -0
  563. data/assets/uswds/img/favicons/favicon-192.png +0 -0
  564. data/assets/uswds/img/favicons/favicon-40.png +0 -0
  565. data/assets/uswds/img/favicons/favicon-57.png +0 -0
  566. data/assets/uswds/img/favicons/favicon-72.png +0 -0
  567. data/assets/uswds/img/favicons/favicon.ico +0 -0
  568. data/assets/uswds/img/favicons/favicon.png +0 -0
  569. data/assets/uswds/img/file-excel.svg +1 -0
  570. data/assets/uswds/img/file-pdf.svg +1 -0
  571. data/assets/uswds/img/file-video.svg +1 -0
  572. data/assets/uswds/img/file-word.svg +1 -0
  573. data/assets/uswds/img/file.svg +1 -0
  574. data/assets/uswds/img/hero.png +0 -0
  575. data/assets/uswds/img/icon-dot-gov.svg +1 -1
  576. data/assets/uswds/img/icon-https.svg +1 -1
  577. data/assets/uswds/img/loader.gif +0 -0
  578. data/assets/uswds/img/loader.svg +1 -0
  579. data/assets/uswds/img/lock.svg +1 -0
  580. data/assets/uswds/img/minus-alt.svg +1 -1
  581. data/assets/uswds/img/minus.svg +1 -1
  582. data/assets/uswds/img/plus-alt.svg +1 -1
  583. data/assets/uswds/img/plus.svg +1 -1
  584. data/assets/uswds/img/search-alt.svg +1 -1
  585. data/assets/uswds/img/search-primary.svg +1 -12
  586. data/assets/uswds/img/search.svg +1 -1
  587. data/assets/uswds/img/social-icons/facebook25.png +0 -0
  588. data/assets/uswds/img/social-icons/{svg/facebook25.svg → facebook25.svg} +1 -1
  589. data/assets/uswds/img/social-icons/rss25.png +0 -0
  590. data/assets/uswds/img/social-icons/{svg/rss25.svg → rss25.svg} +1 -1
  591. data/assets/uswds/img/social-icons/twitter16.png +0 -0
  592. data/assets/uswds/img/social-icons/{svg/twitter16.svg → twitter16.svg} +1 -1
  593. data/assets/uswds/img/social-icons/youtube15.png +0 -0
  594. data/assets/uswds/img/social-icons/{svg/youtube15.svg → youtube15.svg} +1 -1
  595. data/assets/uswds/js/uswds.js +5128 -902
  596. data/assets/uswds/js/uswds.min.js +1 -1
  597. data/assets/uswds/js/uswds.min.js.map +1 -1
  598. metadata +581 -228
  599. data/_includes/components/footer--medium.html +0 -100
  600. data/_includes/components/header--basic.html +0 -74
  601. data/_includes/components/header--extended.html +0 -92
  602. data/_sass/components/_all.scss +0 -8
  603. data/_sass/components/_footer.scss +0 -26
  604. data/_sass/components/_header.scss +0 -27
  605. data/_sass/components/_hero.scss +0 -45
  606. data/_sass/components/_side-nav.scss +0 -56
  607. data/_sass/components/_site-width.scss +0 -12
  608. data/_sass/components/_top-nav.scss +0 -73
  609. data/_sass/components/_usa-banner.scss +0 -29
  610. data/_sass/uswds/_all.scss +0 -1
  611. data/_sass/uswds/components/_accordions.scss +0 -150
  612. data/_sass/uswds/components/_alerts.scss +0 -125
  613. data/_sass/uswds/components/_banner.scss +0 -204
  614. data/_sass/uswds/components/_forms.scss +0 -164
  615. data/_sass/uswds/components/_graphic-list.scss +0 -35
  616. data/_sass/uswds/components/_layout.scss +0 -36
  617. data/_sass/uswds/components/_media-block.scss +0 -12
  618. data/_sass/uswds/components/_navigation.scss +0 -549
  619. data/_sass/uswds/components/_search.scss +0 -111
  620. data/_sass/uswds/components/_section.scss +0 -37
  621. data/_sass/uswds/components/_sidenav.scss +0 -8
  622. data/_sass/uswds/components/_skipnav.scss +0 -19
  623. data/_sass/uswds/core/_base.scss +0 -35
  624. data/_sass/uswds/core/_fonts.scss +0 -65
  625. data/_sass/uswds/core/_grid-settings.scss +0 -3
  626. data/_sass/uswds/core/_grid.scss +0 -199
  627. data/_sass/uswds/core/_utilities.scss +0 -252
  628. data/_sass/uswds/core/_variables.scss +0 -155
  629. data/_sass/uswds/elements/_buttons.scss +0 -217
  630. data/_sass/uswds/elements/_inputs.scss +0 -351
  631. data/_sass/uswds/elements/_labels.scss +0 -20
  632. data/_sass/uswds/elements/_list.scss +0 -32
  633. data/_sass/uswds/elements/_table.scss +0 -55
  634. data/_sass/uswds/elements/_typography.scss +0 -260
  635. data/_sass/uswds/lib/_bourbon-deprecated-upcoming.scss +0 -411
  636. data/_sass/uswds/lib/_bourbon.scss +0 -87
  637. data/_sass/uswds/lib/_neat-helpers.scss +0 -11
  638. data/_sass/uswds/lib/_neat.scss +0 -23
  639. data/_sass/uswds/lib/_normalize.scss +0 -424
  640. data/_sass/uswds/lib/addons/_border-color.scss +0 -26
  641. data/_sass/uswds/lib/addons/_border-radius.scss +0 -48
  642. data/_sass/uswds/lib/addons/_border-style.scss +0 -25
  643. data/_sass/uswds/lib/addons/_border-width.scss +0 -25
  644. data/_sass/uswds/lib/addons/_buttons.scss +0 -64
  645. data/_sass/uswds/lib/addons/_clearfix.scss +0 -25
  646. data/_sass/uswds/lib/addons/_ellipsis.scss +0 -30
  647. data/_sass/uswds/lib/addons/_font-stacks.scss +0 -31
  648. data/_sass/uswds/lib/addons/_hide-text.scss +0 -27
  649. data/_sass/uswds/lib/addons/_margin.scss +0 -26
  650. data/_sass/uswds/lib/addons/_padding.scss +0 -26
  651. data/_sass/uswds/lib/addons/_position.scss +0 -48
  652. data/_sass/uswds/lib/addons/_prefixer.scss +0 -66
  653. data/_sass/uswds/lib/addons/_retina-image.scss +0 -25
  654. data/_sass/uswds/lib/addons/_size.scss +0 -51
  655. data/_sass/uswds/lib/addons/_text-inputs.scss +0 -113
  656. data/_sass/uswds/lib/addons/_timing-functions.scss +0 -34
  657. data/_sass/uswds/lib/addons/_triangle.scss +0 -63
  658. data/_sass/uswds/lib/addons/_word-wrap.scss +0 -29
  659. data/_sass/uswds/lib/css3/_animation.scss +0 -43
  660. data/_sass/uswds/lib/css3/_appearance.scss +0 -3
  661. data/_sass/uswds/lib/css3/_backface-visibility.scss +0 -3
  662. data/_sass/uswds/lib/css3/_background-image.scss +0 -42
  663. data/_sass/uswds/lib/css3/_background.scss +0 -55
  664. data/_sass/uswds/lib/css3/_border-image.scss +0 -59
  665. data/_sass/uswds/lib/css3/_calc.scss +0 -4
  666. data/_sass/uswds/lib/css3/_columns.scss +0 -47
  667. data/_sass/uswds/lib/css3/_filter.scss +0 -4
  668. data/_sass/uswds/lib/css3/_flex-box.scss +0 -287
  669. data/_sass/uswds/lib/css3/_font-face.scss +0 -24
  670. data/_sass/uswds/lib/css3/_font-feature-settings.scss +0 -4
  671. data/_sass/uswds/lib/css3/_hidpi-media-query.scss +0 -10
  672. data/_sass/uswds/lib/css3/_hyphens.scss +0 -4
  673. data/_sass/uswds/lib/css3/_image-rendering.scss +0 -14
  674. data/_sass/uswds/lib/css3/_keyframes.scss +0 -36
  675. data/_sass/uswds/lib/css3/_linear-gradient.scss +0 -38
  676. data/_sass/uswds/lib/css3/_perspective.scss +0 -8
  677. data/_sass/uswds/lib/css3/_placeholder.scss +0 -8
  678. data/_sass/uswds/lib/css3/_radial-gradient.scss +0 -39
  679. data/_sass/uswds/lib/css3/_selection.scss +0 -42
  680. data/_sass/uswds/lib/css3/_text-decoration.scss +0 -19
  681. data/_sass/uswds/lib/css3/_transform.scss +0 -15
  682. data/_sass/uswds/lib/css3/_transition.scss +0 -71
  683. data/_sass/uswds/lib/css3/_user-select.scss +0 -3
  684. data/_sass/uswds/lib/functions/_assign-inputs.scss +0 -11
  685. data/_sass/uswds/lib/functions/_contains-falsy.scss +0 -20
  686. data/_sass/uswds/lib/functions/_contains.scss +0 -26
  687. data/_sass/uswds/lib/functions/_is-length.scss +0 -11
  688. data/_sass/uswds/lib/functions/_is-light.scss +0 -21
  689. data/_sass/uswds/lib/functions/_is-number.scss +0 -11
  690. data/_sass/uswds/lib/functions/_is-size.scss +0 -13
  691. data/_sass/uswds/lib/functions/_modular-scale.scss +0 -69
  692. data/_sass/uswds/lib/functions/_new-breakpoint.scss +0 -49
  693. data/_sass/uswds/lib/functions/_private.scss +0 -114
  694. data/_sass/uswds/lib/functions/_px-to-em.scss +0 -13
  695. data/_sass/uswds/lib/functions/_px-to-rem.scss +0 -15
  696. data/_sass/uswds/lib/functions/_shade.scss +0 -24
  697. data/_sass/uswds/lib/functions/_strip-units.scss +0 -17
  698. data/_sass/uswds/lib/functions/_tint.scss +0 -24
  699. data/_sass/uswds/lib/functions/_transition-property-name.scss +0 -22
  700. data/_sass/uswds/lib/functions/_unpack.scss +0 -27
  701. data/_sass/uswds/lib/grid/_box-sizing.scss +0 -15
  702. data/_sass/uswds/lib/grid/_direction-context.scss +0 -33
  703. data/_sass/uswds/lib/grid/_display-context.scss +0 -28
  704. data/_sass/uswds/lib/grid/_fill-parent.scss +0 -22
  705. data/_sass/uswds/lib/grid/_media.scss +0 -92
  706. data/_sass/uswds/lib/grid/_omega.scss +0 -87
  707. data/_sass/uswds/lib/grid/_outer-container.scss +0 -34
  708. data/_sass/uswds/lib/grid/_pad.scss +0 -25
  709. data/_sass/uswds/lib/grid/_private.scss +0 -35
  710. data/_sass/uswds/lib/grid/_row.scss +0 -52
  711. data/_sass/uswds/lib/grid/_shift.scss +0 -50
  712. data/_sass/uswds/lib/grid/_span-columns.scss +0 -94
  713. data/_sass/uswds/lib/grid/_to-deprecate.scss +0 -97
  714. data/_sass/uswds/lib/grid/_visual-grid.scss +0 -42
  715. data/_sass/uswds/lib/helpers/_convert-units.scss +0 -21
  716. data/_sass/uswds/lib/helpers/_directional-values.scss +0 -96
  717. data/_sass/uswds/lib/helpers/_font-source-declaration.scss +0 -43
  718. data/_sass/uswds/lib/helpers/_gradient-positions-parser.scss +0 -13
  719. data/_sass/uswds/lib/helpers/_linear-angle-parser.scss +0 -25
  720. data/_sass/uswds/lib/helpers/_linear-gradient-parser.scss +0 -41
  721. data/_sass/uswds/lib/helpers/_linear-positions-parser.scss +0 -61
  722. data/_sass/uswds/lib/helpers/_linear-side-corner-parser.scss +0 -31
  723. data/_sass/uswds/lib/helpers/_radial-arg-parser.scss +0 -69
  724. data/_sass/uswds/lib/helpers/_radial-gradient-parser.scss +0 -50
  725. data/_sass/uswds/lib/helpers/_radial-positions-parser.scss +0 -18
  726. data/_sass/uswds/lib/helpers/_render-gradients.scss +0 -26
  727. data/_sass/uswds/lib/helpers/_shape-size-stripper.scss +0 -10
  728. data/_sass/uswds/lib/helpers/_str-to-num.scss +0 -50
  729. data/_sass/uswds/lib/mixins/_clearfix.scss +0 -25
  730. data/_sass/uswds/lib/settings/_asset-pipeline.scss +0 -7
  731. data/_sass/uswds/lib/settings/_disable-warnings.scss +0 -13
  732. data/_sass/uswds/lib/settings/_grid.scss +0 -51
  733. data/_sass/uswds/lib/settings/_prefixer.scss +0 -9
  734. data/_sass/uswds/lib/settings/_px-to-em.scss +0 -1
  735. data/_sass/uswds/lib/settings/_visual-grid.scss +0 -27
  736. data/_sass/uswds/uswds.scss +0 -41
  737. data/assets/css/main.scss +0 -93
  738. data/assets/uswds/fonts/merriweather-bold-webfont.eot +0 -0
  739. data/assets/uswds/fonts/merriweather-bold-webfont.ttf +0 -0
  740. data/assets/uswds/fonts/merriweather-bold-webfont.woff +0 -0
  741. data/assets/uswds/fonts/merriweather-bold-webfont.woff2 +0 -0
  742. data/assets/uswds/fonts/merriweather-italic-webfont.eot +0 -0
  743. data/assets/uswds/fonts/merriweather-italic-webfont.ttf +0 -0
  744. data/assets/uswds/fonts/merriweather-italic-webfont.woff +0 -0
  745. data/assets/uswds/fonts/merriweather-italic-webfont.woff2 +0 -0
  746. data/assets/uswds/fonts/merriweather-light-webfont.eot +0 -0
  747. data/assets/uswds/fonts/merriweather-light-webfont.ttf +0 -0
  748. data/assets/uswds/fonts/merriweather-light-webfont.woff +0 -0
  749. data/assets/uswds/fonts/merriweather-light-webfont.woff2 +0 -0
  750. data/assets/uswds/fonts/merriweather-regular-webfont.eot +0 -0
  751. data/assets/uswds/fonts/merriweather-regular-webfont.ttf +0 -0
  752. data/assets/uswds/fonts/merriweather-regular-webfont.woff +0 -0
  753. data/assets/uswds/fonts/merriweather-regular-webfont.woff2 +0 -0
  754. data/assets/uswds/fonts/sourcesanspro-bold-webfont.eot +0 -0
  755. data/assets/uswds/fonts/sourcesanspro-bold-webfont.ttf +0 -0
  756. data/assets/uswds/fonts/sourcesanspro-bold-webfont.woff +0 -0
  757. data/assets/uswds/fonts/sourcesanspro-bold-webfont.woff2 +0 -0
  758. data/assets/uswds/fonts/sourcesanspro-italic-webfont.eot +0 -0
  759. data/assets/uswds/fonts/sourcesanspro-italic-webfont.ttf +0 -0
  760. data/assets/uswds/fonts/sourcesanspro-italic-webfont.woff +0 -0
  761. data/assets/uswds/fonts/sourcesanspro-italic-webfont.woff2 +0 -0
  762. data/assets/uswds/fonts/sourcesanspro-light-webfont.eot +0 -0
  763. data/assets/uswds/fonts/sourcesanspro-light-webfont.ttf +0 -0
  764. data/assets/uswds/fonts/sourcesanspro-light-webfont.woff +0 -0
  765. data/assets/uswds/fonts/sourcesanspro-light-webfont.woff2 +0 -0
  766. data/assets/uswds/fonts/sourcesanspro-regular-webfont.eot +0 -0
  767. data/assets/uswds/fonts/sourcesanspro-regular-webfont.ttf +0 -0
  768. data/assets/uswds/fonts/sourcesanspro-regular-webfont.woff +0 -0
  769. data/assets/uswds/fonts/sourcesanspro-regular-webfont.woff2 +0 -0
  770. data/assets/uswds/img/alerts/error.png +0 -0
  771. data/assets/uswds/img/alerts/info.png +0 -0
  772. data/assets/uswds/img/alerts/success.png +0 -0
  773. data/assets/uswds/img/alerts/warning.png +0 -0
  774. data/assets/uswds/img/angle-arrow-down-hover.png +0 -0
  775. data/assets/uswds/img/angle-arrow-down-primary-hover.png +0 -0
  776. data/assets/uswds/img/angle-arrow-down-primary.png +0 -0
  777. data/assets/uswds/img/angle-arrow-down.png +0 -0
  778. data/assets/uswds/img/angle-arrow-up-primary-hover.png +0 -0
  779. data/assets/uswds/img/angle-arrow-up-primary.png +0 -0
  780. data/assets/uswds/img/arrow-both.png +0 -0
  781. data/assets/uswds/img/arrow-down.png +0 -0
  782. data/assets/uswds/img/arrow-right.png +0 -0
  783. data/assets/uswds/img/close-primary.png +0 -0
  784. data/assets/uswds/img/close.png +0 -0
  785. data/assets/uswds/img/correct8.png +0 -0
  786. data/assets/uswds/img/correct9.png +0 -0
  787. data/assets/uswds/img/external-link-alt-hover.png +0 -0
  788. data/assets/uswds/img/external-link-alt.png +0 -0
  789. data/assets/uswds/img/external-link-hover.png +0 -0
  790. data/assets/uswds/img/external-link.png +0 -0
  791. data/assets/uswds/img/minus-alt.png +0 -0
  792. data/assets/uswds/img/minus.png +0 -0
  793. data/assets/uswds/img/plus-alt.png +0 -0
  794. data/assets/uswds/img/plus.png +0 -0
  795. data/assets/uswds/img/search-alt.png +0 -0
  796. data/assets/uswds/img/search-primary.png +0 -0
  797. data/assets/uswds/img/search.png +0 -0
  798. data/assets/uswds/img/social-icons/png/facebook25.png +0 -0
  799. data/assets/uswds/img/social-icons/png/rss25.png +0 -0
  800. data/assets/uswds/img/social-icons/png/twitter16.png +0 -0
  801. data/assets/uswds/img/social-icons/png/youtube15.png +0 -0
@@ -0,0 +1,114 @@
1
+ // Variables
2
+ $triangle-size: 5px;
3
+
4
+ /* Tooltips */
5
+ .usa-tooltip {
6
+ display: inline-block;
7
+ position: relative;
8
+ }
9
+
10
+ .usa-tooltip__trigger {
11
+ cursor: pointer;
12
+
13
+ > svg {
14
+ display: block;
15
+ pointer-events: none;
16
+ }
17
+ }
18
+
19
+ .usa-tooltip__body {
20
+ transition: opacity 0.08s ease-in-out;
21
+ background-color: color($theme-tooltip-background-color);
22
+ border-radius: radius($theme-button-border-radius);
23
+ bottom: 0;
24
+ color: color($theme-tooltip-font-color);
25
+ display: none;
26
+ font-size: size("ui", $theme-tooltip-font-size);
27
+ padding: units(1);
28
+ position: absolute;
29
+ pointer-events: none;
30
+ left: 0;
31
+ opacity: 0;
32
+ transform: translateX(-50%);
33
+ width: auto;
34
+ white-space: pre;
35
+ z-index: 100000;
36
+
37
+ &:after {
38
+ content: "";
39
+ display: block;
40
+ width: 0;
41
+ height: 0;
42
+ pointer-events: none;
43
+ border-left: $triangle-size solid transparent;
44
+ border-right: $triangle-size solid transparent;
45
+ border-top: $triangle-size solid color($theme-tooltip-background-color);
46
+ position: absolute;
47
+ bottom: -$triangle-size;
48
+ left: 50%;
49
+ margin-left: -$triangle-size;
50
+ }
51
+ }
52
+
53
+ .usa-tooltip__body--wrap {
54
+ width: 100%;
55
+ white-space: normal;
56
+ }
57
+
58
+ .usa-tooltip__body.is-set {
59
+ display: block;
60
+ }
61
+
62
+ .usa-tooltip__body.is-visible {
63
+ opacity: 1;
64
+ }
65
+
66
+ .usa-tooltip__body--bottom {
67
+ bottom: auto;
68
+ top: 0;
69
+
70
+ &:after {
71
+ border-left: $triangle-size solid transparent;
72
+ border-right: $triangle-size solid transparent;
73
+ border-bottom: $triangle-size solid color($theme-tooltip-background-color);
74
+ border-top: 0;
75
+ bottom: auto;
76
+ top: -$triangle-size;
77
+ }
78
+ }
79
+
80
+ .usa-tooltip__body--right {
81
+ top: auto;
82
+ transform: translateX(0);
83
+
84
+ &:after {
85
+ border-top: $triangle-size solid transparent;
86
+ border-bottom: $triangle-size solid transparent;
87
+ border-right: $triangle-size solid color($theme-tooltip-background-color);
88
+ border-left: 0;
89
+ right: auto;
90
+ top: 50%;
91
+ bottom: 0;
92
+ left: -$triangle-size;
93
+ margin: -$triangle-size 0 0 0;
94
+ }
95
+ }
96
+
97
+ .usa-tooltip__body--left {
98
+ top: auto;
99
+ left: 0;
100
+ right: auto;
101
+ transform: translateX(0);
102
+
103
+ &:after {
104
+ border-top: $triangle-size solid transparent;
105
+ border-bottom: $triangle-size solid transparent;
106
+ border-left: $triangle-size solid color($theme-tooltip-background-color);
107
+ border-right: 0;
108
+ right: -$triangle-size;
109
+ top: 50%;
110
+ bottom: 0;
111
+ left: auto;
112
+ margin: -$triangle-size 0 0 0;
113
+ }
114
+ }
@@ -5,4 +5,4 @@
5
5
  // For backwards compatibility with consumers of _defaults.scss, we just
6
6
  // re-import _variables here. This should be a noop if it has already been
7
7
  // imported, since every variable is declared with `!default`.
8
- @import './variables';
8
+ @import "./variables";
@@ -0,0 +1,33 @@
1
+ /* deprecated.scss
2
+ ---
3
+ Occasionally the design system will deprecate
4
+ old variables or functionality. If we replace
5
+ the old functionality with something new, this is a
6
+ place to connect the old functionality to the
7
+ new functionality, in the service of better
8
+ continuity and backwards compatibility within a
9
+ major release cycle.
10
+
11
+ Note the USWDS version where we deprecated the
12
+ old functionality in a comment.
13
+
14
+ Be sure to update notifications.scss.
15
+
16
+ This file should started fresh at each
17
+ major version.
18
+ */
19
+
20
+ // Deprecated in 2.2.0
21
+ $theme-navigation-width: $theme-header-min-width;
22
+ $theme-megamenu-logo-text-width: $theme-header-logo-text-width;
23
+
24
+ // Deprecated in 2.0.2
25
+ $theme-title-font-size: $theme-display-font-size;
26
+
27
+ @mixin title {
28
+ @include display;
29
+ }
30
+
31
+ @mixin typeset-title {
32
+ @include typeset-display;
33
+ }
@@ -0,0 +1,1954 @@
1
+ /*
2
+ ========================================
3
+ Functions
4
+ ----------------------------------------
5
+ */
6
+
7
+ // The following vars need to be set
8
+ // here, before the rest of the system
9
+ // variables are set
10
+
11
+ $root-font-size: if($theme-respect-user-font-size, 100%, $theme-root-font-size);
12
+
13
+ $root-font-size-equiv: if(
14
+ $theme-respect-user-font-size,
15
+ 16px,
16
+ $theme-root-font-size
17
+ );
18
+
19
+ /*
20
+ ========================================
21
+ General-purpose functions
22
+ ----------------------------------------
23
+ */
24
+
25
+ /*
26
+ ----------------------------------------
27
+ map-deep-get()
28
+ ----------------------------------------
29
+ @author Hugo Giraudel
30
+ @access public
31
+ @param {Map} $map - Map
32
+ @param {Arglist} $keys - Key chain
33
+ @return {*} - Desired value
34
+ ----------------------------------------
35
+ */
36
+
37
+ @function map-deep-get($map, $keys...) {
38
+ @each $key in $keys {
39
+ $map: map-get($map, $key);
40
+ }
41
+
42
+ @return $map;
43
+ }
44
+
45
+ /*
46
+ ----------------------------------------
47
+ strip-unit()
48
+ ----------------------------------------
49
+ Remove the unit of a length
50
+ @author Hugo Giraudel
51
+ @param {Number} $number - Number to remove unit from
52
+ @return {Number} - Unitless number
53
+ ----------------------------------------
54
+ */
55
+
56
+ @function strip-unit($number) {
57
+ @if type-of($number) == "number" and not unitless($number) {
58
+ @return $number / ($number * 0 + 1);
59
+ }
60
+
61
+ @return $number;
62
+ }
63
+
64
+ /*
65
+ ----------------------------------------
66
+ multi-cat()
67
+ ----------------------------------------
68
+ Concatenate two lists
69
+ ----------------------------------------
70
+ */
71
+
72
+ @function multi-cat($list1, $list2) {
73
+ $this-list: ();
74
+
75
+ @each $e in $list1 {
76
+ @each $ee in $list2 {
77
+ $this-block: $e + $ee;
78
+ $this-list: join($this-list, $this-block);
79
+ }
80
+ }
81
+
82
+ @return $this-list;
83
+ }
84
+
85
+ /*
86
+ ----------------------------------------
87
+ map-collect()
88
+ ----------------------------------------
89
+ Collect multiple maps into a single
90
+ large map
91
+ source: https://gist.github.com/bigglesrocks/d75091700f8f2be5abfe
92
+ ----------------------------------------
93
+ */
94
+
95
+ @function map-collect($maps...) {
96
+ $collection: ();
97
+
98
+ @each $map in $maps {
99
+ $collection: map-merge($collection, $map);
100
+ }
101
+
102
+ @return $collection;
103
+ }
104
+
105
+ /*
106
+ ----------------------------------------
107
+ smart-quote()
108
+ ----------------------------------------
109
+ Quotes strings
110
+ Inspects `px`, `xs`, and `xl` numbers
111
+ Leaves bools as is
112
+ ----------------------------------------
113
+ */
114
+
115
+ @function smart-quote($value) {
116
+ @if type-of($value) == "string" {
117
+ @return quote($value);
118
+ }
119
+
120
+ @if type-of($value) == "number" and index(("px", "xl", "xs"), unit($value)) {
121
+ @return inspect($value);
122
+ }
123
+
124
+ @if type-of($value) == "color" {
125
+ @error 'Only use quoted color tokens in USWDS functions and mixins. '
126
+ + 'See designsystem.digital.gov/design-tokens/color '
127
+ + 'for more information.';
128
+ }
129
+
130
+ @return $value;
131
+ }
132
+
133
+ /*
134
+ ----------------------------------------
135
+ remove()
136
+ ----------------------------------------
137
+ Remove a value from a list
138
+ ----------------------------------------
139
+ */
140
+
141
+ @function remove($list, $value, $recursive: false) {
142
+ $result: ();
143
+
144
+ @for $i from 1 through length($list) {
145
+ @if type-of(nth($list, $i)) == list and $recursive {
146
+ $result: append($result, remove(nth($list, $i), $value, $recursive));
147
+ } @else if nth($list, $i) != $value {
148
+ $result: append($result, nth($list, $i));
149
+ }
150
+ }
151
+
152
+ @return $result;
153
+ }
154
+
155
+ /*
156
+ ----------------------------------------
157
+ strunquote()
158
+ ----------------------------------------
159
+ Unquote a string
160
+ ----------------------------------------
161
+ */
162
+
163
+ @function strunquote($value) {
164
+ @if type-of($value) == "string" {
165
+ $value: unquote($value);
166
+ }
167
+
168
+ @return $value;
169
+ }
170
+
171
+ /*
172
+ ----------------------------------------
173
+ to-map()
174
+ ----------------------------------------
175
+ Convert a single value to a USWDS
176
+ value map.
177
+
178
+ Candidate for deprecation if we remove
179
+ isReadable
180
+ ----------------------------------------
181
+ */
182
+
183
+ @function to-map($key, $values) {
184
+ $l: length($values);
185
+
186
+ @if $key == "noModifier" or $key == "noValue" {
187
+ $key: "";
188
+ }
189
+
190
+ @return (slug: $key, content: $values);
191
+ }
192
+
193
+ /*
194
+ ----------------------------------------
195
+ base-to-map()
196
+ ----------------------------------------
197
+ Convert a single base to a USWDS
198
+ value map.
199
+
200
+ Candidate for deprecation if we remove
201
+ isReadable
202
+ ----------------------------------------
203
+ */
204
+
205
+ @function base-to-map($values) {
206
+ $l: length($values);
207
+
208
+ @if $l == 1 or nth($values, $l) != isReadable {
209
+ @return (slug: $values, isReadable: true);
210
+ } @else {
211
+ $values: remove($values, isReadable);
212
+
213
+ @return (slug: unquote(nth($values, 1)), isReadable: true);
214
+ }
215
+ }
216
+
217
+ /*
218
+ ----------------------------------------
219
+ ns()
220
+ ----------------------------------------
221
+ Add a namesspace of $type if that
222
+ namespace is set to output
223
+ ----------------------------------------
224
+ */
225
+
226
+ @function ns($type) {
227
+ $type: smart-quote($type);
228
+
229
+ @if not map-deep-get($theme-namespace, $type, output) {
230
+ @return "";
231
+ }
232
+
233
+ @return map-deep-get($theme-namespace, $type, namespace);
234
+ }
235
+
236
+ /*
237
+ ----------------------------------------
238
+ de-list()
239
+ ----------------------------------------
240
+ Transform a one-element list or arglist
241
+ into that single element.
242
+ ----------------------------------------
243
+ (1) => 1
244
+ ((1)) => (1)
245
+ ----------------------------------------
246
+ */
247
+
248
+ @function de-list($value) {
249
+ $types: ("list", "arglist");
250
+
251
+ @if not index($types, type-of($value)) {
252
+ @return $value;
253
+ }
254
+
255
+ $output: if(length($value) == 1, nth($value, 1), $value);
256
+
257
+ @return $output;
258
+ }
259
+
260
+ /*
261
+ ----------------------------------------
262
+ unpack()
263
+ ----------------------------------------
264
+ Create lists of single items from lists
265
+ of lists.
266
+ ----------------------------------------
267
+ (1, (2.1, 2.2), 3) -->
268
+ (1, 2.1, 2.2, 3)
269
+ ----------------------------------------
270
+ */
271
+
272
+ @function unpack($value) {
273
+ $output: ();
274
+
275
+ @if length($value) == 0 {
276
+ @return $value;
277
+ }
278
+
279
+ @each $i in $value {
280
+ @if type-of($i) == "list" {
281
+ @each $ii in $i {
282
+ $output: append($output, $ii, comma);
283
+ }
284
+ } @else {
285
+ $output: append($output, $i, comma);
286
+ }
287
+ }
288
+
289
+ @return de-list($output);
290
+ }
291
+
292
+ /*
293
+ ----------------------------------------
294
+ get-last()
295
+ ----------------------------------------
296
+ Return the last item of a list,
297
+ Return null if the value is null
298
+ ----------------------------------------
299
+ */
300
+
301
+ @function get-last($props) {
302
+ $length: length($props);
303
+ $last: if($length == 0, null, nth($props, -1));
304
+
305
+ @return $last;
306
+ }
307
+
308
+ /*
309
+ ----------------------------------------
310
+ has-important()
311
+ ----------------------------------------
312
+ Check to see if `!important` is
313
+ being passed in a mixin's props
314
+ ----------------------------------------
315
+ */
316
+
317
+ @function has-important($props) {
318
+ $props: de-list($props);
319
+
320
+ @if get-last($props) == "!important" {
321
+ @return true;
322
+ }
323
+
324
+ @return false;
325
+ }
326
+
327
+ /*
328
+ ----------------------------------------
329
+ append-important()
330
+ ----------------------------------------
331
+ Append `!important` to a list
332
+ ----------------------------------------
333
+ */
334
+
335
+ @function append-important($source, $destination) {
336
+ @if get-last($source) == "!important" {
337
+ @return append($destination, !important, comma);
338
+ }
339
+
340
+ @return $destination;
341
+ }
342
+
343
+ /*
344
+ ----------------------------------------
345
+ spacing-multiple()
346
+ ----------------------------------------
347
+ Converts a spacing unit multiple into
348
+ the desired final units (currently rem)
349
+ ----------------------------------------
350
+ */
351
+
352
+ @function spacing-multiple($unit) {
353
+ $grid-to-rem: ($system-spacing-grid-base * $unit) / $root-font-size-equiv *
354
+ 1rem;
355
+
356
+ @return $grid-to-rem;
357
+ }
358
+
359
+ /*
360
+ ----------------------------------------
361
+ rem-to-px()
362
+ ----------------------------------------
363
+ Converts a value in rem to a value in px
364
+ ----------------------------------------
365
+ */
366
+
367
+ @function rem-to-px($value-in-rem) {
368
+ @if unit($value-in-rem) == "rem" {
369
+ $rem-to-px: ($value-in-rem / 1rem) * $root-font-size-equiv;
370
+ @return $rem-to-px;
371
+ }
372
+ @if unit($value-in-rem) != "px" {
373
+ @error 'This value must be in either px or rem';
374
+ }
375
+ @return $value-in-rem;
376
+ }
377
+
378
+ /*
379
+ ----------------------------------------
380
+ rem-to-user-em()
381
+ ----------------------------------------
382
+ Converts a value in rem to a value in
383
+ [user-settings] em for use in media
384
+ queries
385
+ ----------------------------------------
386
+ */
387
+
388
+ @function rem-to-user-em($grid-in-rem) {
389
+ $rem-to-user-em: ($grid-in-rem / 1rem) * 1em;
390
+
391
+ @return $rem-to-user-em;
392
+ }
393
+
394
+ /*
395
+ ----------------------------------------
396
+ validate-typeface-token()
397
+ ----------------------------------------
398
+ Check to see if a typeface-token exists.
399
+ Throw an error if a passed token does
400
+ not exist in the typeface-token map.
401
+ ----------------------------------------
402
+ */
403
+
404
+ @function validate-typeface-token($typeface-token) {
405
+ @if not map-has-key($all-typeface-tokens, $typeface-token) {
406
+ @error '`#{$typeface-token}` is not a valid typeface token. '
407
+ + 'Valid tokens: #{map-keys($all-typeface-tokens)} ';
408
+ }
409
+
410
+ @return $typeface-token;
411
+ }
412
+
413
+ /*
414
+ ----------------------------------------
415
+ cap-height()
416
+ ----------------------------------------
417
+ Get the cap height of a valid typeface
418
+ ----------------------------------------
419
+ */
420
+
421
+ @function cap-height($typeface-token) {
422
+ @if not $typeface-token {
423
+ @return false;
424
+ }
425
+
426
+ $typeface-token: validate-typeface-token($typeface-token);
427
+ $token-data: map-get($all-typeface-tokens, $typeface-token);
428
+ @return map-get($token-data, "cap-height");
429
+ }
430
+
431
+ /*
432
+ ----------------------------------------
433
+ px-to-rem()
434
+ ----------------------------------------
435
+ Converts a value in px to a value in rem
436
+ ----------------------------------------
437
+ */
438
+
439
+ @function px-to-rem($pixels) {
440
+ @if not $pixels {
441
+ @return false;
442
+ }
443
+ $px-to-rem: ($pixels / $root-font-size-equiv) * 1rem;
444
+ $px-to-rem: round($px-to-rem * 100) / 100;
445
+
446
+ @return $px-to-rem;
447
+ }
448
+
449
+ /*
450
+ ----------------------------------------
451
+ normalize-type-scale()
452
+ ----------------------------------------
453
+ Normalizes a specific face's optical size
454
+ to a set target
455
+ ----------------------------------------
456
+ */
457
+
458
+ @function normalize-type-scale($cap-height, $scale) {
459
+ @if not $cap-height {
460
+ @return false;
461
+ }
462
+
463
+ $this-scale: $system-base-cap-height * strip-unit($scale) / $cap-height * 1px;
464
+
465
+ @return px-to-rem($this-scale);
466
+ }
467
+
468
+ /*
469
+ ----------------------------------------
470
+ utility-font()
471
+ ----------------------------------------
472
+ Get a normalized font-size in rem from
473
+ a family and a type size in either
474
+ system scale or project scale
475
+ ----------------------------------------
476
+ Not the public-facing function.
477
+ Used for building the utilities and
478
+ withholds certain errors.
479
+ ----------------------------------------
480
+ */
481
+
482
+ @function utility-font($family, $scale) {
483
+ @if not map-has-key($project-cap-heights, $family) {
484
+ @error '#{$family} is not a valid font family token. '
485
+ + 'Valid tokens: #{map-keys($project-cap-heights)}';
486
+ }
487
+
488
+ $quote-scale: smart-quote($scale);
489
+
490
+ @if not map-get($all-type-scale, $quote-scale) {
491
+ @error '`#{$scale}` is not a valid font scale token. '
492
+ + 'Valid tokens: #{map-keys($all-type-scale)}';
493
+ }
494
+
495
+ $this-cap: map-get($project-cap-heights, $family);
496
+ $this-scale: map-get($all-type-scale, $quote-scale);
497
+
498
+ @if not $this-scale and $this-cap {
499
+ @return false;
500
+ }
501
+
502
+ @return normalize-type-scale($this-cap, $this-scale);
503
+ }
504
+
505
+ /*
506
+ ----------------------------------------
507
+ line-height()
508
+ lh()
509
+ ----------------------------------------
510
+ Get a normalized line-height from
511
+ a family and a line-height scale unit
512
+ ----------------------------------------
513
+ */
514
+
515
+ @function lh($props...) {
516
+ $props: unpack($props);
517
+
518
+ @if not(length($props) == 2) {
519
+ @error 'lh() needs both a valid face and line height token '
520
+ + 'in the format `lh(FACE, HEIGHT)`.';
521
+ }
522
+
523
+ $family: smart-quote(nth($props, 1));
524
+ $scale: smart-quote(nth($props, 2));
525
+
526
+ @if not map-has-key($project-cap-heights, $family) {
527
+ @error '#{$family} is not a valid font family token. '
528
+ + 'Valid tokens: #{map-keys($project-cap-heights)}';
529
+ }
530
+
531
+ @if not map-get($system-line-height, $scale) {
532
+ @error '`#{$scale}` is not a valid line-height token. '
533
+ + 'Valid tokens: #{map-keys($system-line-height)}';
534
+ }
535
+
536
+ @if not map-get($project-cap-heights, $family) {
537
+ @return false;
538
+ }
539
+
540
+ $this-cap: map-get($project-cap-heights, $family);
541
+ $this-line-height: map-get($system-line-height, $scale);
542
+ $normalized-line-height: $this-line-height /
543
+ ($system-base-cap-height / $this-cap);
544
+ $normalized-line-height: round($normalized-line-height * 10) / 10;
545
+
546
+ @return $normalized-line-height;
547
+ }
548
+
549
+ @function line-height($props...) {
550
+ @return lh($props...);
551
+ }
552
+
553
+ /*
554
+ ----------------------------------------
555
+ convert-to-font-type()
556
+ ----------------------------------------
557
+ Converts a font-role token into a
558
+ font-type token. Leaves font-type tokens
559
+ unchanged.
560
+ ----------------------------------------
561
+ */
562
+
563
+ @function convert-to-font-type($token) {
564
+ @if map-has-key($project-font-role-tokens, $token) {
565
+ @return map-get($project-font-role-tokens, $token);
566
+ }
567
+
568
+ @return $token;
569
+ }
570
+
571
+ /*
572
+ ----------------------------------------
573
+ get-font-stack()
574
+ ----------------------------------------
575
+ Get a font stack from a style- or
576
+ role-based font token.
577
+ ----------------------------------------
578
+ */
579
+
580
+ @function get-font-stack($token) {
581
+ // Start by converting to a type token (sans, serif, etc)
582
+ $type-token: convert-to-font-type($token);
583
+ $output-display-name: true;
584
+ $this-stack: null;
585
+ // Get the font type metadata
586
+ $this-font-map: map-get($project-font-type-tokens, $type-token);
587
+ // Only output if the font type has an assigned typeface token
588
+ @if map-get($this-font-map, "typeface-token") {
589
+ $this-font-token: map-get($this-font-map, "typeface-token");
590
+ // Get the typeface metadata
591
+ $this-typeface-data: map-get($all-typeface-tokens, $this-font-token);
592
+ $this-name: map-get($this-typeface-data, "display-name");
593
+ // If it's a system typeface, don't output the display name
594
+ @if map-has-key($this-typeface-data, "system-font") {
595
+ $output-display-name: false;
596
+ }
597
+ // If there's a custom stack, use it and output the display name
598
+ @if map-get($this-font-map, "custom-stack") {
599
+ $this-stack: map-get($this-font-map, "custom-stack");
600
+ $output-display-name: true;
601
+ }
602
+ // Otherwise, just get the token's default stack
603
+ @else {
604
+ $this-stack: map-deep-get(
605
+ $all-typeface-tokens,
606
+ $this-font-token,
607
+ "stack"
608
+ );
609
+ }
610
+ // If the typeface has no display name (system fonts), don't output the display name
611
+ @if map-get($this-typeface-data, "display-name") == null {
612
+ $output-display-name: false;
613
+ }
614
+ @if not $output-display-name {
615
+ @return #{$this-stack};
616
+ }
617
+ @return unquote("#{$this-name}, #{$this-stack}");
618
+ }
619
+ @return false;
620
+ }
621
+
622
+ /*
623
+ ----------------------------------------
624
+ get-typeface-token()
625
+ ----------------------------------------
626
+ Get a typeface token from a font-type or
627
+ font-role token.
628
+ ----------------------------------------
629
+ */
630
+
631
+ @function get-typeface-token($font-token) {
632
+ $this-token: $font-token;
633
+ @if map-has-key($project-font-role-tokens, $font-token) {
634
+ $this-token: map-get($project-font-role-tokens, $font-token);
635
+ }
636
+ @return map-deep-get(
637
+ $project-font-type-tokens,
638
+ $this-token,
639
+ "typeface-token"
640
+ );
641
+ }
642
+
643
+ /*
644
+ ----------------------------------------
645
+ get-system-color()
646
+ ----------------------------------------
647
+ Derive a system color from its
648
+ family, value, and vivid or a passed
649
+ variable that is, itself, a list
650
+ ----------------------------------------
651
+ */
652
+
653
+ @function get-system-color(
654
+ $color-family: false,
655
+ $color-grade: false,
656
+ $color-variant: false
657
+ ) {
658
+ // If the arg being passed to the fn
659
+ // is a variable defined as a list,
660
+ // $color-family will contain this
661
+ // entire list, and needs to be
662
+ // unpacked.
663
+ // ex:
664
+ // in settings:
665
+ // $theme-color-primary.'dark': 'blue', 70
666
+ // in the theme colors map:
667
+ // $color-primary-dark: get-system-color($theme-color-primary.'dark'),
668
+
669
+ @if type-of($color-family) == "list" {
670
+ @if length($color-family) > 2 {
671
+ $color-variant: nth($color-family, 3);
672
+ }
673
+ $color-grade: nth($color-family, 2);
674
+ $color-family: nth($color-family, 1);
675
+ }
676
+
677
+ $color-family: smart-quote($color-family);
678
+ $color-variant: smart-quote($color-variant);
679
+
680
+ // If the arg being passed to the fn
681
+ // is false, it should output as `false`
682
+ // to preserve a false value in the
683
+ // target map
684
+ // ex:
685
+ // in settings:
686
+ // $theme-color-primary.'darkest': false;
687
+ // in the theme colors map:
688
+ // 'darkest': get-system-color($theme-color-primary.'darkest'),
689
+ // 'darkest': false, // is the desired outcome
690
+ // TODO: should a false-pass color function be a separate fn?
691
+
692
+ @if not $color-family {
693
+ @return false;
694
+ }
695
+
696
+ @if $color-variant {
697
+ $output: map-deep-get(
698
+ $system-colors,
699
+ $color-family,
700
+ $color-variant,
701
+ $color-grade
702
+ );
703
+
704
+ @return $output;
705
+ }
706
+
707
+ $output: map-deep-get($system-colors, $color-family, $color-grade);
708
+
709
+ @return $output;
710
+ }
711
+
712
+ /*
713
+ ----------------------------------------
714
+ system-type-scale()
715
+ ----------------------------------------
716
+ Get a value from the system type scale
717
+ ----------------------------------------
718
+ */
719
+
720
+ @function system-type-scale($scale) {
721
+ $scale: smart-quote($scale);
722
+
723
+ @if not $scale {
724
+ @return false;
725
+ }
726
+
727
+ @if not map-has-key($system-type-scale, $scale) {
728
+ @error '`#{$scale}` is not a valid type scale token. '
729
+ + 'Valid tokens: #{map-keys($system-type-scale)}';
730
+ }
731
+
732
+ @return map-get($system-type-scale, $scale);
733
+ }
734
+
735
+ /*
736
+ ----------------------------------------
737
+ calc-gap-offset()
738
+ ----------------------------------------
739
+ Calculate a valid uswds unit that is
740
+ half the width of a given unit, for
741
+ calculating gap offset in the layout
742
+ grid.
743
+ ----------------------------------------
744
+ */
745
+
746
+ @function calc-gap-offset($gap-size) {
747
+ $gap-size: smart-quote($gap-size);
748
+
749
+ @if not map-has-key($spacing-to-value, $gap-size) {
750
+ @error '`#{$gap-size}` is not a valid USWDS gap size token.';
751
+ }
752
+
753
+ $numeric-eq: map-get($spacing-to-value, $gap-size);
754
+ $numeric-eq-half: inspect($numeric-eq / 2);
755
+
756
+ @if not map-has-key($spacing-to-token, $numeric-eq-half) {
757
+ @error '`#{$gap-size}` is not a valid USWDS gap size token. '
758
+ + 'Column gaps need to have a standard size half their width.';
759
+ }
760
+
761
+ @return map-get($spacing-to-token, $numeric-eq-half);
762
+ }
763
+
764
+ /*
765
+ ----------------------------------------
766
+ get-standard-values()
767
+ ----------------------------------------
768
+ Gets a map of USWDS standard values
769
+ for a property
770
+ ----------------------------------------
771
+ */
772
+
773
+ @function get-standard-values($property) {
774
+ @return map-deep-get($system-properties, $property, standard);
775
+ }
776
+
777
+ /*
778
+ ----------------------------------------
779
+ number-to-token()
780
+ ----------------------------------------
781
+ Converts an integer or numeric value
782
+ into a system value
783
+
784
+ Ex: 0.5 --> '05'
785
+ -1px --> 'neg-1px'
786
+ ----------------------------------------
787
+ */
788
+
789
+ @function number-to-token($number) {
790
+ $number: inspect($number);
791
+
792
+ @if not map-has-key($number-to-value, $number) {
793
+ @return false;
794
+ }
795
+
796
+ @return map-get($number-to-value, $number);
797
+ }
798
+
799
+ /*
800
+ ----------------------------------------
801
+ columns()
802
+ ----------------------------------------
803
+ outputs a grid-col number based on
804
+ the number of desired columns in the
805
+ 12-column grid
806
+
807
+ Ex: columns(2) --> 6
808
+ grid-col(columns(2))
809
+ ----------------------------------------
810
+ */
811
+
812
+ @function columns($number) {
813
+ $options: "auto", "fill";
814
+ $number: smart-quote($number);
815
+
816
+ @if index($options, $number) {
817
+ @return $number;
818
+ }
819
+ @if 12 % $number != 0 {
820
+ @error '`#{$number}` must be a divisor of 12.';
821
+ }
822
+ $columns: 12 / $number;
823
+ @return $columns;
824
+ }
825
+
826
+ /*
827
+ ----------------------------------------
828
+ get-uswds-value()
829
+ ----------------------------------------
830
+ Finds and outputs a value from the
831
+ USWDS standard values.
832
+
833
+ Used to build other standard utility
834
+ functions and mixins.
835
+ ----------------------------------------
836
+ */
837
+
838
+ @function get-uswds-value($property, $value...) {
839
+ @if type-of($value) == "arglist" and nth($value, 1) == override {
840
+ @return nth($value, 2);
841
+ }
842
+
843
+ $value: nth($value, 1);
844
+ $converted: number-to-token($value);
845
+ $quoted-value: if(
846
+ $converted,
847
+ smart-quote($converted),
848
+ smart-quote(nth($value, 1))
849
+ );
850
+ $our-standard-values: map-deep-get($system-properties, $property, standard);
851
+ $our-extended-values: map-deep-get($system-properties, $property, extended);
852
+
853
+ @if map-has-key($our-standard-values, $quoted-value) {
854
+ $output: map-get($our-standard-values, $quoted-value);
855
+
856
+ @if not $output {
857
+ @if $theme-show-compile-warnings {
858
+ @error '`#{$value}` is set as a `false` value '
859
+ + 'for the #{$property} property in your project settings '
860
+ + 'and will not output properly. '
861
+ + 'Set the value of `#{$value}` in project settings.';
862
+ }
863
+ }
864
+
865
+ @return $output;
866
+ }
867
+
868
+ @if map-has-key($our-extended-values, $quoted-value) {
869
+ @if $theme-show-compile-warnings {
870
+ @warn '`#{$value}` is an extended USWDS `#{$property}` token. '
871
+ + 'This is OK, but only components built with standard tokens can be accepted back into the system. '
872
+ + 'Standard `#{$property}` values: #{map-keys($our-standard-values)}';
873
+ }
874
+
875
+ @return map-get($our-extended-values, $quoted-value);
876
+ }
877
+
878
+ // TODO: what are these last two cases? Evaluate.
879
+ @if not(type-of($value) == "number" and not unitless($value)) {
880
+ @error '`#{$value}` is not a valid `#{$property}` token. '
881
+ + 'You should correct this. Standard `#{$property}` tokens: '
882
+ + ' #{map-keys($our-standard-values)}';
883
+ }
884
+
885
+ @if $theme-show-compile-warnings {
886
+ @warn '`#{$value}` is not a USWDS `#{$property}` token. '
887
+ + 'This is OK, but only components built with standard '
888
+ + 'tokens can be accepted back into the system. '
889
+ + 'Standard `#{$property}` values: #{map-keys($our-standard-values)}';
890
+ }
891
+
892
+ @return $value;
893
+ }
894
+
895
+ /*
896
+ ----------------------------------------
897
+ pow()
898
+ ----------------------------------------
899
+ Raises a unitless number to the power
900
+ of another unitless number
901
+
902
+ Includes helper functions
903
+ ----------------------------------------
904
+ */
905
+
906
+ @function pow($number, $exponent) {
907
+ @if (round($exponent) != $exponent) {
908
+ @return exp($exponent * ln($number));
909
+ }
910
+
911
+ $value: 1;
912
+
913
+ @if $exponent > 0 {
914
+ @for $i from 1 through $exponent {
915
+ $value: $value * $number;
916
+ }
917
+ } @else if $exponent < 0 {
918
+ @for $i from 1 through -$exponent {
919
+ $value: $value / $number;
920
+ }
921
+ }
922
+
923
+ @return $value;
924
+ }
925
+
926
+ @function factorial($value) {
927
+ $result: 1;
928
+
929
+ @if $value == 0 {
930
+ @return $result;
931
+ }
932
+
933
+ @for $index from 1 through $value {
934
+ $result: $result * $index;
935
+ }
936
+
937
+ @return $result;
938
+ }
939
+
940
+ @function summation($iteratee, $input, $initial: 0, $limit: 100) {
941
+ $sum: 0;
942
+
943
+ @for $index from $initial to $limit {
944
+ $sum: $sum + call($iteratee, $input, $index);
945
+ }
946
+
947
+ @return $sum;
948
+ }
949
+
950
+ @function exp-maclaurin($x, $n) {
951
+ @return (pow($x, $n) / factorial($n));
952
+ }
953
+
954
+ @function exp($value) {
955
+ @return summation(get-function("exp-maclaurin"), $value, 0, 100);
956
+ }
957
+
958
+ @function ln-maclaurin($x, $n) {
959
+ @return (pow(-1, $n + 1) / $n) * (pow($x - 1, $n));
960
+ }
961
+
962
+ @function ln($value) {
963
+ $ten-exp: 1;
964
+ $ln-ten: 2.30258509;
965
+
966
+ @while ($value > pow(10, $ten-exp)) {
967
+ $ten-exp: $ten-exp + 1;
968
+ }
969
+
970
+ @return summation(
971
+ get-function("ln-maclaurin"),
972
+ $value / pow(10, $ten-exp),
973
+ 1,
974
+ 100
975
+ ) + $ten-exp * $ln-ten;
976
+ }
977
+
978
+ /// Returns the luminance of `$color` as a float (between 0 and 1)
979
+ /// 1 is pure white, 0 is pure black
980
+ /// @param {Color} $color - Color
981
+ /// @return {Number}
982
+ /// @link http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef Reference
983
+ @function luminance($color) {
984
+ $colors: (
985
+ "red": red($color),
986
+ "green": green($color),
987
+ "blue": blue($color),
988
+ );
989
+
990
+ @each $name, $value in $colors {
991
+ $adjusted: 0;
992
+ $value: $value / 256;
993
+
994
+ @if $value < 0.03928 {
995
+ $value: $value / 12.92;
996
+ } @else {
997
+ $value: ($value + 0.055) / 1.055;
998
+ $value: pow($value, 2.4);
999
+ }
1000
+
1001
+ $colors: map-merge(
1002
+ $colors,
1003
+ (
1004
+ $name: $value,
1005
+ )
1006
+ );
1007
+ }
1008
+
1009
+ $lum: (map-get($colors, "red") * 0.2126) +
1010
+ (map-get($colors, "green") * 0.7152) + (map-get($colors, "blue") * 0.0722);
1011
+ $lum: round($lum * 1000) / 1000;
1012
+
1013
+ @return $lum;
1014
+ }
1015
+
1016
+ /// Casts a string into a number
1017
+ ///
1018
+ /// @param {String | Number} $value - Value to be parsed
1019
+ ///
1020
+ /// @return {Number}
1021
+ ///
1022
+ @function to-number($value) {
1023
+ @if type-of($value) == "number" {
1024
+ @return $value;
1025
+ } @else if type-of($value) != "string" {
1026
+ $_: log("Value for `to-number` should be a number or a string.");
1027
+ }
1028
+
1029
+ $result: 0;
1030
+ $digits: 0;
1031
+ $minus: str-slice($value, 1, 1) == "-";
1032
+ $numbers: (
1033
+ "0": 0,
1034
+ "1": 1,
1035
+ "2": 2,
1036
+ "3": 3,
1037
+ "4": 4,
1038
+ "5": 5,
1039
+ "6": 6,
1040
+ "7": 7,
1041
+ "8": 8,
1042
+ "9": 9,
1043
+ );
1044
+
1045
+ @for $i from if($minus, 2, 1) through str-length($value) {
1046
+ $character: str-slice($value, $i, $i);
1047
+
1048
+ @if not(index(map-keys($numbers), $character) or $character == ".") {
1049
+ @return to-length(if($minus, -$result, $result), str-slice($value, $i));
1050
+ }
1051
+
1052
+ @if $character == "." {
1053
+ $digits: 1;
1054
+ } @else if $digits == 0 {
1055
+ $result: $result * 10 + map-get($numbers, $character);
1056
+ } @else {
1057
+ $digits: $digits * 10;
1058
+ $result: $result + map-get($numbers, $character) / $digits;
1059
+ }
1060
+ }
1061
+
1062
+ @return if($minus, -$result, $result);
1063
+ }
1064
+
1065
+ /*
1066
+ ----------------------------------------
1067
+ decompose()
1068
+ ----------------------------------------
1069
+ Convert a color token into into a list
1070
+ of form [family], [grade], [variant]
1071
+
1072
+ Vivid variants return "vivid" as the
1073
+ variant.
1074
+
1075
+ If neither grade nor variant exists,
1076
+ returns 'null'
1077
+ ----------------------------------------
1078
+ */
1079
+
1080
+ @function decompose($token) {
1081
+ $separator: "-";
1082
+ $family: false;
1083
+ $grade: false;
1084
+ $variant: false;
1085
+ $exceptions: (
1086
+ "black": 100,
1087
+ "white": 0,
1088
+ );
1089
+
1090
+ $token: get-color-token-assignment($token);
1091
+ $split: str-split($token, $separator);
1092
+ $grade: nth($split, length($split));
1093
+
1094
+ @if str-index($grade, "v") {
1095
+ $variant: "vivid";
1096
+ $grade: str-slice($grade, 1, (str-index($grade, "v") - 1));
1097
+ }
1098
+
1099
+ @if length($split) == 3 {
1100
+ $family: nth($split, 1) + $separator + nth($split, 2);
1101
+ } @else {
1102
+ $family: nth($split, 1);
1103
+ }
1104
+
1105
+ $grade: to-number($grade);
1106
+
1107
+ @if map-has-key($exceptions, $family) {
1108
+ $grade: map-get($exceptions, $family);
1109
+ }
1110
+
1111
+ @return $family, $grade, $variant;
1112
+ }
1113
+
1114
+ /*
1115
+ ----------------------------------------
1116
+ test-colors()
1117
+ ----------------------------------------
1118
+ Check to see if all system colors
1119
+ fall between the proper relative
1120
+ luminance range for their grade.
1121
+
1122
+ Has a couple quirks, as the luminance()
1123
+ function returns slightly different
1124
+ results than expected.
1125
+ ----------------------------------------
1126
+ */
1127
+
1128
+ @function test-colors($map) {
1129
+ $exceptions: "black", "white", "transparent", "black-transparent",
1130
+ "white-transparent";
1131
+
1132
+ @each $token, $value in $map {
1133
+ $family: nth(decompose($token), 1);
1134
+ $grade: nth(decompose($token), 2);
1135
+ @if not $value {
1136
+ // empty block
1137
+ } @else if not index($exceptions, $family) {
1138
+ $computed: get-color-grade($value);
1139
+ @debug "Checked #{$family}-#{$grade}";
1140
+ @if $grade <= 5 {
1141
+ // empty block
1142
+ } @else if $computed != $grade {
1143
+ @warn "#{$token} (#{$value}) lum: #{luminance($value)} is not in the range #{map-get($system-luminance-grade-ranges, $grade)}";
1144
+ }
1145
+ }
1146
+ }
1147
+
1148
+ @return 1;
1149
+ }
1150
+
1151
+ /*
1152
+ ----------------------------------------
1153
+ str-split()
1154
+ ----------------------------------------
1155
+ Split a string at a given separator
1156
+ and convert into a lisrt of substrings
1157
+ ----------------------------------------
1158
+ */
1159
+
1160
+ @function str-split($string, $separator) {
1161
+ $split-arr: ();
1162
+ $index: str-index($string, $separator);
1163
+ @while $index != null {
1164
+ $item: str-slice($string, 1, $index - 1);
1165
+ $split-arr: append($split-arr, $item);
1166
+ $string: str-slice($string, $index + 1);
1167
+ $index: str-index($string, $separator);
1168
+ }
1169
+ $split-arr: append($split-arr, $string);
1170
+
1171
+ @return $split-arr;
1172
+ }
1173
+
1174
+ /*
1175
+ ----------------------------------------
1176
+ str-replace()
1177
+ ----------------------------------------
1178
+ Replace any substring with another
1179
+ string
1180
+ ----------------------------------------
1181
+ */
1182
+
1183
+ @function str-replace($string, $search, $replace: "") {
1184
+ $index: str-index($string, $search);
1185
+
1186
+ @if $index {
1187
+ @return str-slice($string, 1, $index - 1) + $replace +
1188
+ str-replace(
1189
+ str-slice($string, $index + str-length($search)),
1190
+ $search,
1191
+ $replace
1192
+ );
1193
+ }
1194
+
1195
+ @return $string;
1196
+ }
1197
+
1198
+ /*
1199
+ ----------------------------------------
1200
+ get-color-token-assignment()
1201
+ ----------------------------------------
1202
+ Get the system token equivalent of any
1203
+ theme color token
1204
+ ----------------------------------------
1205
+ */
1206
+
1207
+ @function get-color-token-assignment($color-token) {
1208
+ $system-token: $color-token;
1209
+ $grade: null;
1210
+
1211
+ @if map-has-key($assignments-theme-color, $color-token) {
1212
+ $system-token: map-get($assignments-theme-color, $system-token);
1213
+ } @else if not map-has-key($system-color-shortcodes, $color-token) {
1214
+ @error "'#{$color-token}' is not a valid color token.";
1215
+ }
1216
+
1217
+ @return $system-token;
1218
+ }
1219
+
1220
+ /*
1221
+ ----------------------------------------
1222
+ get-color-grade()
1223
+ ----------------------------------------
1224
+ Derive the grade equivalent any color,
1225
+ even non-token colors
1226
+ ----------------------------------------
1227
+ */
1228
+
1229
+ @function get-color-grade($color-token) {
1230
+ $grade: null;
1231
+ $lum: null;
1232
+ $color: false;
1233
+
1234
+ @if type-of($color-token) == "color" {
1235
+ $color: $color-token;
1236
+ } @else if type-of(get-color-token-assignment($color-token)) == "color" {
1237
+ $color: get-color-token-assignment($color-token);
1238
+ }
1239
+
1240
+ @if $color {
1241
+ $lum: luminance($color);
1242
+
1243
+ @each $grade, $range in $system-luminance-grade-ranges {
1244
+ $min: nth($range, 1);
1245
+ $max: nth($range, 2);
1246
+ $next-max: false;
1247
+ @if $grade < 100 {
1248
+ @if $grade == 5 {
1249
+ $next-max: nth(map-get($system-luminance-grade-ranges, 10), 2);
1250
+ } @else {
1251
+ $next-max: nth(
1252
+ map-get($system-luminance-grade-ranges, ($grade + 10)),
1253
+ 2
1254
+ );
1255
+ }
1256
+ }
1257
+ @if ($lum >= $min) and ($lum <= $max) {
1258
+ @return $grade;
1259
+ }
1260
+ @if $next-max and ($lum < $min) and ($lum > $next-max) {
1261
+ @return $grade + 4.9;
1262
+ }
1263
+ }
1264
+ }
1265
+
1266
+ $system-token: get-color-token-assignment($color-token);
1267
+ $grade: nth(decompose($system-token), 2);
1268
+ @return $grade;
1269
+ }
1270
+
1271
+ /*
1272
+ ----------------------------------------
1273
+ color()
1274
+ ----------------------------------------
1275
+ Derive a color from a color shortcode
1276
+ ----------------------------------------
1277
+ */
1278
+
1279
+ @function color($value, $flags...) {
1280
+ $value: unpack($value);
1281
+
1282
+ // Non-token colors may be passed with specific flags
1283
+ @if type-of($value) == color {
1284
+ // override or set-theme will allow any color
1285
+ @if index($flags, override) or index($flags, set-theme) {
1286
+ // override + no-warn will skip warnings
1287
+ @if index($flags, no-warn) {
1288
+ @return $value;
1289
+ }
1290
+
1291
+ @if $theme-show-compile-warnings {
1292
+ @warn 'Override: `#{$value}` is not a USWDS color token.';
1293
+ }
1294
+
1295
+ @return $value;
1296
+ }
1297
+ }
1298
+
1299
+ // False values may be passed through when setting theme colors
1300
+ @if $value == false {
1301
+ @if index($flags, set-theme) {
1302
+ @return $value;
1303
+ }
1304
+ }
1305
+
1306
+ // Now, any value should be evaluated as a token
1307
+
1308
+ $value: smart-quote($value);
1309
+
1310
+ @if map-has-key($system-color-shortcodes, $value) {
1311
+ $our-color: map-get($system-color-shortcodes, $value);
1312
+ @if $our-color == false {
1313
+ @error '`#{$value}` is a color that does not exist '
1314
+ + 'or is set to false.';
1315
+ }
1316
+ @return $our-color;
1317
+ }
1318
+
1319
+ // If we're using the theme flag, $project-color-shortcodes has not yet been set
1320
+ @if not index($flags, set-theme) {
1321
+ @if map-has-key($project-color-shortcodes, $value) {
1322
+ $our-color: (map-get($project-color-shortcodes, $value));
1323
+ @if $our-color == false {
1324
+ @error '`#{$value}` is a color that does not exist '
1325
+ + 'or is set to false.';
1326
+ }
1327
+ @return $our-color;
1328
+ }
1329
+ }
1330
+
1331
+ @error '`#{$value}` is not a valid USWDS color token. '
1332
+ + 'See designsystem.digital.gov/design-tokens/color '
1333
+ + 'for more information.';
1334
+ }
1335
+
1336
+ /*
1337
+ ----------------------------------------
1338
+ advanced-color()
1339
+ ----------------------------------------
1340
+ Derive a color from a color triplet:
1341
+ [family], [grade], [variant]
1342
+ ----------------------------------------
1343
+ */
1344
+
1345
+ // color() can have a 1, 2, or 3 arguments passed to it:
1346
+ //
1347
+ // [family]
1348
+ // ex: color('primary')
1349
+ // - the default in a theme palette family
1350
+ //
1351
+ // [family], [grade]
1352
+ // ex: color('red', 50)
1353
+ // - a standard system color
1354
+ // ex: color('accent-warm', 'light')
1355
+ // - a standard theme color
1356
+ // ex: color('primary', 'vivid')
1357
+ // - in theme colors, 'vivid' is considered a grade
1358
+ //
1359
+ // [family], [grade], [vivid]
1360
+ // ex: color('red', 50, 'vivid')
1361
+ // - a vivid system color
1362
+ // - only system colors required three arguments
1363
+
1364
+ @function advanced-color(
1365
+ $color-family: false,
1366
+ $color-grade: false,
1367
+ $color-variant: false
1368
+ ) {
1369
+ // Convert any arglists into lists
1370
+ $color-family: if(
1371
+ type-of($color-family) == "arglist",
1372
+ unpack($color-family),
1373
+ $color-family
1374
+ );
1375
+
1376
+ // If $color-family is a list, color() had a variable
1377
+ // passed to it, and args need to be re-set with the
1378
+ // values from the $color-family list:
1379
+ @if type-of($color-family) == "list" {
1380
+ @if length($color-family) > 2 {
1381
+ $color-variant: nth($color-family, 3);
1382
+ }
1383
+ $color-grade: nth($color-family, 2);
1384
+ $color-family: nth($color-family, 1);
1385
+ }
1386
+
1387
+ // Set initial state of vars
1388
+ $color-family: smart-quote($color-family);
1389
+ $color-grade: smart-quote($color-grade);
1390
+ $color-variant: smart-quote($color-variant);
1391
+
1392
+ // @debug '#{$color-family}: #{type-of($color-family)}, #{$color-grade}: #{type-of($color-grade)}, #{$color-variant}: #{type-of($color-variant)}' ;
1393
+
1394
+ // If there are no args, throw an error
1395
+ @if not $color-family {
1396
+ @error 'Include a color in the form [family], [grade], [vivid]';
1397
+ }
1398
+
1399
+ // If the grade is a number, it's a system color
1400
+ // ex: ('red', 50)
1401
+ @if type-of($color-grade) == "number" {
1402
+ @return get-system-color($color-family, $color-grade, $color-variant);
1403
+ }
1404
+
1405
+ // non-number grades are associated with non-default theme colors
1406
+ // ex: ('base', 'darker')
1407
+ // default theme colors have no grade
1408
+ // ex: ('base')
1409
+ @if map-has-key($all-project-colors, $color-family) {
1410
+ @if not
1411
+ map-has-key(map-get($all-project-colors, $color-family), $color-grade)
1412
+ {
1413
+ @error '`#{$color-grade}` is not a valid grade of `#{$color-family}`. '
1414
+ + 'Valid grades: '
1415
+ + '#{map-keys(map-get($all-project-colors, $color-family))}';
1416
+ }
1417
+ } @else {
1418
+ @error '`#{$color-family}` is not a valid theme family token. '
1419
+ + 'Valid family tokens: #{map-keys($all-project-colors)}';
1420
+ }
1421
+ @return map-deep-get($all-project-colors, $color-family, $color-grade);
1422
+ }
1423
+
1424
+ /*
1425
+ ----------------------------------------
1426
+ units()
1427
+ ----------------------------------------
1428
+ Converts a spacing unit into
1429
+ the desired final units (currently rem)
1430
+ ----------------------------------------
1431
+ */
1432
+
1433
+ @function units($value) {
1434
+ $converted: if(
1435
+ type-of($value) == "string",
1436
+ quote($value),
1437
+ number-to-token($value)
1438
+ );
1439
+
1440
+ @if not map-has-key($project-spacing-standard, $converted) {
1441
+ @error '`#{$value}` is not a valid spacing unit token. '
1442
+ + 'Valid spacing unit tokens: '
1443
+ + '#{map-keys($project-spacing-standard)}';
1444
+ }
1445
+
1446
+ @return map-get($project-spacing-standard, $converted);
1447
+ }
1448
+
1449
+ /*
1450
+ ----------------------------------------
1451
+ get-palettes()
1452
+ ----------------------------------------
1453
+ Build a single map of plugin values
1454
+ from a list of plugin keys.
1455
+ ----------------------------------------
1456
+ */
1457
+
1458
+ @function get-palettes($list) {
1459
+ $our-palettes: ();
1460
+
1461
+ @if type-of($list) == "map" {
1462
+ @error 'Use a list of strings as plugin values.';
1463
+ }
1464
+
1465
+ @each $palette in $list {
1466
+ @if not map-has-key($palette-registry, $palette) {
1467
+ @error '#{$palette} isn\'t in the registry.';
1468
+ }
1469
+
1470
+ $our-palettes: map-merge(
1471
+ $our-palettes,
1472
+ map-get($palette-registry, $palette)
1473
+ );
1474
+ }
1475
+
1476
+ @return $our-palettes;
1477
+ }
1478
+
1479
+ /*
1480
+ ----------------------------------------
1481
+ border-radius()
1482
+ ----------------------------------------
1483
+ Get a border-radius from the system
1484
+ border-radii
1485
+ ----------------------------------------
1486
+ */
1487
+
1488
+ @function border-radius($value) {
1489
+ @if map-has-key($all-border-radius, $value) {
1490
+ @return map-get($all-border-radius, $value);
1491
+ } @else {
1492
+ @error '`#{$value}` is not a valid border radius token. '
1493
+ + 'Valid tokens: #{map-keys($all-border-radius)}';
1494
+ }
1495
+ }
1496
+
1497
+ /*
1498
+ ----------------------------------------
1499
+ font-weight()
1500
+ fw()
1501
+ ----------------------------------------
1502
+ Get a font-weight value from the
1503
+ system font-weight
1504
+ ----------------------------------------
1505
+ */
1506
+
1507
+ @function font-weight($value) {
1508
+ @return get-uswds-value(font-weight, $value);
1509
+ }
1510
+
1511
+ @function fw($value) {
1512
+ @return font-weight($value);
1513
+ }
1514
+
1515
+ /*
1516
+ ----------------------------------------
1517
+ feature()
1518
+ ----------------------------------------
1519
+ Gets a valid USWDS font feature setting
1520
+ ----------------------------------------
1521
+ */
1522
+
1523
+ @function feature($value) {
1524
+ @return get-uswds-value(feature, $value);
1525
+ }
1526
+
1527
+ /*
1528
+ ----------------------------------------
1529
+ flex()
1530
+ ----------------------------------------
1531
+ Gets a valid USWDS flex value
1532
+ ----------------------------------------
1533
+ */
1534
+
1535
+ @function flex($value) {
1536
+ @return get-uswds-value(flex, $value);
1537
+ }
1538
+
1539
+ /*
1540
+ ----------------------------------------
1541
+ font-family()
1542
+ family()
1543
+ ----------------------------------------
1544
+ Get a font-family stack from a
1545
+ role-based or type-based font family
1546
+ ----------------------------------------
1547
+ */
1548
+
1549
+ @function font-family($value) {
1550
+ @return get-uswds-value(font-family, $value);
1551
+ }
1552
+
1553
+ @function ff($value) {
1554
+ @return font-family($value);
1555
+ }
1556
+
1557
+ @function family($value) {
1558
+ @return font-family($value);
1559
+ }
1560
+
1561
+ /*
1562
+ ----------------------------------------
1563
+ letter-spacing()
1564
+ ls()
1565
+ ----------------------------------------
1566
+ Get a letter-spacing value from the
1567
+ system letter-spacing
1568
+ ----------------------------------------
1569
+ */
1570
+
1571
+ @function letter-spacing($value) {
1572
+ $lh-map: map-get($system-properties, letter-spacing);
1573
+ $fn-map: map-get($lh-map, function);
1574
+ @if map-has-key($fn-map, $value) {
1575
+ @return map-get($fn-map, $value);
1576
+ }
1577
+ @if type-of($value) == "number" {
1578
+ @error '`#{$value}` is a not a valid letter-spacing token. '
1579
+ + 'Valid letter-spacing tokens: #{map-keys($fn-map)}';
1580
+ }
1581
+ @return get-uswds-value(letter-spacing, $value);
1582
+ }
1583
+
1584
+ @function ls($value) {
1585
+ @return letter-spacing($value);
1586
+ }
1587
+
1588
+ /*
1589
+ ----------------------------------------
1590
+ measure()
1591
+ ----------------------------------------
1592
+ Gets a valid USWDS reading line length
1593
+ ----------------------------------------
1594
+ */
1595
+
1596
+ @function measure($value) {
1597
+ @return get-uswds-value(measure, $value);
1598
+ }
1599
+
1600
+ /*
1601
+ ----------------------------------------
1602
+ opacity()
1603
+ ----------------------------------------
1604
+ Get an opacity from the system
1605
+ opacities
1606
+ ----------------------------------------
1607
+ */
1608
+
1609
+ @function opacity($value) {
1610
+ @return get-uswds-value(opacity, $value);
1611
+ }
1612
+
1613
+ /*
1614
+ ----------------------------------------
1615
+ order()
1616
+ ----------------------------------------
1617
+ Get an order value from the
1618
+ system orders
1619
+ ----------------------------------------
1620
+ */
1621
+
1622
+ @function order($value) {
1623
+ @return get-uswds-value(order, $value);
1624
+ }
1625
+
1626
+ /*
1627
+ ----------------------------------------
1628
+ radius()
1629
+ ----------------------------------------
1630
+ Get a border-radius value from the
1631
+ system letter-spacing
1632
+ ----------------------------------------
1633
+ */
1634
+
1635
+ @function radius($value) {
1636
+ @return get-uswds-value(border-radius, $value);
1637
+ }
1638
+
1639
+ /*
1640
+ ----------------------------------------
1641
+ font-size()
1642
+ ----------------------------------------
1643
+ Get type scale value from a [family] and
1644
+ [scale]
1645
+ ----------------------------------------
1646
+ */
1647
+
1648
+ @function font-size($family, $scale, $force: false) {
1649
+ $our-family: smart-quote($family);
1650
+ $our-scale: smart-quote($scale);
1651
+
1652
+ @if not map-has-key($project-cap-heights, $our-family) {
1653
+ @error '#{$our-family} is not a valid font family token. '
1654
+ + 'Valid tokens: #{map-keys($project-cap-heights)}';
1655
+ }
1656
+ @if not map-get($all-type-scale, $our-scale) {
1657
+ @error '`#{$our-scale}` is not a valid font scale token. '
1658
+ + 'Valid token: #{map-keys($all-type-scale)}';
1659
+ }
1660
+
1661
+ $this-cap: map-get($project-cap-heights, $our-family);
1662
+ $this-scale: map-get($all-type-scale, $our-scale);
1663
+
1664
+ @if not $force {
1665
+ @if not($this-scale and $this-cap) {
1666
+ @error 'The scale `#{$our-scale}` is disabled '
1667
+ + 'in your project\'s theme settings. '
1668
+ + 'Set its value to `true` to use this family.';
1669
+ }
1670
+ }
1671
+
1672
+ @return normalize-type-scale($this-cap, $this-scale);
1673
+ }
1674
+
1675
+ @function fs($family, $scale) {
1676
+ @return font-size($family, $scale);
1677
+ }
1678
+
1679
+ @function size($family, $scale) {
1680
+ @return font-size($family, $scale);
1681
+ }
1682
+
1683
+ /*
1684
+ ----------------------------------------
1685
+ z-index()
1686
+ z()
1687
+ ----------------------------------------
1688
+ Get a z-index value from the
1689
+ system z-index
1690
+ ----------------------------------------
1691
+ */
1692
+
1693
+ @function z-index($value) {
1694
+ @return get-uswds-value(z-index, $value);
1695
+ }
1696
+
1697
+ @function z($value) {
1698
+ @return z-index($value);
1699
+ }
1700
+
1701
+ @function get-token-from-bg(
1702
+ $bg-color,
1703
+ $preferred-text-color: "white",
1704
+ $fallback-text-color: "ink",
1705
+ $wcag-target: "AA"
1706
+ ) {
1707
+ $magic-numbers: (
1708
+ "AA": 50,
1709
+ "AAA": 70,
1710
+ "AA-large": 40,
1711
+ );
1712
+ $target-magic-number: map-get($magic-numbers, $wcag-target);
1713
+ $grade-bg: get-color-grade($bg-color);
1714
+ $grade-preferred: get-color-grade($preferred-text-color);
1715
+ $magic-num-preferred: abs($grade-bg - $grade-preferred);
1716
+ $color: false;
1717
+
1718
+ //@debug "Background grade: #{$grade-bg} | Preferred text grade: #{$grade-preferred} | Magic number: #{$magic-num-preferred} | Target: #{$target-magic-number}";
1719
+
1720
+ @if $magic-num-preferred >= $target-magic-number {
1721
+ $color: $preferred-text-color;
1722
+ } @else {
1723
+ $grade-fallback: get-color-grade($fallback-text-color);
1724
+ $magic-num-fallback: abs($grade-bg - $grade-fallback);
1725
+ $color: $fallback-text-color;
1726
+ }
1727
+
1728
+ @if not $color {
1729
+ @error "Neither '#{$preferred-text-color}' nor '#{$fallback-text-color}' have #{$wcag-target} contrast on a '#{$bg-color}' background.";
1730
+ }
1731
+
1732
+ @return $color;
1733
+ }
1734
+
1735
+ @function get-color-from-bg(
1736
+ $bg-color,
1737
+ $preferred-text-color: "white",
1738
+ $fallback-text-color: "ink",
1739
+ $wcag-target: "AA"
1740
+ ) {
1741
+ $color: get-token-from-bg(
1742
+ $bg-color,
1743
+ $preferred-text-color,
1744
+ $fallback-text-color,
1745
+ $wcag-target
1746
+ );
1747
+ @return color($color);
1748
+ }
1749
+
1750
+ @function get-link-tokens-from-bg(
1751
+ $bg-color,
1752
+ $preferred-link-color: $theme-link-color,
1753
+ $fallback-link-color: $theme-link-reverse-color,
1754
+ $wcag-target: "AA"
1755
+ ) {
1756
+ $magic-numbers: (
1757
+ "AA": 50,
1758
+ "AAA": 70,
1759
+ "AA-large": 40,
1760
+ );
1761
+ $grade-step: 10;
1762
+ $found: false;
1763
+ $decomposed: false;
1764
+
1765
+ @if $preferred-link-color == default {
1766
+ $preferred-link-color: $theme-link-color;
1767
+ }
1768
+
1769
+ $target-magic-number: map-get($magic-numbers, $wcag-target);
1770
+ $bg-grade: get-color-grade($bg-color);
1771
+ $our-color-tokens: ($preferred-link-color, $fallback-link-color);
1772
+
1773
+ $link-token: false;
1774
+ $hover-token: false;
1775
+
1776
+ @each $color-token in $our-color-tokens {
1777
+ //@debug "color token: " + $color-token;
1778
+ // If the color token is a custom color, set a $custom flag
1779
+ $custom: if(
1780
+ type-of(map-get($assignments-theme-color, $color-token)) == "color",
1781
+ true,
1782
+ false
1783
+ );
1784
+
1785
+ // Only get a link color if one has not yet been found
1786
+ @if not $found {
1787
+ $link-grade-token: get-color-grade($color-token);
1788
+ $link-grade: if($link-grade-token < 10, 0, $link-grade-token);
1789
+ $link-magic-number: abs($bg-grade - $link-grade);
1790
+ $token-darker: false;
1791
+ $token-lighter: false;
1792
+ $link-family: false;
1793
+ $link-vivid: false;
1794
+ $hover-grade: false;
1795
+ $hover-vivid: false;
1796
+
1797
+ // If the link color is custom, output theme tokens, not system tokens
1798
+ @if $custom {
1799
+ //@debug "uses custom color.";
1800
+ $custom-token: $color-token;
1801
+ $custom-token-lighter: false;
1802
+ $custom-token-darker: false;
1803
+ $custom-split: str-split($custom-token, "-");
1804
+ $custom-grade: false;
1805
+ $custom-grade-lighter: false;
1806
+ $custom-grade-darker: false;
1807
+ //@debug "custom split:" + $custom-split;
1808
+
1809
+ // set family as the first string in the split
1810
+ $custom-family: nth($custom-split, 1);
1811
+
1812
+ // ignore vivid in token calculations, treat as default
1813
+ @if index($custom-split, "vivid") {
1814
+ $custom-split: remove($custom-split, "vivid");
1815
+ }
1816
+
1817
+ // set family and grade for "accent" families, since their family includes the split character
1818
+ @if $custom-family == "accent" {
1819
+ $custom-family: $custom-family + "-" + nth($custom-split, 2);
1820
+ $custom-grade: if(
1821
+ length($custom-split) == 3,
1822
+ nth($custom-split, 3),
1823
+ "default"
1824
+ );
1825
+ } @else {
1826
+ $custom-grade: if(
1827
+ length($custom-split) == 2,
1828
+ nth($custom-split, 2),
1829
+ "default"
1830
+ );
1831
+ }
1832
+
1833
+ //@debug "custom family: " + $custom-family;
1834
+ //@debug "custom grade: " + $custom-grade;
1835
+
1836
+ $custom-family-lighter: $custom-family;
1837
+ $custom-family-darker: $custom-family;
1838
+ $custom-grade-index: index($uswds-color-theme-grades, $custom-grade);
1839
+
1840
+ // If it's the lightest grade, use "white" for the lighter family
1841
+ @if $custom-grade-index == 1 {
1842
+ $custom-family-lighter: "white";
1843
+ } @else {
1844
+ $custom-grade-lighter: nth(
1845
+ $uswds-color-theme-grades,
1846
+ ($custom-grade-index - 1)
1847
+ );
1848
+ }
1849
+ //@debug "lighter grade: " + $custom-grade-lighter;
1850
+ // If it's the darkest grade, use "black" for the lighter family
1851
+ @if $custom-grade-index == length($uswds-color-theme-grades) {
1852
+ $custom-family-darker: "black";
1853
+ } @else {
1854
+ $custom-grade-darker: nth(
1855
+ $uswds-color-theme-grades,
1856
+ ($custom-grade-index + 1)
1857
+ );
1858
+ }
1859
+ //@debug "darker grade: " + $custom-grade-darker;
1860
+
1861
+ // If any calculated grade is "default", don't output the grade
1862
+ $custom-grade-darker: if(
1863
+ $custom-grade-darker == "default",
1864
+ false,
1865
+ $custom-grade-darker
1866
+ );
1867
+ $custom-grade-lighter: if(
1868
+ $custom-grade-lighter == "default",
1869
+ false,
1870
+ $custom-grade-lighter
1871
+ );
1872
+
1873
+ // Build the custom lighter and darker tokens
1874
+ $token-darker: if(
1875
+ $custom-grade-darker,
1876
+ $custom-family + "-" + $custom-grade-darker,
1877
+ $custom-family-darker
1878
+ );
1879
+ $token-lighter: if(
1880
+ $custom-grade-lighter,
1881
+ $custom-family + "-" + $custom-grade-lighter,
1882
+ $custom-family-lighter
1883
+ );
1884
+ } @else {
1885
+ //@debug "not custom";
1886
+ $decomposed: decompose($color-token);
1887
+ }
1888
+
1889
+ @if $link-grade == 0 {
1890
+ @warn 'Tokens with grades less than 10 (including "white") aren\'t valid link color tokens, since they have no lighter hover states.';
1891
+ } @else if $link-grade == 100 {
1892
+ @warn '"black" isn\'t a valid link color token, since it has no darker hover state.';
1893
+ }
1894
+
1895
+ // Check that link meets contrast target
1896
+ @else if $link-magic-number >= $target-magic-number {
1897
+ $found: true;
1898
+ // Calculate additional link properties
1899
+
1900
+ $link-token: $color-token;
1901
+ @if not $custom {
1902
+ $link-family: nth($decomposed, 1);
1903
+ //@debug "link family: " + $link-family;
1904
+ $link-vivid: "";
1905
+ @if nth($decomposed, 3) {
1906
+ $link-vivid: "v";
1907
+ }
1908
+ }
1909
+
1910
+ // If link is darker than bg, use darker hover
1911
+ // Exclude black as it has no darker hover
1912
+ @if ($link-grade > $bg-grade) and ($link-grade != 100) {
1913
+ //@debug "Link is darker than background";
1914
+ @if $token-darker {
1915
+ //@debug "Getting darker token...";
1916
+ $hover-token: $token-darker;
1917
+ } @else {
1918
+ $hover-grade: $link-grade + $grade-step;
1919
+ $hover-vivid: if($hover-grade == 90, "", $link-vivid);
1920
+ $hover-token: if(
1921
+ $hover-grade == 100,
1922
+ "black",
1923
+ #{$link-family}-#{$hover-grade}#{$hover-vivid}
1924
+ );
1925
+ }
1926
+ }
1927
+
1928
+ // If link is lighter than bg, use lighter hover
1929
+ // Exclude white equivalents as they have no lighter hover
1930
+ @else if ($link-grade != 0) and ($link-grade != 100) {
1931
+ //@debug "Link is lighter than background";
1932
+ @if $token-lighter {
1933
+ //@debug "Getting lighter token...";
1934
+ $hover-token: $token-lighter;
1935
+ } @else {
1936
+ $hover-grade: $link-grade - $grade-step;
1937
+ $hover-token: if(
1938
+ $hover-grade == 0,
1939
+ "white",
1940
+ #{$link-family}-#{$hover-grade}#{$link-vivid}
1941
+ );
1942
+ }
1943
+ }
1944
+ }
1945
+ }
1946
+ }
1947
+
1948
+ @if not $hover-token {
1949
+ @error 'Neither "#{$preferred-link-color}" nor "#{$fallback-link-color}" can be #{$wcag-target} contrast links and hovers on a "#{$bg-color}" background.';
1950
+ }
1951
+
1952
+ //@debug "#{$link-token}, #{$hover-token}";
1953
+ @return $link-token, $hover-token;
1954
+ }