@graupl/graupl 1.0.0-alpha.8 → 1.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (347) hide show
  1. package/.github/workflows/codeql-analysis.yml +3 -3
  2. package/.husky/commit-msg +0 -1
  3. package/.husky/pre-commit +0 -1
  4. package/.stylelintignore +9 -0
  5. package/CHANGELOG.md +160 -0
  6. package/build.js +7 -0
  7. package/dist/css/base/button.css +2 -0
  8. package/dist/css/base/button.css.map +1 -0
  9. package/dist/css/base/form.css +2 -0
  10. package/dist/css/base/form.css.map +1 -0
  11. package/dist/css/base/link.css +2 -0
  12. package/dist/css/base/link.css.map +1 -0
  13. package/dist/css/base/table.css +2 -0
  14. package/dist/css/base/table.css.map +1 -0
  15. package/dist/css/base.css +2 -0
  16. package/dist/css/base.css.map +1 -0
  17. package/dist/css/component/accordion.css +2 -0
  18. package/dist/css/component/accordion.css.map +1 -0
  19. package/dist/css/component/alert.css +2 -0
  20. package/dist/css/component/alert.css.map +1 -0
  21. package/dist/css/component/card.css +2 -0
  22. package/dist/css/component/card.css.map +1 -0
  23. package/dist/css/component/carousel.css +2 -0
  24. package/dist/css/component/carousel.css.map +1 -0
  25. package/dist/{component → css/component}/input-group.css +1 -1
  26. package/dist/css/component/input-group.css.map +1 -0
  27. package/dist/css/component/menu.css +2 -0
  28. package/dist/css/component/menu.css.map +1 -0
  29. package/dist/css/component/navigation.css +2 -0
  30. package/dist/css/component/navigation.css.map +1 -0
  31. package/dist/css/component.css +2 -0
  32. package/dist/css/component.css.map +1 -0
  33. package/dist/css/graupl.css +2 -0
  34. package/dist/css/graupl.css.map +1 -0
  35. package/dist/css/init.css +2 -0
  36. package/dist/css/init.css.map +1 -0
  37. package/dist/css/layout/columns.css +2 -0
  38. package/dist/css/layout/columns.css.map +1 -0
  39. package/dist/css/layout/container.css.map +1 -0
  40. package/dist/css/layout/flex-columns.css +2 -0
  41. package/dist/css/layout/flex-columns.css.map +1 -0
  42. package/dist/css/layout.css +2 -0
  43. package/dist/css/layout.css.map +1 -0
  44. package/dist/css/normalize.css +2 -0
  45. package/dist/css/normalize.css.map +1 -0
  46. package/dist/css/state/focus.css +2 -0
  47. package/dist/css/state/focus.css.map +1 -0
  48. package/dist/css/state.css +2 -0
  49. package/dist/css/state.css.map +1 -0
  50. package/dist/css/theme/color.css +2 -0
  51. package/dist/css/theme/color.css.map +1 -0
  52. package/dist/css/theme/typography.css +2 -0
  53. package/dist/css/theme/typography.css.map +1 -0
  54. package/dist/css/theme.css +2 -0
  55. package/dist/css/theme.css.map +1 -0
  56. package/dist/css/utilities/alignment.css +2 -0
  57. package/dist/css/utilities/alignment.css.map +1 -0
  58. package/dist/{utilities/colors.css → css/utilities/color.css} +2 -2
  59. package/dist/css/utilities/color.css.map +1 -0
  60. package/dist/css/utilities/display.css +2 -0
  61. package/dist/css/utilities/display.css.map +1 -0
  62. package/dist/css/utilities/flex.css +2 -0
  63. package/dist/css/utilities/flex.css.map +1 -0
  64. package/dist/css/utilities/height.css +2 -0
  65. package/dist/css/utilities/height.css.map +1 -0
  66. package/dist/css/utilities/inset.css +2 -0
  67. package/dist/css/utilities/inset.css.map +1 -0
  68. package/dist/css/utilities/justification.css +2 -0
  69. package/dist/css/utilities/justification.css.map +1 -0
  70. package/dist/css/utilities/list.css +2 -0
  71. package/dist/css/utilities/list.css.map +1 -0
  72. package/dist/css/utilities/order.css +2 -0
  73. package/dist/css/utilities/order.css.map +1 -0
  74. package/dist/css/utilities/postion.css +2 -0
  75. package/dist/css/utilities/postion.css.map +1 -0
  76. package/dist/css/utilities/ratio.css +2 -0
  77. package/dist/css/utilities/ratio.css.map +1 -0
  78. package/dist/css/utilities/spacing.css +2 -0
  79. package/dist/css/utilities/spacing.css.map +1 -0
  80. package/dist/css/utilities/typography.css +2 -0
  81. package/dist/css/utilities/typography.css.map +1 -0
  82. package/dist/css/utilities/visibility.css +2 -0
  83. package/dist/css/utilities/visibility.css.map +1 -0
  84. package/dist/css/utilities/width.css +2 -0
  85. package/dist/css/utilities/width.css.map +1 -0
  86. package/dist/css/utilities.css +2 -0
  87. package/dist/css/utilities.css.map +1 -0
  88. package/dist/js/component/accordion.cjs.js +3 -0
  89. package/dist/js/component/accordion.esm.js +1289 -0
  90. package/dist/js/component/accordion.iife.js +3 -0
  91. package/dist/js/component/alert.cjs.js +3 -0
  92. package/dist/js/component/alert.esm.js +529 -0
  93. package/dist/js/component/alert.iife.js +3 -0
  94. package/dist/js/component/carousel.cjs.js +3 -0
  95. package/dist/js/component/carousel.esm.js +1110 -0
  96. package/dist/js/component/carousel.iife.js +3 -0
  97. package/dist/js/graupl.cjs.js +5 -0
  98. package/dist/js/graupl.esm.js +1462 -0
  99. package/dist/js/graupl.iife.js +5 -0
  100. package/docs/.vitepress/config.js +39 -12
  101. package/docs/components/alert.md +130 -0
  102. package/docs/components/button.md +84 -0
  103. package/docs/components/card.md +369 -0
  104. package/docs/components/index.md +1 -0
  105. package/docs/components/inputgroup.md +159 -0
  106. package/docs/components/menu.md +326 -0
  107. package/docs/components/navigation.md +158 -0
  108. package/docs/content.md +237 -0
  109. package/docs/defaults.md +121 -0
  110. package/docs/forms.md +79 -0
  111. package/docs/functions.md +9 -0
  112. package/docs/getting-started.md +1 -0
  113. package/docs/index.md +1 -7
  114. package/docs/introduction.md +22 -2
  115. package/docs/layout.md +200 -0
  116. package/docs/mixins.md +47 -0
  117. package/docs/state.md +67 -0
  118. package/docs/theme.md +258 -0
  119. package/docs/utilities.md +357 -0
  120. package/eslint.config.js +1 -0
  121. package/index.html +816 -327
  122. package/index.js +12 -0
  123. package/package.json +32 -41
  124. package/scss/base/button.scss +3 -0
  125. package/scss/base/form.scss +1 -1
  126. package/scss/base/link.scss +1 -1
  127. package/scss/base/table.scss +1 -1
  128. package/scss/base.scss +1 -1
  129. package/scss/component/accordion.scss +3 -0
  130. package/scss/component/alert.scss +3 -0
  131. package/scss/component/card.scss +3 -0
  132. package/scss/component/carousel.scss +3 -0
  133. package/scss/component/input-group.scss +1 -1
  134. package/scss/component/menu.scss +3 -0
  135. package/scss/component/navigation.scss +3 -0
  136. package/scss/component.scss +1 -1
  137. package/scss/graupl.scss +1 -3
  138. package/scss/init.scss +3 -0
  139. package/scss/layout/columns.scss +1 -1
  140. package/scss/layout/container.scss +1 -1
  141. package/scss/layout/flex-columns.scss +3 -0
  142. package/scss/layout.scss +1 -1
  143. package/scss/normalize.scss +3 -0
  144. package/scss/state/focus.scss +1 -1
  145. package/scss/state.scss +1 -1
  146. package/scss/theme/color.scss +1 -1
  147. package/scss/theme/typography.scss +1 -1
  148. package/scss/theme.scss +1 -1
  149. package/scss/utilities/alignment.scss +3 -0
  150. package/scss/utilities/color.scss +3 -0
  151. package/scss/utilities/display.scss +3 -0
  152. package/scss/utilities/flex.scss +3 -0
  153. package/scss/utilities/height.scss +3 -0
  154. package/scss/utilities/inset.scss +3 -0
  155. package/scss/utilities/justification.scss +3 -0
  156. package/scss/utilities/list.scss +3 -0
  157. package/scss/utilities/order.scss +3 -0
  158. package/scss/utilities/postion.scss +3 -0
  159. package/scss/utilities/ratio.scss +3 -0
  160. package/scss/utilities/spacing.scss +1 -1
  161. package/scss/utilities/typography.scss +1 -1
  162. package/scss/utilities/visibility.scss +3 -0
  163. package/scss/utilities/width.scss +3 -0
  164. package/scss/utilities.scss +1 -1
  165. package/src/js/accordion/Accordion.js +1163 -0
  166. package/src/js/accordion/AccordionItem.js +496 -0
  167. package/src/js/accordion/index.js +10 -0
  168. package/src/js/alert/Alert.js +581 -0
  169. package/src/js/alert/index.js +11 -0
  170. package/src/js/carousel/Carousel.js +1427 -0
  171. package/src/js/carousel/index.js +10 -0
  172. package/src/js/domHelpers.js +37 -0
  173. package/src/js/eventHandlers.js +39 -0
  174. package/src/js/navigation/index.js +36 -0
  175. package/src/js/storage.js +106 -0
  176. package/src/js/validate.js +225 -0
  177. package/src/scss/_defaults.scss +74 -5
  178. package/src/scss/_index.scss +4 -3
  179. package/src/scss/_init.scss +2 -2
  180. package/src/scss/_normalize.scss +197 -0
  181. package/src/scss/_variables.scss +7 -7
  182. package/src/scss/base/_index.scss +2 -1
  183. package/src/scss/base/button/_defaults.scss +60 -0
  184. package/src/scss/base/button/_index.scss +107 -0
  185. package/src/scss/base/button/_mixins.scss +166 -0
  186. package/src/scss/{component → base}/button/_variables.scss +64 -19
  187. package/src/scss/base/form/_defaults.scss +14 -4
  188. package/src/scss/base/form/_index.scss +23 -20
  189. package/src/scss/base/form/_variables.scss +14 -2
  190. package/src/scss/base/link/_defaults.scss +48 -5
  191. package/src/scss/base/link/_index.scss +111 -10
  192. package/src/scss/base/link/_variables.scss +234 -4
  193. package/src/scss/base/table/_defaults.scss +49 -4
  194. package/src/scss/base/table/_index.scss +102 -8
  195. package/src/scss/base/table/_variables.scss +75 -5
  196. package/src/scss/component/_index.scss +7 -3
  197. package/src/scss/component/accordion/_defaults.scss +40 -0
  198. package/src/scss/component/accordion/_index.scss +180 -0
  199. package/src/scss/component/accordion/_variables.scss +316 -0
  200. package/src/scss/component/alert/_defaults.scss +49 -0
  201. package/src/scss/component/alert/_index.scss +118 -0
  202. package/src/scss/component/alert/_variables.scss +173 -0
  203. package/src/scss/component/card/_defaults.scss +32 -0
  204. package/src/scss/component/card/_index.scss +178 -0
  205. package/src/scss/component/card/_variables.scss +186 -0
  206. package/src/scss/component/carousel/_defaults.scss +43 -0
  207. package/src/scss/component/carousel/_index.scss +188 -0
  208. package/src/scss/component/carousel/_variables.scss +104 -0
  209. package/src/scss/component/input-group/_defaults.scss +11 -4
  210. package/src/scss/component/input-group/_index.scss +13 -11
  211. package/src/scss/component/input-group/_variables.scss +4 -1
  212. package/src/scss/component/menu/_defaults.scss +66 -0
  213. package/src/scss/component/menu/_index.scss +305 -0
  214. package/src/scss/component/menu/_variables.scss +500 -0
  215. package/src/scss/component/navigation/_defaults.scss +29 -0
  216. package/src/scss/component/navigation/_index.scss +189 -0
  217. package/src/scss/component/navigation/_variables.scss +237 -0
  218. package/src/scss/functions/_important.scss +2 -0
  219. package/src/scss/functions/_screen.scss +30 -0
  220. package/src/scss/functions/_theme.scss +28 -7
  221. package/src/scss/layout/_index.scss +2 -1
  222. package/src/scss/layout/columns/_defaults.scss +12 -4
  223. package/src/scss/layout/columns/_index.scss +29 -7
  224. package/src/scss/layout/columns/_variables.scss +6 -2
  225. package/src/scss/layout/container/_defaults.scss +13 -4
  226. package/src/scss/layout/container/_index.scss +12 -7
  227. package/src/scss/layout/container/_variables.scss +4 -1
  228. package/src/scss/layout/flex-columns/_defaults.scss +18 -0
  229. package/src/scss/layout/flex-columns/_index.scss +80 -0
  230. package/src/scss/layout/flex-columns/_variables.scss +26 -0
  231. package/src/scss/mixins/_animation.scss +15 -0
  232. package/src/scss/mixins/_layer.scss +3 -5
  233. package/src/scss/mixins/_screen.scss +56 -0
  234. package/src/scss/mixins/_utility.scss +30 -0
  235. package/src/scss/mixins/_visually-hidden.scss +20 -0
  236. package/src/scss/state/_index.scss +1 -1
  237. package/src/scss/state/focus/_defaults.scss +6 -4
  238. package/src/scss/state/focus/_index.scss +7 -7
  239. package/src/scss/state/focus/_mixins.scss +15 -0
  240. package/src/scss/state/focus/_variables.scss +6 -2
  241. package/src/scss/theme/_index.scss +1 -1
  242. package/src/scss/theme/color/_defaults.scss +101 -19
  243. package/src/scss/theme/color/_index.scss +17 -17
  244. package/src/scss/theme/color/_variables.scss +72 -64
  245. package/src/scss/theme/typography/_defaults.scss +7 -5
  246. package/src/scss/theme/typography/_index.scss +1 -1
  247. package/src/scss/theme/typography/_variables.scss +11 -7
  248. package/src/scss/utilities/_index.scss +14 -2
  249. package/src/scss/utilities/alignment/_defaults.scss +62 -0
  250. package/src/scss/utilities/alignment/_index.scss +75 -0
  251. package/src/scss/utilities/alignment/_variables.scss +6 -0
  252. package/src/scss/utilities/color/_defaults.scss +35 -0
  253. package/src/scss/utilities/color/_index.scss +91 -0
  254. package/src/scss/utilities/color/_variables.scss +6 -0
  255. package/src/scss/utilities/display/_defaults.scss +32 -0
  256. package/src/scss/utilities/display/_index.scss +61 -0
  257. package/src/scss/utilities/display/_variables.scss +6 -0
  258. package/src/scss/utilities/flex/_defaults.scss +63 -0
  259. package/src/scss/utilities/flex/_index.scss +71 -0
  260. package/src/scss/utilities/flex/_variables.scss +6 -0
  261. package/src/scss/utilities/height/_defaults.scss +41 -0
  262. package/src/scss/utilities/height/_index.scss +98 -0
  263. package/src/scss/utilities/height/_variables.scss +6 -0
  264. package/src/scss/utilities/inset/_defaults.scss +41 -0
  265. package/src/scss/utilities/inset/_index.scss +37 -0
  266. package/src/scss/utilities/inset/_variables.scss +6 -0
  267. package/src/scss/utilities/justification/_defaults.scss +59 -0
  268. package/src/scss/utilities/justification/_index.scss +75 -0
  269. package/src/scss/utilities/justification/_variables.scss +6 -0
  270. package/src/scss/utilities/list/_defaults.scss +39 -0
  271. package/src/scss/utilities/list/_index.scss +56 -0
  272. package/src/scss/utilities/list/_variables.scss +6 -0
  273. package/src/scss/utilities/order/_defaults.scss +22 -0
  274. package/src/scss/utilities/order/_index.scss +63 -0
  275. package/src/scss/utilities/order/_variables.scss +6 -0
  276. package/src/scss/utilities/position/_defaults.scss +26 -0
  277. package/src/scss/utilities/position/_index.scss +37 -0
  278. package/src/scss/utilities/position/_variables.scss +6 -0
  279. package/src/scss/utilities/ratio/_defaults.scss +28 -0
  280. package/src/scss/utilities/ratio/_index.scss +52 -0
  281. package/src/scss/utilities/ratio/_variables.scss +9 -0
  282. package/src/scss/utilities/spacing/_defaults.scss +9 -4
  283. package/src/scss/utilities/spacing/_index.scss +134 -29
  284. package/src/scss/utilities/spacing/_variables.scss +5 -2
  285. package/src/scss/utilities/typography/_defaults.scss +29 -4
  286. package/src/scss/utilities/typography/_index.scss +155 -23
  287. package/src/scss/utilities/typography/_variables.scss +5 -2
  288. package/src/scss/utilities/visibility/_defaults.scss +25 -0
  289. package/src/scss/utilities/visibility/_index.scss +36 -0
  290. package/src/scss/utilities/visibility/_variables.scss +6 -0
  291. package/src/scss/utilities/width/_defaults.scss +41 -0
  292. package/src/scss/utilities/width/_index.scss +98 -0
  293. package/src/scss/utilities/width/_variables.scss +6 -0
  294. package/stylelint.config.js +5 -0
  295. package/vite.config.js +57 -0
  296. package/dist/base/form.css +0 -2
  297. package/dist/base/form.css.map +0 -1
  298. package/dist/base/link.css +0 -2
  299. package/dist/base/link.css.map +0 -1
  300. package/dist/base/table.css +0 -2
  301. package/dist/base/table.css.map +0 -1
  302. package/dist/base.css +0 -2
  303. package/dist/base.css.map +0 -1
  304. package/dist/component/button.css +0 -2
  305. package/dist/component/button.css.map +0 -1
  306. package/dist/component/input-group.css.map +0 -1
  307. package/dist/component/table.css +0 -2
  308. package/dist/component/table.css.map +0 -1
  309. package/dist/component.css +0 -2
  310. package/dist/component.css.map +0 -1
  311. package/dist/graupl.css +0 -2
  312. package/dist/graupl.css.map +0 -1
  313. package/dist/layout/columns.css +0 -2
  314. package/dist/layout/columns.css.map +0 -1
  315. package/dist/layout/container.css.map +0 -1
  316. package/dist/layout.css +0 -2
  317. package/dist/layout.css.map +0 -1
  318. package/dist/state/focus.css +0 -2
  319. package/dist/state/focus.css.map +0 -1
  320. package/dist/state.css +0 -2
  321. package/dist/state.css.map +0 -1
  322. package/dist/theme/color.css +0 -2
  323. package/dist/theme/color.css.map +0 -1
  324. package/dist/theme/typography.css +0 -2
  325. package/dist/theme/typography.css.map +0 -1
  326. package/dist/theme.css +0 -2
  327. package/dist/theme.css.map +0 -1
  328. package/dist/utilities/colors.css.map +0 -1
  329. package/dist/utilities/spacing.css +0 -2
  330. package/dist/utilities/spacing.css.map +0 -1
  331. package/dist/utilities/typography.css +0 -2
  332. package/dist/utilities/typography.css.map +0 -1
  333. package/dist/utilities.css +0 -2
  334. package/dist/utilities.css.map +0 -1
  335. package/scss/component/button.scss +0 -3
  336. package/scss/component/table.scss +0 -3
  337. package/scss/utilities/colors.scss +0 -3
  338. package/src/scss/component/button/_defaults.scss +0 -39
  339. package/src/scss/component/button/_index.scss +0 -98
  340. package/src/scss/component/table/_defaults.scss +0 -30
  341. package/src/scss/component/table/_index.scss +0 -77
  342. package/src/scss/component/table/_variables.scss +0 -64
  343. package/src/scss/mixins/_media-queries.scss +0 -26
  344. package/src/scss/utilities/colors/_defaults.scss +0 -5
  345. package/src/scss/utilities/colors/_index.scss +0 -22
  346. package/src/scss/utilities/colors/_variables.scss +0 -3
  347. /package/dist/{layout → css/layout}/container.css +0 -0
@@ -1,4 +1,7 @@
1
- // Variables referencing custom properties.
1
+ // @graupl/graupl color theme variables.
2
+ //
3
+ // These values are to be used to directly style components and provide a
4
+ // cleaner way to reference custom properties.
2
5
 
3
6
  @use "defaults";
4
7
  @use "../../defaults" as root-defaults;
@@ -37,85 +40,90 @@ $colors: ();
37
40
  );
38
41
  }
39
42
 
40
- // Theme properties.
41
- $theme-light: ();
42
- $theme-dark: ();
43
- $theme-active: ();
43
+ $themes: (
44
+ active: (),
45
+ );
44
46
 
45
- // Create a map for each colour theme.
46
- @each $color, $map in $colors {
47
- // Maps for the current colour theme variants.
48
- $light-map: ();
49
- $dark-map: ();
50
- $active-map: ();
47
+ // Generate all of the theme properties.
48
+ @each $theme-name, $theme-map in defaults.$theme-map {
49
+ $theme: ();
51
50
 
52
- @each $shade, $value in $map {
53
- // Get the dark shade and value.
54
- $dark-shade: map.get(defaults.$dark-map, $shade);
55
- $dark-value: map.get($map, $dark-shade);
51
+ @each $color-name, $map in $theme-map {
52
+ $color-map: ();
56
53
 
57
- // Set the custom prop names and fallback values.
58
- $light-property: var(
59
- --#{root-defaults.$prefix}-theme-light--#{$color}--#{$shade},
60
- $value
61
- );
62
- $dark-property: var(
63
- --#{root-defaults.$prefix}-theme-dark--#{$color}--#{$shade},
64
- $dark-value
65
- );
66
- $active-property: var(
67
- --#{root-defaults.$prefix}-theme-active--#{$color}--#{$shade},
68
- $light-property
69
- );
54
+ @each $shade, $value in $map {
55
+ $color-property: var(
56
+ --#{root-defaults.$prefix}-theme-#{$theme-name}--#{$color-name}--#{$shade},
57
+ #{map.get($colors, map.get($value, color), map.get($value, shade))}
58
+ );
59
+ $color-map: map.merge(
60
+ $color-map,
61
+ (
62
+ $shade: $color-property,
63
+ )
64
+ );
65
+ }
70
66
 
71
- // Add the custom props to the maps.
72
- $light-map: map.merge(
73
- $light-map,
67
+ $theme: map.merge(
68
+ $theme,
74
69
  (
75
- $shade: $light-property,
70
+ $color-name: $color-map,
76
71
  )
77
72
  );
78
- $dark-map: map.merge(
79
- $dark-map,
80
- (
81
- $shade: $dark-property,
82
- )
73
+ }
74
+
75
+ $themes: map.merge(
76
+ $themes,
77
+ (
78
+ $theme-name: $theme,
79
+ )
80
+ );
81
+ }
82
+
83
+ // Generate the active theme properties.
84
+ @each $color-name, $map in map.get($themes, defaults.$default-theme) {
85
+ $color-map: ();
86
+
87
+ @each $shade, $value in $map {
88
+ $color-property: var(
89
+ --#{root-defaults.$prefix}-theme-active--#{$color-name}--#{$shade},
90
+ #{$value}
83
91
  );
84
- $active-map: map.merge(
85
- $active-map,
92
+ $color-map: map.merge(
93
+ $color-map,
86
94
  (
87
- $shade: $active-property,
95
+ $shade: $color-property,
88
96
  )
89
97
  );
90
98
  }
91
99
 
92
- // Merge the theme maps with the existing themes.
93
- $theme-light: map.merge(
94
- $theme-light,
95
- (
96
- $color: $light-map,
97
- )
98
- );
99
- $theme-dark: map.merge(
100
- $theme-dark,
101
- (
102
- $color: $dark-map,
103
- )
104
- );
105
- $theme-active: map.merge(
106
- $theme-active,
100
+ $themes: map.merge(
101
+ $themes,
107
102
  (
108
- $color: $active-map,
103
+ active: map.merge(
104
+ map.get($themes, active),
105
+ (
106
+ $color-name: $color-map,
107
+ )
108
+ ),
109
109
  )
110
110
  );
111
111
  }
112
112
 
113
113
  // Colour properties.
114
- $root-font-color: var(
115
- --#{root-defaults.$prefix}-root-font-color,
116
- #{map.get(map.get($theme-active, primary), 900)}
117
- );
118
- $root-background: var(
119
- --#{root-defaults.$prefix}-root-background,
120
- #{map.get(map.get($theme-active, primary), 100)}
121
- );
114
+ $root-color: var(--#{root-defaults.$prefix}-root-color);
115
+ $root-background: var(--#{root-defaults.$prefix}-root-background);
116
+
117
+ @if map.has-key($themes, active, primary, 900) {
118
+ $root-color: var(
119
+ --#{root-defaults.$prefix}-root-color,
120
+ #{map.get(map.get(map.get($themes, active), primary), 900)}
121
+ );
122
+ }
123
+
124
+ @if map.has-key($themes, active, primary, 100) {
125
+ $root-background: var(
126
+ --#{root-defaults.$prefix}-root-background,
127
+ #{map.get(map.get(map.get($themes, active), primary), 100)}
128
+ );
129
+ }
@@ -1,13 +1,15 @@
1
- // Default values for Graupl.
1
+ // @graupl/graupl typography theme default values.
2
2
  //
3
- // Generally, these should not be used directly when styling components.
4
- // They are mainly used to provide default fallbacks for custom properties
5
- // which can be found in the `variables.scss` file.
3
+ // Generally, these should not be used directly when styling components unless a static value is needed.
4
+ // They are mainly used to provide class selectors, fallbacks for custom properties, or loop values.
5
+ //
6
+ // They should not be used to define direct property values (i.e. font-size, color, etc.).
7
+ // Those should be defined as custom properties in the `_variables.scss` file.
6
8
 
7
9
  @use "sass:map";
8
10
 
9
11
  // font properties.
10
- $font-size: 1rem !default;
12
+ $font-size-base: 1rem !default;
11
13
  $root-font-size: clamp(0.85rem, calc(0.8rem + 0.5vw), 1.25rem) !default;
12
14
  $line-height: 1.2em !default;
13
15
 
@@ -1,4 +1,4 @@
1
- // Typography theme styles.
1
+ // @graupl/graupl typography theme styles.
2
2
 
3
3
  @use "variables" as *;
4
4
  @use "../../mixins/layer" as *;
@@ -1,4 +1,7 @@
1
- // Variables referencing custom properties.
1
+ // @graupl/graupl typography theme variables.
2
+ //
3
+ // These values are to be used to directly style components and provide a
4
+ // cleaner way to reference custom properties.
2
5
 
3
6
  @use "defaults";
4
7
  @use "../../defaults" as root-defaults;
@@ -6,7 +9,10 @@
6
9
  @use "sass:map";
7
10
 
8
11
  // Font properties.
9
- $font-size: var(--#{root-defaults.$prefix}-font-base, #{defaults.$font-size});
12
+ $font-size-base: var(
13
+ --#{root-defaults.$prefix}-font-size-base,
14
+ #{defaults.$font-size-base}
15
+ );
10
16
  $line-height: var(
11
17
  --#{root-defaults.$prefix}-line-height,
12
18
  #{defaults.$line-height}
@@ -18,7 +24,7 @@ $font-sizes: ();
18
24
  @each $key, $value in defaults.$font-size-multipliers {
19
25
  $size: var(
20
26
  --#{root-defaults.$prefix}-font-#{$key},
21
- calc(#{$value} * #{$font-size})
27
+ calc(#{$value} * #{$font-size-base})
22
28
  );
23
29
  $font-sizes: map.set($font-sizes, $key, $size);
24
30
  }
@@ -102,10 +108,8 @@ $heading-line-height: var(
102
108
  );
103
109
  $heading-margin: var(
104
110
  --#{root-defaults.$prefix}-heading-margin,
105
- #{map.get(root-variables.$spacers, 5)} 0 #{map.get(
106
- root-variables.$spacers,
107
- 2
108
- )} 0
111
+ #{map.get(root-variables.$spacers, 5)} 0
112
+ #{map.get(root-variables.$spacers, 2)} 0
109
113
  );
110
114
  $heading-font-weight: var(
111
115
  --#{root-defaults.$prefix}-heading-font-weight,
@@ -1,5 +1,17 @@
1
- // Graupl utilities.
1
+ // @graupl/graupl utilities styles.
2
2
 
3
- @forward "colors";
3
+ @forward "alignment";
4
+ @forward "color";
5
+ @forward "display";
6
+ @forward "flex";
7
+ @forward "height";
8
+ @forward "inset";
9
+ @forward "justification";
10
+ @forward "list";
11
+ @forward "order";
12
+ @forward "position";
13
+ @forward "ratio";
4
14
  @forward "spacing";
5
15
  @forward "typography";
16
+ @forward "visibility";
17
+ @forward "width";
@@ -0,0 +1,62 @@
1
+ // @graupl/graupl alignment utilities default values.
2
+ //
3
+ // Generally, these should not be used directly when styling components unless a static value is needed.
4
+ // They are mainly used to provide class selectors, fallbacks for custom properties, or loop values.
5
+ //
6
+ // They should not be used to define direct property values (i.e. font-size, color, etc.).
7
+ // Those should be defined as custom properties in the `_variables.scss` file.
8
+
9
+ @use "sass:map";
10
+
11
+ // Align content properties.
12
+ $align-content-class-prefix: "align-content-" !default;
13
+ $base-align-content-properties: (
14
+ normal: normal,
15
+ start: flex-start,
16
+ end: flex-end,
17
+ center: center,
18
+ between: space-between,
19
+ around: space-around,
20
+ evenly: space-evenly,
21
+ baseline: baseline,
22
+ stretch: stretch,
23
+ );
24
+ $custom-align-content-properties: () !default;
25
+ $align-content-properties: map.merge(
26
+ $base-align-content-properties,
27
+ $custom-align-content-properties
28
+ );
29
+
30
+ // Align items properties.
31
+ $align-items-class-prefix: "align-items-" !default;
32
+ $base-align-items-properties: (
33
+ start: start,
34
+ end: end,
35
+ center: center,
36
+ baseline: baseline,
37
+ stretch: stretch,
38
+ );
39
+ $custom-align-items-properties: () !default;
40
+ $align-items-properties: map.merge(
41
+ $base-align-items-properties,
42
+ $custom-align-items-properties
43
+ );
44
+
45
+ // Align self properties.
46
+ $align-self-class-prefix: "align-self-" !default;
47
+ $base-align-self-properties: (
48
+ auto: auto,
49
+ start: start,
50
+ end: end,
51
+ center: center,
52
+ baseline: baseline,
53
+ stretch: stretch,
54
+ );
55
+ $custom-align-self-properties: () !default;
56
+ $align-self-properties: map.merge(
57
+ $base-align-self-properties,
58
+ $custom-align-self-properties
59
+ );
60
+
61
+ // Responsive utility flag.
62
+ $responsive: false !default;
@@ -0,0 +1,75 @@
1
+ // @graupl/graupl alignment utilities styles.
2
+ //
3
+ // Responsive class must be within their own loop to prevent specificity issues.
4
+ // This keeps responsive specificity tied to screen size before property order.
5
+
6
+ @use "../../defaults" as root-defaults;
7
+ @use "../../mixins/layer" as *;
8
+ @use "../../mixins/utility";
9
+ @use "defaults";
10
+ @use "sass:map";
11
+ @use "variables" as *;
12
+
13
+ @include layer(utilities) {
14
+ // For each align content property, create a utility class.
15
+ @each $name, $value in defaults.$align-content-properties {
16
+ @include utility.create(
17
+ ".#{defaults.$align-content-class-prefix}#{$name}",
18
+ align-content,
19
+ $value
20
+ );
21
+ }
22
+
23
+ // For each align items property, create a utility class.
24
+ @each $name, $value in defaults.$align-items-properties {
25
+ @include utility.create(
26
+ ".#{defaults.$align-items-class-prefix}#{$name}",
27
+ align-items,
28
+ $value
29
+ );
30
+ }
31
+
32
+ // For each align self property, create a utility class.
33
+ @each $name, $value in defaults.$align-self-properties {
34
+ @include utility.create(
35
+ ".#{defaults.$align-self-class-prefix}#{$name}",
36
+ align-self,
37
+ $value
38
+ );
39
+ }
40
+
41
+ // Generate responsive utilities.
42
+ @if defaults.$responsive and root-defaults.$responsive-utilities {
43
+ @each $screen-size in map.keys(root-defaults.$screen-sizes) {
44
+ // For each align content property, create a utility class.
45
+ @each $name, $value in defaults.$align-content-properties {
46
+ @include utility.create(
47
+ ".#{$screen-size}#{root-defaults.$responsive-separator}#{defaults.$align-content-class-prefix}#{$name}",
48
+ align-content,
49
+ $value,
50
+ $screen-size
51
+ );
52
+ }
53
+
54
+ // For each align items property, create a utility class.
55
+ @each $name, $value in defaults.$align-items-properties {
56
+ @include utility.create(
57
+ ".#{$screen-size}#{root-defaults.$responsive-separator}#{defaults.$align-items-class-prefix}#{$name}",
58
+ align-items,
59
+ $value,
60
+ $screen-size
61
+ );
62
+ }
63
+
64
+ // For each align self property, create a utility class.
65
+ @each $name, $value in defaults.$align-self-properties {
66
+ @include utility.create(
67
+ ".#{$screen-size}#{root-defaults.$responsive-separator}#{defaults.$align-self-class-prefix}#{$name}",
68
+ align-self,
69
+ $value,
70
+ $screen-size
71
+ );
72
+ }
73
+ }
74
+ }
75
+ }
@@ -0,0 +1,6 @@
1
+ // @graupl/graupl alignment utilities variables.
2
+ //
3
+ // These values are to be used to directly style components and provide a
4
+ // cleaner way to reference custom properties.
5
+
6
+ @use "defaults";
@@ -0,0 +1,35 @@
1
+ // @graupl/graupl color utilities default values.
2
+ //
3
+ // Generally, these should not be used directly when styling components unless a static value is needed.
4
+ // They are mainly used to provide class selectors, fallbacks for custom properties, or loop values.
5
+ //
6
+ // They should not be used to define direct property values (i.e. font-size, color, etc.).
7
+ // Those should be defined as custom properties in the `_variables.scss` file.
8
+
9
+ @use "sass:map";
10
+
11
+ // Background utility properties.
12
+ $background-class-prefix: "bg-" !default;
13
+ $base-background-properties: (
14
+ inherit: inherit,
15
+ current: currentcolor,
16
+ transparent: transparent,
17
+ );
18
+ $custom-background-properties: () !default;
19
+ $background-properties: map.merge(
20
+ $base-background-properties,
21
+ $custom-background-properties
22
+ );
23
+
24
+ // Text utility properties.
25
+ $text-class-prefix: "text-" !default;
26
+ $base-text-properties: (
27
+ inherit: inherit,
28
+ current: currentcolor,
29
+ transparent: transparent,
30
+ );
31
+ $custom-text-properties: () !default;
32
+ $text-properties: map.merge($base-text-properties, $custom-text-properties);
33
+
34
+ // Responsive utility flag.
35
+ $responsive: false !default;
@@ -0,0 +1,91 @@
1
+ // @graupl/graupl color utilities styles.
2
+ //
3
+ // Responsive class must be within their own loop to prevent specificity issues.
4
+ // This keeps responsive specificity tied to screen size before property order.
5
+
6
+ @use "../../defaults" as root-defaults;
7
+ @use "../../mixins/layer" as *;
8
+ @use "../../mixins/utility";
9
+ @use "../../theme/color/variables" as color;
10
+ @use "defaults";
11
+ @use "sass:map";
12
+ @use "variables" as *;
13
+
14
+ @include layer(utilities) {
15
+ // For each theme colour, create a utility class for background and color.
16
+ @each $color, $map in map.get(color.$themes, active) {
17
+ @each $shade, $value in $map {
18
+ $name: #{$color}-#{$shade};
19
+
20
+ @include utility.create(
21
+ ".#{defaults.$background-class-prefix}#{$name}",
22
+ background,
23
+ $value
24
+ );
25
+ @include utility.create(
26
+ ".#{defaults.$text-class-prefix}#{$name}",
27
+ color,
28
+ $value
29
+ );
30
+ }
31
+ }
32
+
33
+ // For each background property, create a utility class.
34
+ @each $name, $value in defaults.$background-properties {
35
+ $selector: ".#{defaults.$background-class-prefix}#{$name}";
36
+
37
+ @include utility.create($selector, background, $value);
38
+ }
39
+
40
+ // For each text property, create a utility class.
41
+ @each $name, $value in defaults.$text-properties {
42
+ $selector: ".#{defaults.$text-class-prefix}#{$name}";
43
+
44
+ @include utility.create($selector, color, $value);
45
+ }
46
+
47
+ // Create responsive utilities.
48
+ @if defaults.$responsive and root-defaults.$responsive-utilities {
49
+ @each $screen-size in map.keys(root-defaults.$screen-sizes) {
50
+ // For each theme colour, create a utility class for background and color.
51
+ @each $color, $map in map.get(color.$themes, active) {
52
+ @each $shade, $value in $map {
53
+ $name: #{$color}-#{$shade};
54
+
55
+ @include utility.create(
56
+ ".#{$screen-size}#{root-defaults.$responsive-separator}#{defaults.$background-class-prefix}#{$name}",
57
+ background,
58
+ $value,
59
+ $screen-size
60
+ );
61
+ @include utility.create(
62
+ ".#{$screen-size}#{root-defaults.$responsive-separator}#{defaults.$text-class-prefix}#{$name}",
63
+ color,
64
+ $value,
65
+ $screen-size
66
+ );
67
+ }
68
+ }
69
+
70
+ // For each background property, create a utility class.
71
+ @each $name, $value in defaults.$background-properties {
72
+ @include utility.create(
73
+ ".#{$screen-size}#{root-defaults.$responsive-separator}#{defaults.$background-class-prefix}#{$name}",
74
+ background,
75
+ $value,
76
+ $screen-size
77
+ );
78
+ }
79
+
80
+ // For each text property, create a utility class.
81
+ @each $name, $value in defaults.$text-properties {
82
+ @include utility.create(
83
+ ".#{$screen-size}#{root-defaults.$responsive-separator}#{defaults.$text-class-prefix}#{$name}",
84
+ color,
85
+ $value,
86
+ $screen-size
87
+ );
88
+ }
89
+ }
90
+ }
91
+ }
@@ -0,0 +1,6 @@
1
+ // @graupl/graupl color utilities variables.
2
+ //
3
+ // These values are to be used to directly style components and provide a
4
+ // cleaner way to reference custom properties.
5
+
6
+ @use "defaults";
@@ -0,0 +1,32 @@
1
+ // @graupl/graupl display utilities default values.
2
+ //
3
+ // Generally, these should not be used directly when styling components unless a static value is needed.
4
+ // They are mainly used to provide class selectors, fallbacks for custom properties, or loop values.
5
+ //
6
+ // They should not be used to define direct property values (i.e. font-size, color, etc.).
7
+ // Those should be defined as custom properties in the `_variables.scss` file.
8
+
9
+ @use "sass:map";
10
+
11
+ $display-class-prefix: "display-" !default;
12
+ $base-display-properties: (
13
+ block: block,
14
+ inline-block: inline-block,
15
+ inline: inline,
16
+ flex: flex,
17
+ inline-flex: inline-flex,
18
+ grid: grid,
19
+ inline-grid: inline-grid,
20
+ flow-root: flow-root,
21
+ none: none,
22
+ contents: contents,
23
+ list-item: list-item,
24
+ );
25
+ $custom-display-properties: () !default;
26
+ $display-properties: map.merge(
27
+ $base-display-properties,
28
+ $custom-display-properties
29
+ );
30
+ $visually-hidden-class: "visually-hidden" !default;
31
+ $visually-hidden-focusable-class: "visually-hidden-focusable" !default;
32
+ $responsive: true !default;
@@ -0,0 +1,61 @@
1
+ // @graupl/graupl display utilities styles.
2
+ //
3
+ // Responsive class must be within their own loop to prevent specificity issues.
4
+ // This keeps responsive specificity tied to screen size before property order.
5
+
6
+ @use "../../defaults" as root-defaults;
7
+ @use "../../mixins/layer" as *;
8
+ @use "../../mixins/screen";
9
+ @use "../../mixins/utility";
10
+ @use "../../mixins/visually-hidden";
11
+ @use "defaults";
12
+ @use "sass:map";
13
+ @use "variables" as *;
14
+
15
+ @include layer(utilities) {
16
+ // For each display property, create a utility class.
17
+ @each $name, $property in defaults.$display-properties {
18
+ @include utility.create(
19
+ ".#{defaults.$display-class-prefix}#{$name}",
20
+ display,
21
+ $property
22
+ );
23
+ }
24
+
25
+ // Visually hidden utility classes.
26
+ #{defaults.$visually-hidden-class} {
27
+ @include visually-hidden.apply;
28
+ }
29
+
30
+ #{defaults.$visually-hidden-focusable-class} {
31
+ @include visually-hidden.focusable;
32
+ }
33
+
34
+ // Create responsive utilities for visually hidden classes.
35
+ @if defaults.$responsive and root-defaults.$responsive-utilities {
36
+ @each $screen-size in map.keys(root-defaults.$screen-sizes) {
37
+ // For each display property, create a utility class.
38
+ @each $name, $property in defaults.$display-properties {
39
+ @include utility.create(
40
+ ".#{$screen-size}#{root-defaults.$responsive-separator}#{defaults.$display-class-prefix}#{$name}",
41
+ display,
42
+ $property,
43
+ $screen-size
44
+ );
45
+ }
46
+
47
+ // Visually hidden utility classes.
48
+ .#{$screen-size}#{root-defaults.$responsive-separator}#{defaults.$visually-hidden-class} {
49
+ @include screen.up($screen-size) {
50
+ @include visually-hidden.apply;
51
+ }
52
+ }
53
+
54
+ .#{$screen-size}#{root-defaults.$responsive-separator}#{defaults.$visually-hidden-focusable-class} {
55
+ @include screen.up($screen-size) {
56
+ @include visually-hidden.focusable;
57
+ }
58
+ }
59
+ }
60
+ }
61
+ }
@@ -0,0 +1,6 @@
1
+ // @graupl/graupl display utilities variables.
2
+ //
3
+ // These values are to be used to directly style components and provide a
4
+ // cleaner way to reference custom properties.
5
+
6
+ @use "defaults";