@graupl/graupl 1.0.0-alpha.9 → 1.0.0-beta.1

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 (350) 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/CHANGELOG.md +160 -0
  5. package/build.js +7 -0
  6. package/dist/css/base/button.css +2 -0
  7. package/dist/css/base/button.css.map +1 -0
  8. package/dist/css/base/form.css +2 -0
  9. package/dist/css/base/form.css.map +1 -0
  10. package/dist/css/base/link.css +2 -0
  11. package/dist/css/base/link.css.map +1 -0
  12. package/dist/css/base/table.css +2 -0
  13. package/dist/css/base/table.css.map +1 -0
  14. package/dist/css/base.css +2 -0
  15. package/dist/css/base.css.map +1 -0
  16. package/dist/css/component/accordion.css +2 -0
  17. package/dist/css/component/accordion.css.map +1 -0
  18. package/dist/css/component/alert.css +2 -0
  19. package/dist/css/component/alert.css.map +1 -0
  20. package/dist/css/component/card.css +2 -0
  21. package/dist/css/component/card.css.map +1 -0
  22. package/dist/css/component/carousel.css +2 -0
  23. package/dist/css/component/carousel.css.map +1 -0
  24. package/dist/css/component/input-group.css +2 -0
  25. package/dist/css/component/input-group.css.map +1 -0
  26. package/dist/css/component/menu.css +2 -0
  27. package/dist/css/component/menu.css.map +1 -0
  28. package/dist/css/component/navigation.css +2 -0
  29. package/dist/css/component/navigation.css.map +1 -0
  30. package/dist/css/component.css +2 -0
  31. package/dist/css/component.css.map +1 -0
  32. package/dist/css/graupl.css +2 -0
  33. package/dist/css/graupl.css.map +1 -0
  34. package/dist/css/init.css +2 -0
  35. package/dist/css/init.css.map +1 -0
  36. package/dist/css/layout/columns.css +2 -0
  37. package/dist/css/layout/columns.css.map +1 -0
  38. package/dist/css/layout/container.css +2 -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/css/utilities/color.css +2 -0
  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 +31 -10
  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 +75 -6
  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 +17 -17
  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/base/button/_variables.scss +176 -0
  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 +46 -37
  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 +239 -9
  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 +87 -17
  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 +170 -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 +16 -13
  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 +32 -10
  224. package/src/scss/layout/columns/_variables.scss +13 -9
  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 +14 -11
  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 +14 -10
  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 +18 -18
  244. package/src/scss/theme/color/_variables.scss +73 -65
  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 +62 -58
  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 +138 -33
  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 +0 -2
  307. package/dist/component/input-group.css.map +0 -1
  308. package/dist/component/table.css +0 -2
  309. package/dist/component/table.css.map +0 -1
  310. package/dist/component.css +0 -2
  311. package/dist/component.css.map +0 -1
  312. package/dist/graupl.css +0 -2
  313. package/dist/graupl.css.map +0 -1
  314. package/dist/layout/columns.css +0 -2
  315. package/dist/layout/columns.css.map +0 -1
  316. package/dist/layout/container.css +0 -2
  317. package/dist/layout/container.css.map +0 -1
  318. package/dist/layout.css +0 -2
  319. package/dist/layout.css.map +0 -1
  320. package/dist/state/focus.css +0 -2
  321. package/dist/state/focus.css.map +0 -1
  322. package/dist/state.css +0 -2
  323. package/dist/state.css.map +0 -1
  324. package/dist/theme/color.css +0 -2
  325. package/dist/theme/color.css.map +0 -1
  326. package/dist/theme/typography.css +0 -2
  327. package/dist/theme/typography.css.map +0 -1
  328. package/dist/theme.css +0 -2
  329. package/dist/theme.css.map +0 -1
  330. package/dist/utilities/colors.css +0 -2
  331. package/dist/utilities/colors.css.map +0 -1
  332. package/dist/utilities/spacing.css +0 -2
  333. package/dist/utilities/spacing.css.map +0 -1
  334. package/dist/utilities/typography.css +0 -2
  335. package/dist/utilities/typography.css.map +0 -1
  336. package/dist/utilities.css +0 -2
  337. package/dist/utilities.css.map +0 -1
  338. package/scss/component/button.scss +0 -3
  339. package/scss/component/table.scss +0 -3
  340. package/scss/utilities/colors.scss +0 -3
  341. package/src/scss/component/button/_defaults.scss +0 -39
  342. package/src/scss/component/button/_index.scss +0 -98
  343. package/src/scss/component/button/_variables.scss +0 -131
  344. package/src/scss/component/table/_defaults.scss +0 -30
  345. package/src/scss/component/table/_index.scss +0 -77
  346. package/src/scss/component/table/_variables.scss +0 -64
  347. package/src/scss/mixins/_media-queries.scss +0 -26
  348. package/src/scss/utilities/colors/_defaults.scss +0 -5
  349. package/src/scss/utilities/colors/_index.scss +0 -22
  350. package/src/scss/utilities/colors/_variables.scss +0 -3
@@ -1,7 +1,8 @@
1
- // Color theme styles.
1
+ // @graupl/graupl color theme styles.
2
2
 
3
3
  @use "variables" as *;
4
4
  @use "../../mixins/layer" as *;
5
+ @use "defaults";
5
6
  @use "../../defaults" as root-defaults;
6
7
  @use "sass:map";
7
8
  @use "../../functions/theme";
@@ -9,34 +10,33 @@
9
10
  @include layer(theme) {
10
11
  :root {
11
12
  background: $root-background;
12
- color: $root-font-color;
13
+ color: $root-color;
13
14
 
14
- @each $color, $map in $theme-light {
15
+ // Generate the default colour properties.
16
+ @each $color, $map in defaults.$colors {
15
17
  @each $shade, $value in $map {
16
- --#{root-defaults.$prefix}-theme-active--#{$color}--#{$shade}: #{$value};
18
+ --#{root-defaults.$prefix}#{$color}--#{$shade}: #{$value};
17
19
  }
18
20
  }
19
- }
20
21
 
21
- // Set the active theme for dark mode.
22
- .dark-mode {
23
- @each $color, $map in $theme-dark {
22
+ // Generate the active theme properties.
23
+ @each $color, $map in map.get($themes, defaults.$default-theme) {
24
24
  @each $shade, $value in $map {
25
- --#{root-defaults.$prefix}-theme-active--#{$color}--#{$shade}: #{$value};
25
+ --#{root-defaults.$prefix}theme-active--#{$color}--#{$shade}: #{$value};
26
26
  }
27
27
  }
28
-
29
- color-scheme: dark;
30
28
  }
31
29
 
32
- // Set the active theme for light mode.
33
- .light-mode {
34
- @each $color, $map in $theme-light {
35
- @each $shade, $value in $map {
36
- --#{root-defaults.$prefix}-theme-active--#{$color}--#{$shade}: #{$value};
30
+ // Generate the available theme properties.
31
+ @each $theme-name, $theme in $themes {
32
+ #{defaults.$theme-selector-prefix}#{$theme-name}#{defaults.$theme-selector-suffix} {
33
+ @each $color, $map in $theme {
34
+ @each $shade, $value in $map {
35
+ --#{root-defaults.$prefix}theme-active--#{$color}--#{$shade}: #{$value};
36
+ }
37
37
  }
38
- }
39
38
 
40
- color-scheme: light;
39
+ color-scheme: #{$theme-name};
40
+ }
41
41
  }
42
42
  }
@@ -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;
@@ -15,7 +18,7 @@ $colors: ();
15
18
  @each $shade, $value in $map {
16
19
  // Set the custom prop name and fallback value.
17
20
  $color-property: var(
18
- --#{root-defaults.$prefix}-#{$color}--#{$shade},
21
+ --#{root-defaults.$prefix}#{$color}--#{$shade},
19
22
  $value
20
23
  );
21
24
 
@@ -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,9 +9,12 @@
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
- --#{root-defaults.$prefix}-line-height,
17
+ --#{root-defaults.$prefix}line-height,
12
18
  #{defaults.$line-height}
13
19
  );
14
20
 
@@ -17,8 +23,8 @@ $font-sizes: ();
17
23
 
18
24
  @each $key, $value in defaults.$font-size-multipliers {
19
25
  $size: var(
20
- --#{root-defaults.$prefix}-font-#{$key},
21
- calc(#{$value} * #{$font-size})
26
+ --#{root-defaults.$prefix}font-#{$key},
27
+ calc(#{$value} * #{$font-size-base})
22
28
  );
23
29
  $font-sizes: map.set($font-sizes, $key, $size);
24
30
  }
@@ -26,202 +32,200 @@ $font-sizes: ();
26
32
  $font-weights: ();
27
33
 
28
34
  @each $key, $value in defaults.$font-weights {
29
- $weight: var(--#{root-defaults.$prefix}-font-weight-#{$key}, $value);
35
+ $weight: var(--#{root-defaults.$prefix}font-weight-#{$key}, $value);
30
36
  $font-weights: map.set($font-weights, $key, $weight);
31
37
  }
32
38
 
33
39
  $font-weight-bold: var(
34
- --#{root-defaults.$prefix}-font-weight-bold,
40
+ --#{root-defaults.$prefix}font-weight-bold,
35
41
  #{map.get($font-weights, bold)}
36
42
  );
37
43
 
38
44
  // Root properties.
39
45
  $root-font-family: var(
40
- --#{root-defaults.$prefix}-root-font-family,
46
+ --#{root-defaults.$prefix}root-font-family,
41
47
  #{defaults.$root-font-family}
42
48
  );
43
49
  $root-font-size: var(
44
- --#{root-defaults.$prefix}-root-font-size,
50
+ --#{root-defaults.$prefix}root-font-size,
45
51
  #{defaults.$root-font-size}
46
52
  );
47
53
 
48
54
  // Typography properties.
49
55
  $body-font-size: var(
50
- --#{root-defaults.$prefix}-body-font-size,
56
+ --#{root-defaults.$prefix}body-font-size,
51
57
  #{map.get($font-sizes, base)}
52
58
  );
53
59
  $body-line-height: var(
54
- --#{root-defaults.$prefix}-body-line-height,
60
+ --#{root-defaults.$prefix}body-line-height,
55
61
  #{$line-height}
56
62
  );
57
63
  $body-font-weight: var(
58
- --#{root-defaults.$prefix}-body-font-weight,
64
+ --#{root-defaults.$prefix}body-font-weight,
59
65
  #{map.get($font-weights, normal)}
60
66
  );
61
67
  $paragraph-font-size: var(
62
- --#{root-defaults.$prefix}-paragraph-font-size,
68
+ --#{root-defaults.$prefix}paragraph-font-size,
63
69
  #{$body-font-size}
64
70
  );
65
71
  $paragraph-line-height: var(
66
- --#{root-defaults.$prefix}-paragraph-line-height,
72
+ --#{root-defaults.$prefix}paragraph-line-height,
67
73
  #{$body-line-height}
68
74
  );
69
75
  $paragraph-margin: var(
70
- --#{root-defaults.$prefix}-paragraph-margin,
76
+ --#{root-defaults.$prefix}paragraph-margin,
71
77
  0 0 #{map.get(root-variables.$spacers, 2)} 0
72
78
  );
73
79
  $paragraph-font-weight: var(
74
- --#{root-defaults.$prefix}-paragraph-font-weight,
80
+ --#{root-defaults.$prefix}paragraph-font-weight,
75
81
  #{$body-font-weight}
76
82
  );
77
83
  $small-font-size: var(
78
- --#{root-defaults.$prefix}-small-font-size,
84
+ --#{root-defaults.$prefix}small-font-size,
79
85
  #{map.get($font-sizes, sm)}
80
86
  );
81
87
  $small-line-height: var(
82
- --#{root-defaults.$prefix}-small-line-height,
88
+ --#{root-defaults.$prefix}small-line-height,
83
89
  #{$line-height}
84
90
  );
85
91
  $small-margin: var(
86
- --#{root-defaults.$prefix}-small-margin,
92
+ --#{root-defaults.$prefix}small-margin,
87
93
  0 0 #{map.get(root-variables.$spacers, 2)} 0
88
94
  );
89
95
  $small-font-weight: var(
90
- --#{root-defaults.$prefix}-small-font-weight,
96
+ --#{root-defaults.$prefix}small-font-weight,
91
97
  #{$body-font-weight}
92
98
  );
93
99
 
94
100
  // Headings properties.
95
101
  $heading-font-family: var(
96
- --#{root-defaults.$prefix}-heading-font-family,
102
+ --#{root-defaults.$prefix}heading-font-family,
97
103
  $root-font-family
98
104
  );
99
105
  $heading-line-height: var(
100
- --#{root-defaults.$prefix}-heading-line-height,
106
+ --#{root-defaults.$prefix}heading-line-height,
101
107
  #{$line-height}
102
108
  );
103
109
  $heading-margin: var(
104
- --#{root-defaults.$prefix}-heading-margin,
105
- #{map.get(root-variables.$spacers, 5)} 0 #{map.get(
106
- root-variables.$spacers,
107
- 2
108
- )} 0
110
+ --#{root-defaults.$prefix}heading-margin,
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
- --#{root-defaults.$prefix}-heading-font-weight,
115
+ --#{root-defaults.$prefix}heading-font-weight,
112
116
  #{$font-weight-bold}
113
117
  );
114
118
 
115
119
  // H1 properties.
116
120
  $h1-font-size: var(
117
- --#{root-defaults.$prefix}-h1-font-size,
121
+ --#{root-defaults.$prefix}h1-font-size,
118
122
  #{map.get($font-sizes, 5xl)}
119
123
  );
120
124
  $h1-line-height: var(
121
- --#{root-defaults.$prefix}-h1-line-height,
125
+ --#{root-defaults.$prefix}h1-line-height,
122
126
  #{$heading-line-height}
123
127
  );
124
- $h1-margin: var(--#{root-defaults.$prefix}-h1-margin, #{$heading-margin});
128
+ $h1-margin: var(--#{root-defaults.$prefix}h1-margin, #{$heading-margin});
125
129
  $h1-font-family: var(
126
- --#{root-defaults.$prefix}-h1-font-family,
130
+ --#{root-defaults.$prefix}h1-font-family,
127
131
  $heading-font-family
128
132
  );
129
133
  $h1-font-weight: var(
130
- --#{root-defaults.$prefix}-h1-font-weight,
134
+ --#{root-defaults.$prefix}h1-font-weight,
131
135
  $heading-font-weight
132
136
  );
133
137
 
134
138
  // H2 properties.
135
139
  $h2-font-size: var(
136
- --#{root-defaults.$prefix}-h2-font-size,
140
+ --#{root-defaults.$prefix}h2-font-size,
137
141
  #{map.get($font-sizes, 4xl)}
138
142
  );
139
143
  $h2-line-height: var(
140
- --#{root-defaults.$prefix}-h2-line-height,
144
+ --#{root-defaults.$prefix}h2-line-height,
141
145
  #{$heading-line-height}
142
146
  );
143
- $h2-margin: var(--#{root-defaults.$prefix}-h2-margin, #{$heading-margin});
147
+ $h2-margin: var(--#{root-defaults.$prefix}h2-margin, #{$heading-margin});
144
148
  $h2-font-family: var(
145
- --#{root-defaults.$prefix}-h2-font-family,
149
+ --#{root-defaults.$prefix}h2-font-family,
146
150
  $heading-font-family
147
151
  );
148
152
  $h2-font-weight: var(
149
- --#{root-defaults.$prefix}-h2-font-weight,
153
+ --#{root-defaults.$prefix}h2-font-weight,
150
154
  $heading-font-weight
151
155
  );
152
156
 
153
157
  // H3 properties.
154
158
  $h3-font-size: var(
155
- --#{root-defaults.$prefix}-h3-font-size,
159
+ --#{root-defaults.$prefix}h3-font-size,
156
160
  #{map.get($font-sizes, 3xl)}
157
161
  );
158
162
  $h3-line-height: var(
159
- --#{root-defaults.$prefix}-h3-line-height,
163
+ --#{root-defaults.$prefix}h3-line-height,
160
164
  #{$heading-line-height}
161
165
  );
162
- $h3-margin: var(--#{root-defaults.$prefix}-h3-margin, #{$heading-margin});
166
+ $h3-margin: var(--#{root-defaults.$prefix}h3-margin, #{$heading-margin});
163
167
  $h3-font-family: var(
164
- --#{root-defaults.$prefix}-h3-font-family,
168
+ --#{root-defaults.$prefix}h3-font-family,
165
169
  $heading-font-family
166
170
  );
167
171
  $h3-font-weight: var(
168
- --#{root-defaults.$prefix}-h3-font-weight,
172
+ --#{root-defaults.$prefix}h3-font-weight,
169
173
  $heading-font-weight
170
174
  );
171
175
 
172
176
  // H4 properties.
173
177
  $h4-font-size: var(
174
- --#{root-defaults.$prefix}-h4-font-size,
178
+ --#{root-defaults.$prefix}h4-font-size,
175
179
  #{map.get($font-sizes, 2xl)}
176
180
  );
177
181
  $h4-line-height: var(
178
- --#{root-defaults.$prefix}-h4-line-height,
182
+ --#{root-defaults.$prefix}h4-line-height,
179
183
  #{$heading-line-height}
180
184
  );
181
- $h4-margin: var(--#{root-defaults.$prefix}-h4-margin, #{$heading-margin});
185
+ $h4-margin: var(--#{root-defaults.$prefix}h4-margin, #{$heading-margin});
182
186
  $h4-font-family: var(
183
- --#{root-defaults.$prefix}-h4-font-family,
187
+ --#{root-defaults.$prefix}h4-font-family,
184
188
  $heading-font-family
185
189
  );
186
190
  $h4-font-weight: var(
187
- --#{root-defaults.$prefix}-h4-font-weight,
191
+ --#{root-defaults.$prefix}h4-font-weight,
188
192
  $heading-font-weight
189
193
  );
190
194
 
191
195
  // H5 properties.
192
196
  $h5-font-size: var(
193
- --#{root-defaults.$prefix}-h5-font-size,
197
+ --#{root-defaults.$prefix}h5-font-size,
194
198
  #{map.get($font-sizes, xl)}
195
199
  );
196
200
  $h5-line-height: var(
197
- --#{root-defaults.$prefix}-h5-line-height,
201
+ --#{root-defaults.$prefix}h5-line-height,
198
202
  #{$heading-line-height}
199
203
  );
200
- $h5-margin: var(--#{root-defaults.$prefix}-h5-margin, #{$heading-margin});
204
+ $h5-margin: var(--#{root-defaults.$prefix}h5-margin, #{$heading-margin});
201
205
  $h5-font-family: var(
202
- --#{root-defaults.$prefix}-h5-font-family,
206
+ --#{root-defaults.$prefix}h5-font-family,
203
207
  $heading-font-family
204
208
  );
205
209
  $h5-font-weight: var(
206
- --#{root-defaults.$prefix}-h5-font-weight,
210
+ --#{root-defaults.$prefix}h5-font-weight,
207
211
  $heading-font-weight
208
212
  );
209
213
 
210
214
  // H6 properties.
211
215
  $h6-font-size: var(
212
- --#{root-defaults.$prefix}-h6-font-size,
216
+ --#{root-defaults.$prefix}h6-font-size,
213
217
  #{map.get($font-sizes, lg)}
214
218
  );
215
219
  $h6-line-height: var(
216
- --#{root-defaults.$prefix}-h6-line-height,
220
+ --#{root-defaults.$prefix}h6-line-height,
217
221
  #{$heading-line-height}
218
222
  );
219
- $h6-margin: var(--#{root-defaults.$prefix}-h6-margin, #{$heading-margin});
223
+ $h6-margin: var(--#{root-defaults.$prefix}h6-margin, #{$heading-margin});
220
224
  $h6-font-family: var(
221
- --#{root-defaults.$prefix}-h6-font-family,
225
+ --#{root-defaults.$prefix}h6-font-family,
222
226
  $heading-font-family
223
227
  );
224
228
  $h6-font-weight: var(
225
- --#{root-defaults.$prefix}-h6-font-weight,
229
+ --#{root-defaults.$prefix}h6-font-weight,
226
230
  $heading-font-weight
227
231
  );
@@ -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;