@graupl/core 1.0.0-beta.10

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 (303) hide show
  1. package/dist/css/base/button.css +2 -0
  2. package/dist/css/base/button.css.map +1 -0
  3. package/dist/css/base/form.css +2 -0
  4. package/dist/css/base/form.css.map +1 -0
  5. package/dist/css/base/link.css +2 -0
  6. package/dist/css/base/link.css.map +1 -0
  7. package/dist/css/base/table.css +2 -0
  8. package/dist/css/base/table.css.map +1 -0
  9. package/dist/css/base.css +2 -0
  10. package/dist/css/base.css.map +1 -0
  11. package/dist/css/component/accordion.css +5 -0
  12. package/dist/css/component/accordion.css.map +1 -0
  13. package/dist/css/component/alert.css +2 -0
  14. package/dist/css/component/alert.css.map +1 -0
  15. package/dist/css/component/card.css +2 -0
  16. package/dist/css/component/card.css.map +1 -0
  17. package/dist/css/component/carousel.css +2 -0
  18. package/dist/css/component/carousel.css.map +1 -0
  19. package/dist/css/component/input-group.css +2 -0
  20. package/dist/css/component/input-group.css.map +1 -0
  21. package/dist/css/component/list.css +2 -0
  22. package/dist/css/component/list.css.map +1 -0
  23. package/dist/css/component/menu.css +2 -0
  24. package/dist/css/component/menu.css.map +1 -0
  25. package/dist/css/component/navigation.css +2 -0
  26. package/dist/css/component/navigation.css.map +1 -0
  27. package/dist/css/component.css +5 -0
  28. package/dist/css/component.css.map +1 -0
  29. package/dist/css/graupl.css +5 -0
  30. package/dist/css/graupl.css.map +1 -0
  31. package/dist/css/init.css +2 -0
  32. package/dist/css/init.css.map +1 -0
  33. package/dist/css/layout/columns.css +2 -0
  34. package/dist/css/layout/columns.css.map +1 -0
  35. package/dist/css/layout/container.css +2 -0
  36. package/dist/css/layout/container.css.map +1 -0
  37. package/dist/css/layout/flex-columns.css +2 -0
  38. package/dist/css/layout/flex-columns.css.map +1 -0
  39. package/dist/css/layout.css +5 -0
  40. package/dist/css/layout.css.map +1 -0
  41. package/dist/css/normalize.css +2 -0
  42. package/dist/css/normalize.css.map +1 -0
  43. package/dist/css/state/focus.css +2 -0
  44. package/dist/css/state/focus.css.map +1 -0
  45. package/dist/css/state.css +2 -0
  46. package/dist/css/state.css.map +1 -0
  47. package/dist/css/theme/color.css +2 -0
  48. package/dist/css/theme/color.css.map +1 -0
  49. package/dist/css/theme/typography.css +2 -0
  50. package/dist/css/theme/typography.css.map +1 -0
  51. package/dist/css/theme.css +2 -0
  52. package/dist/css/theme.css.map +1 -0
  53. package/dist/css/utilities/alignment.css +2 -0
  54. package/dist/css/utilities/alignment.css.map +1 -0
  55. package/dist/css/utilities/background.css +2 -0
  56. package/dist/css/utilities/background.css.map +1 -0
  57. package/dist/css/utilities/border.css +2 -0
  58. package/dist/css/utilities/border.css.map +1 -0
  59. package/dist/css/utilities/color.css +2 -0
  60. package/dist/css/utilities/color.css.map +1 -0
  61. package/dist/css/utilities/container.css +2 -0
  62. package/dist/css/utilities/container.css.map +1 -0
  63. package/dist/css/utilities/display.css +2 -0
  64. package/dist/css/utilities/display.css.map +1 -0
  65. package/dist/css/utilities/flex.css +2 -0
  66. package/dist/css/utilities/flex.css.map +1 -0
  67. package/dist/css/utilities/gradient.css +2 -0
  68. package/dist/css/utilities/gradient.css.map +1 -0
  69. package/dist/css/utilities/height.css +2 -0
  70. package/dist/css/utilities/height.css.map +1 -0
  71. package/dist/css/utilities/inset.css +2 -0
  72. package/dist/css/utilities/inset.css.map +1 -0
  73. package/dist/css/utilities/justification.css +2 -0
  74. package/dist/css/utilities/justification.css.map +1 -0
  75. package/dist/css/utilities/list.css +2 -0
  76. package/dist/css/utilities/list.css.map +1 -0
  77. package/dist/css/utilities/order.css +2 -0
  78. package/dist/css/utilities/order.css.map +1 -0
  79. package/dist/css/utilities/position.css +2 -0
  80. package/dist/css/utilities/position.css.map +1 -0
  81. package/dist/css/utilities/ratio.css +2 -0
  82. package/dist/css/utilities/ratio.css.map +1 -0
  83. package/dist/css/utilities/spacing.css +2 -0
  84. package/dist/css/utilities/spacing.css.map +1 -0
  85. package/dist/css/utilities/typography.css +2 -0
  86. package/dist/css/utilities/typography.css.map +1 -0
  87. package/dist/css/utilities/visibility.css +2 -0
  88. package/dist/css/utilities/visibility.css.map +1 -0
  89. package/dist/css/utilities/visually-hidden.css +2 -0
  90. package/dist/css/utilities/visually-hidden.css.map +1 -0
  91. package/dist/css/utilities/width.css +2 -0
  92. package/dist/css/utilities/width.css.map +1 -0
  93. package/dist/css/utilities/z-index.css +2 -0
  94. package/dist/css/utilities/z-index.css.map +1 -0
  95. package/dist/css/utilities.css +2 -0
  96. package/dist/css/utilities.css.map +1 -0
  97. package/package.json +58 -0
  98. package/scss/base/button.scss +3 -0
  99. package/scss/base/form.scss +3 -0
  100. package/scss/base/link.scss +3 -0
  101. package/scss/base/table.scss +3 -0
  102. package/scss/base.scss +3 -0
  103. package/scss/component/accordion.scss +3 -0
  104. package/scss/component/alert.scss +3 -0
  105. package/scss/component/card.scss +3 -0
  106. package/scss/component/carousel.scss +3 -0
  107. package/scss/component/input-group.scss +3 -0
  108. package/scss/component/list.scss +3 -0
  109. package/scss/component/menu.scss +3 -0
  110. package/scss/component/navigation.scss +3 -0
  111. package/scss/component.scss +3 -0
  112. package/scss/graupl.scss +3 -0
  113. package/scss/init.scss +3 -0
  114. package/scss/layout/columns.scss +3 -0
  115. package/scss/layout/container.scss +3 -0
  116. package/scss/layout/flex-columns.scss +3 -0
  117. package/scss/layout.scss +3 -0
  118. package/scss/normalize.scss +3 -0
  119. package/scss/state/focus.scss +3 -0
  120. package/scss/state.scss +3 -0
  121. package/scss/theme/color.scss +3 -0
  122. package/scss/theme/typography.scss +3 -0
  123. package/scss/theme.scss +3 -0
  124. package/scss/utilities/alignment.scss +3 -0
  125. package/scss/utilities/background.scss +3 -0
  126. package/scss/utilities/border.scss +3 -0
  127. package/scss/utilities/color.scss +3 -0
  128. package/scss/utilities/container.scss +3 -0
  129. package/scss/utilities/display.scss +3 -0
  130. package/scss/utilities/flex.scss +3 -0
  131. package/scss/utilities/gradient.scss +3 -0
  132. package/scss/utilities/height.scss +3 -0
  133. package/scss/utilities/inset.scss +3 -0
  134. package/scss/utilities/justification.scss +3 -0
  135. package/scss/utilities/list.scss +3 -0
  136. package/scss/utilities/order.scss +3 -0
  137. package/scss/utilities/position.scss +3 -0
  138. package/scss/utilities/ratio.scss +3 -0
  139. package/scss/utilities/spacing.scss +3 -0
  140. package/scss/utilities/typography.scss +3 -0
  141. package/scss/utilities/visibility.scss +3 -0
  142. package/scss/utilities/visually-hidden.scss +3 -0
  143. package/scss/utilities/width.scss +3 -0
  144. package/scss/utilities/z-index.scss +3 -0
  145. package/scss/utilities.scss +3 -0
  146. package/src/js/accordion/Accordion.js +1163 -0
  147. package/src/js/accordion/AccordionItem.js +496 -0
  148. package/src/js/accordion/index.js +10 -0
  149. package/src/js/alert/Alert.js +581 -0
  150. package/src/js/alert/index.js +11 -0
  151. package/src/js/carousel/Carousel.js +1427 -0
  152. package/src/js/carousel/index.js +10 -0
  153. package/src/js/domHelpers.js +37 -0
  154. package/src/js/eventHandlers.js +39 -0
  155. package/src/js/navigation/index.js +36 -0
  156. package/src/js/storage.js +106 -0
  157. package/src/js/validate.js +225 -0
  158. package/src/scss/_defaults.scss +184 -0
  159. package/src/scss/_index.scss +15 -0
  160. package/src/scss/_init.scss +6 -0
  161. package/src/scss/_normalize.scss +197 -0
  162. package/src/scss/_variables.scss +95 -0
  163. package/src/scss/base/_index.scss +6 -0
  164. package/src/scss/base/button/_defaults.scss +49 -0
  165. package/src/scss/base/button/_index.scss +206 -0
  166. package/src/scss/base/button/_mixins.scss +104 -0
  167. package/src/scss/base/button/_variables.scss +252 -0
  168. package/src/scss/base/form/_defaults.scss +24 -0
  169. package/src/scss/base/form/_index.scss +227 -0
  170. package/src/scss/base/form/_variables.scss +245 -0
  171. package/src/scss/base/link/_defaults.scss +35 -0
  172. package/src/scss/base/link/_index.scss +245 -0
  173. package/src/scss/base/link/_variables.scss +370 -0
  174. package/src/scss/base/table/_defaults.scss +68 -0
  175. package/src/scss/base/table/_index.scss +314 -0
  176. package/src/scss/base/table/_variables.scss +309 -0
  177. package/src/scss/component/_index.scss +10 -0
  178. package/src/scss/component/accordion/_defaults.scss +40 -0
  179. package/src/scss/component/accordion/_index.scss +198 -0
  180. package/src/scss/component/accordion/_variables.scss +356 -0
  181. package/src/scss/component/alert/_defaults.scss +49 -0
  182. package/src/scss/component/alert/_index.scss +119 -0
  183. package/src/scss/component/alert/_variables.scss +200 -0
  184. package/src/scss/component/card/_defaults.scss +32 -0
  185. package/src/scss/component/card/_index.scss +212 -0
  186. package/src/scss/component/card/_variables.scss +216 -0
  187. package/src/scss/component/carousel/_defaults.scss +43 -0
  188. package/src/scss/component/carousel/_index.scss +192 -0
  189. package/src/scss/component/carousel/_variables.scss +104 -0
  190. package/src/scss/component/input-group/_defaults.scss +30 -0
  191. package/src/scss/component/input-group/_index.scss +47 -0
  192. package/src/scss/component/input-group/_variables.scss +66 -0
  193. package/src/scss/component/list/_defaults.scss +15 -0
  194. package/src/scss/component/list/_index.scss +52 -0
  195. package/src/scss/component/list/_variables.scss +236 -0
  196. package/src/scss/component/menu/_defaults.scss +57 -0
  197. package/src/scss/component/menu/_index.scss +308 -0
  198. package/src/scss/component/menu/_variables.scss +642 -0
  199. package/src/scss/component/navigation/_defaults.scss +23 -0
  200. package/src/scss/component/navigation/_index.scss +190 -0
  201. package/src/scss/component/navigation/_variables.scss +290 -0
  202. package/src/scss/functions/_container.scss +38 -0
  203. package/src/scss/functions/_important.scss +36 -0
  204. package/src/scss/functions/_screen.scss +38 -0
  205. package/src/scss/functions/_theme.scss +39 -0
  206. package/src/scss/functions/_utility.scss +28 -0
  207. package/src/scss/layout/_index.scss +5 -0
  208. package/src/scss/layout/columns/_defaults.scss +24 -0
  209. package/src/scss/layout/columns/_index.scss +137 -0
  210. package/src/scss/layout/columns/_variables.scss +55 -0
  211. package/src/scss/layout/container/_defaults.scss +35 -0
  212. package/src/scss/layout/container/_index.scss +628 -0
  213. package/src/scss/layout/container/_variables.scss +114 -0
  214. package/src/scss/layout/flex-columns/_defaults.scss +28 -0
  215. package/src/scss/layout/flex-columns/_index.scss +184 -0
  216. package/src/scss/layout/flex-columns/_variables.scss +30 -0
  217. package/src/scss/mixins/_animation.scss +15 -0
  218. package/src/scss/mixins/_container.scss +80 -0
  219. package/src/scss/mixins/_layer.scss +16 -0
  220. package/src/scss/mixins/_screen.scss +77 -0
  221. package/src/scss/mixins/_state.scss +18 -0
  222. package/src/scss/mixins/_theme.scss +15 -0
  223. package/src/scss/mixins/_utility.scss +185 -0
  224. package/src/scss/mixins/_visually-hidden.scss +30 -0
  225. package/src/scss/state/_index.scss +3 -0
  226. package/src/scss/state/focus/_defaults.scss +9 -0
  227. package/src/scss/state/focus/_index.scss +42 -0
  228. package/src/scss/state/focus/_mixins.scss +13 -0
  229. package/src/scss/state/focus/_variables.scss +50 -0
  230. package/src/scss/theme/_index.scss +4 -0
  231. package/src/scss/theme/color/_defaults.scss +143 -0
  232. package/src/scss/theme/color/_index.scss +42 -0
  233. package/src/scss/theme/color/_variables.scss +133 -0
  234. package/src/scss/theme/typography/_defaults.scss +54 -0
  235. package/src/scss/theme/typography/_index.scss +120 -0
  236. package/src/scss/theme/typography/_variables.scss +248 -0
  237. package/src/scss/utilities/_index.scss +23 -0
  238. package/src/scss/utilities/_template/_defaults.scss +41 -0
  239. package/src/scss/utilities/_template/_index.scss +171 -0
  240. package/src/scss/utilities/_template/_variables.scss +6 -0
  241. package/src/scss/utilities/alignment/_defaults.scss +76 -0
  242. package/src/scss/utilities/alignment/_index.scss +336 -0
  243. package/src/scss/utilities/alignment/_variables.scss +6 -0
  244. package/src/scss/utilities/background/_defaults.scss +122 -0
  245. package/src/scss/utilities/background/_index.scss +634 -0
  246. package/src/scss/utilities/background/_variables.scss +6 -0
  247. package/src/scss/utilities/border/_defaults.scss +73 -0
  248. package/src/scss/utilities/border/_index.scss +558 -0
  249. package/src/scss/utilities/border/_variables.scss +6 -0
  250. package/src/scss/utilities/color/_defaults.scss +49 -0
  251. package/src/scss/utilities/color/_index.scss +469 -0
  252. package/src/scss/utilities/color/_variables.scss +6 -0
  253. package/src/scss/utilities/container/_defaults.scss +40 -0
  254. package/src/scss/utilities/container/_index.scss +174 -0
  255. package/src/scss/utilities/container/_variables.scss +6 -0
  256. package/src/scss/utilities/display/_defaults.scss +47 -0
  257. package/src/scss/utilities/display/_index.scss +184 -0
  258. package/src/scss/utilities/display/_variables.scss +6 -0
  259. package/src/scss/utilities/flex/_defaults.scss +99 -0
  260. package/src/scss/utilities/flex/_index.scss +486 -0
  261. package/src/scss/utilities/flex/_variables.scss +6 -0
  262. package/src/scss/utilities/gradient/_defaults.scss +70 -0
  263. package/src/scss/utilities/gradient/_index.scss +696 -0
  264. package/src/scss/utilities/gradient/_variables.scss +29 -0
  265. package/src/scss/utilities/height/_defaults.scss +54 -0
  266. package/src/scss/utilities/height/_index.scss +525 -0
  267. package/src/scss/utilities/height/_variables.scss +6 -0
  268. package/src/scss/utilities/inset/_defaults.scss +55 -0
  269. package/src/scss/utilities/inset/_index.scss +258 -0
  270. package/src/scss/utilities/inset/_variables.scss +6 -0
  271. package/src/scss/utilities/justification/_defaults.scss +73 -0
  272. package/src/scss/utilities/justification/_index.scss +333 -0
  273. package/src/scss/utilities/justification/_variables.scss +6 -0
  274. package/src/scss/utilities/list/_defaults.scss +53 -0
  275. package/src/scss/utilities/list/_index.scss +253 -0
  276. package/src/scss/utilities/list/_variables.scss +6 -0
  277. package/src/scss/utilities/order/_defaults.scss +36 -0
  278. package/src/scss/utilities/order/_index.scss +246 -0
  279. package/src/scss/utilities/order/_variables.scss +6 -0
  280. package/src/scss/utilities/position/_defaults.scss +41 -0
  281. package/src/scss/utilities/position/_index.scss +178 -0
  282. package/src/scss/utilities/position/_variables.scss +6 -0
  283. package/src/scss/utilities/ratio/_defaults.scss +42 -0
  284. package/src/scss/utilities/ratio/_index.scss +188 -0
  285. package/src/scss/utilities/ratio/_variables.scss +9 -0
  286. package/src/scss/utilities/spacing/_defaults.scss +64 -0
  287. package/src/scss/utilities/spacing/_index.scss +970 -0
  288. package/src/scss/utilities/spacing/_variables.scss +6 -0
  289. package/src/scss/utilities/typography/_defaults.scss +58 -0
  290. package/src/scss/utilities/typography/_index.scss +1089 -0
  291. package/src/scss/utilities/typography/_variables.scss +6 -0
  292. package/src/scss/utilities/visibility/_defaults.scss +39 -0
  293. package/src/scss/utilities/visibility/_index.scss +173 -0
  294. package/src/scss/utilities/visibility/_variables.scss +6 -0
  295. package/src/scss/utilities/visually-hidden/_defaults.scss +29 -0
  296. package/src/scss/utilities/visually-hidden/_index.scss +189 -0
  297. package/src/scss/utilities/visually-hidden/_variables.scss +6 -0
  298. package/src/scss/utilities/width/_defaults.scss +54 -0
  299. package/src/scss/utilities/width/_index.scss +525 -0
  300. package/src/scss/utilities/width/_variables.scss +6 -0
  301. package/src/scss/utilities/z-index/_defaults.scss +40 -0
  302. package/src/scss/utilities/z-index/_index.scss +173 -0
  303. package/src/scss/utilities/z-index/_variables.scss +6 -0
@@ -0,0 +1,54 @@
1
+ // @graupl/core typography theme 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
+ // font properties.
12
+ $font-size-base: 1rem !default;
13
+ $root-font-size: clamp(0.85rem, calc(0.8rem + 0.5vw), 1.25rem) !default;
14
+ $line-height: 1.2em !default;
15
+
16
+ // Multipliers for font sizes.
17
+ // This uses a minor third scale.
18
+ // See: https://typescale.com/?size=16&scale=1.250&text=A%20Visual%20Type%20Scale&font=Lato&fontweight=400&bodyfont=body_font_default&bodyfontweight=400&lineheight=1.75&backgroundcolor=%23ffffff&fontcolor=%23000000
19
+ $base-font-size-multipliers: (
20
+ xs: 0.694,
21
+ sm: 0.833,
22
+ base: 1,
23
+ lg: 1.2,
24
+ xl: 1.44,
25
+ 2xl: 1.728,
26
+ 3xl: 2.074,
27
+ 4xl: 2.488,
28
+ 5xl: 2.986,
29
+ );
30
+ $custom-font-size-multipliers: () !default;
31
+ $font-size-multipliers: map.merge(
32
+ $base-font-size-multipliers,
33
+ $custom-font-size-multipliers
34
+ );
35
+
36
+ // Weights.
37
+ $base-font-weights: (
38
+ light: 300,
39
+ normal: 400,
40
+ bold: 700,
41
+ );
42
+ $custom-font-weights: () !default;
43
+ $font-weights: map.merge($base-font-weights, $custom-font-weights);
44
+
45
+ /* stylelint-disable-next-line scss/dollar-variable-colon-space-after */
46
+ $root-font-family:
47
+ system-ui,
48
+ -apple-system,
49
+ blinkmacsystemfont,
50
+ "Segoe UI",
51
+ roboto,
52
+ "Helvetica Neue",
53
+ arial,
54
+ sans-serif !default;
@@ -0,0 +1,120 @@
1
+ // @graupl/core typography theme styles.
2
+
3
+ @use "variables" as *;
4
+ @use "../../mixins/layer" as *;
5
+ @use "sass:map";
6
+
7
+ @include layer(base) {
8
+ p {
9
+ margin: $paragraph-margin;
10
+ }
11
+
12
+ small {
13
+ margin: $small-margin;
14
+ }
15
+
16
+ h1 {
17
+ margin: $h1-margin;
18
+ }
19
+
20
+ h2 {
21
+ margin: $h2-margin;
22
+ }
23
+
24
+ h3 {
25
+ margin: $h3-margin;
26
+ }
27
+
28
+ h4 {
29
+ margin: $h4-margin;
30
+ }
31
+
32
+ h5 {
33
+ margin: $h5-margin;
34
+ }
35
+
36
+ h6 {
37
+ margin: $h6-margin;
38
+ }
39
+ }
40
+
41
+ @include layer(theme) {
42
+ :root {
43
+ font-family: $root-font-family;
44
+ font-size: $root-font-size;
45
+ }
46
+
47
+ b,
48
+ strong {
49
+ font-weight: $font-weight-bold;
50
+ }
51
+
52
+ body {
53
+ color: $body-color;
54
+ font-size: $body-font-size;
55
+ font-weight: $body-font-weight;
56
+ line-height: $body-line-height;
57
+ }
58
+
59
+ p {
60
+ color: $paragraph-color;
61
+ font-size: $paragraph-font-size;
62
+ font-weight: $paragraph-font-weight;
63
+ line-height: $paragraph-line-height;
64
+ }
65
+
66
+ small {
67
+ color: $small-color;
68
+ font-size: $small-font-size;
69
+ font-weight: $small-font-weight;
70
+ line-height: $small-line-height;
71
+ }
72
+
73
+ h1 {
74
+ color: $h1-color;
75
+ font-family: $h1-font-family;
76
+ font-size: $h1-font-size;
77
+ font-weight: $h1-font-weight;
78
+ line-height: $h1-line-height;
79
+ }
80
+
81
+ h2 {
82
+ color: $h2-color;
83
+ font-family: $h2-font-family;
84
+ font-size: $h2-font-size;
85
+ font-weight: $h2-font-weight;
86
+ line-height: $h2-line-height;
87
+ }
88
+
89
+ h3 {
90
+ color: $h3-color;
91
+ font-family: $h3-font-family;
92
+ font-size: $h3-font-size;
93
+ font-weight: $h3-font-weight;
94
+ line-height: $h3-line-height;
95
+ }
96
+
97
+ h4 {
98
+ color: $h4-color;
99
+ font-family: $h4-font-family;
100
+ font-size: $h4-font-size;
101
+ font-weight: $h4-font-weight;
102
+ line-height: $h4-line-height;
103
+ }
104
+
105
+ h5 {
106
+ color: $h5-color;
107
+ font-family: $h5-font-family;
108
+ font-size: $h5-font-size;
109
+ font-weight: $h5-font-weight;
110
+ line-height: $h5-line-height;
111
+ }
112
+
113
+ h6 {
114
+ color: $h6-color;
115
+ font-family: $h6-font-family;
116
+ font-size: $h6-font-size;
117
+ font-weight: $h6-font-weight;
118
+ line-height: $h6-line-height;
119
+ }
120
+ }
@@ -0,0 +1,248 @@
1
+ // @graupl/core 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.
5
+
6
+ @use "../../defaults" as root-defaults;
7
+ @use "../../variables" as root-variables;
8
+ @use "../color/variables" as color-variables;
9
+ @use "defaults";
10
+ @use "sass:map";
11
+
12
+ // Font properties.
13
+ $font-size-base: var(
14
+ --#{root-defaults.$prefix}font-size-base,
15
+ #{defaults.$font-size-base}
16
+ );
17
+ $line-height: var(
18
+ --#{root-defaults.$prefix}line-height,
19
+ #{defaults.$line-height}
20
+ );
21
+
22
+ // Generate all of the font-size-x custom properties.
23
+ $font-sizes: ();
24
+
25
+ @each $key, $value in defaults.$font-size-multipliers {
26
+ $size: var(
27
+ --#{root-defaults.$prefix}font-#{$key},
28
+ calc(#{$value} * #{$font-size-base})
29
+ );
30
+ $font-sizes: map.set($font-sizes, $key, $size);
31
+ }
32
+
33
+ $font-weights: ();
34
+
35
+ @each $key, $value in defaults.$font-weights {
36
+ $weight: var(--#{root-defaults.$prefix}font-weight-#{$key}, $value);
37
+ $font-weights: map.set($font-weights, $key, $weight);
38
+ }
39
+
40
+ $font-weight-bold: var(
41
+ --#{root-defaults.$prefix}font-weight-bold,
42
+ #{map.get($font-weights, bold)}
43
+ );
44
+
45
+ // Root properties.
46
+ $root-font-family: var(
47
+ --#{root-defaults.$prefix}root-font-family,
48
+ #{defaults.$root-font-family}
49
+ );
50
+ $root-font-size: var(
51
+ --#{root-defaults.$prefix}root-font-size,
52
+ #{defaults.$root-font-size}
53
+ );
54
+
55
+ // Typography properties.
56
+ $body-font-size: var(
57
+ --#{root-defaults.$prefix}body-font-size,
58
+ #{map.get($font-sizes, base)}
59
+ );
60
+ $body-line-height: var(
61
+ --#{root-defaults.$prefix}body-line-height,
62
+ #{$line-height}
63
+ );
64
+ $body-font-weight: var(
65
+ --#{root-defaults.$prefix}body-font-weight,
66
+ #{map.get($font-weights, normal)}
67
+ );
68
+ $body-color: var(
69
+ --#{root-defaults.$prefix}body-color,
70
+ #{color-variables.$color}
71
+ );
72
+ $paragraph-font-size: var(
73
+ --#{root-defaults.$prefix}paragraph-font-size,
74
+ #{$body-font-size}
75
+ );
76
+ $paragraph-line-height: var(
77
+ --#{root-defaults.$prefix}paragraph-line-height,
78
+ #{$body-line-height}
79
+ );
80
+ $paragraph-margin: var(
81
+ --#{root-defaults.$prefix}paragraph-margin,
82
+ 0 0 #{map.get(root-variables.$spacers, 2)} 0
83
+ );
84
+ $paragraph-font-weight: var(
85
+ --#{root-defaults.$prefix}paragraph-font-weight,
86
+ #{$body-font-weight}
87
+ );
88
+ $paragraph-color: var(
89
+ --#{root-defaults.$prefix}paragraph-color,
90
+ #{$body-color}
91
+ );
92
+ $small-font-size: var(
93
+ --#{root-defaults.$prefix}small-font-size,
94
+ #{map.get($font-sizes, sm)}
95
+ );
96
+ $small-line-height: var(
97
+ --#{root-defaults.$prefix}small-line-height,
98
+ #{$line-height}
99
+ );
100
+ $small-margin: var(
101
+ --#{root-defaults.$prefix}small-margin,
102
+ 0 0 #{map.get(root-variables.$spacers, 2)} 0
103
+ );
104
+ $small-font-weight: var(
105
+ --#{root-defaults.$prefix}small-font-weight,
106
+ #{$body-font-weight}
107
+ );
108
+ $small-color: var(--#{root-defaults.$prefix}small-color, #{$body-color});
109
+
110
+ // Headings properties.
111
+ $heading-font-family: var(
112
+ --#{root-defaults.$prefix}heading-font-family,
113
+ $root-font-family
114
+ );
115
+ $heading-line-height: var(
116
+ --#{root-defaults.$prefix}heading-line-height,
117
+ #{$line-height}
118
+ );
119
+ $heading-margin: var(
120
+ --#{root-defaults.$prefix}heading-margin,
121
+ #{map.get(root-variables.$spacers, 5)} 0
122
+ #{map.get(root-variables.$spacers, 2)} 0
123
+ );
124
+ $heading-font-weight: var(
125
+ --#{root-defaults.$prefix}heading-font-weight,
126
+ #{$font-weight-bold}
127
+ );
128
+ $heading-color: var(--#{root-defaults.$prefix}heading-color, #{$body-color});
129
+
130
+ // H1 properties.
131
+ $h1-font-size: var(
132
+ --#{root-defaults.$prefix}h1-font-size,
133
+ #{map.get($font-sizes, 5xl)}
134
+ );
135
+ $h1-line-height: var(
136
+ --#{root-defaults.$prefix}h1-line-height,
137
+ #{$heading-line-height}
138
+ );
139
+ $h1-margin: var(--#{root-defaults.$prefix}h1-margin, #{$heading-margin});
140
+ $h1-font-family: var(
141
+ --#{root-defaults.$prefix}h1-font-family,
142
+ $heading-font-family
143
+ );
144
+ $h1-font-weight: var(
145
+ --#{root-defaults.$prefix}h1-font-weight,
146
+ $heading-font-weight
147
+ );
148
+ $h1-color: var(--#{root-defaults.$prefix}h1-color, #{$heading-color});
149
+
150
+ // H2 properties.
151
+ $h2-font-size: var(
152
+ --#{root-defaults.$prefix}h2-font-size,
153
+ #{map.get($font-sizes, 4xl)}
154
+ );
155
+ $h2-line-height: var(
156
+ --#{root-defaults.$prefix}h2-line-height,
157
+ #{$heading-line-height}
158
+ );
159
+ $h2-margin: var(--#{root-defaults.$prefix}h2-margin, #{$heading-margin});
160
+ $h2-font-family: var(
161
+ --#{root-defaults.$prefix}h2-font-family,
162
+ $heading-font-family
163
+ );
164
+ $h2-font-weight: var(
165
+ --#{root-defaults.$prefix}h2-font-weight,
166
+ $heading-font-weight
167
+ );
168
+ $h2-color: var(--#{root-defaults.$prefix}h2-color, #{$heading-color});
169
+
170
+ // H3 properties.
171
+ $h3-font-size: var(
172
+ --#{root-defaults.$prefix}h3-font-size,
173
+ #{map.get($font-sizes, 3xl)}
174
+ );
175
+ $h3-line-height: var(
176
+ --#{root-defaults.$prefix}h3-line-height,
177
+ #{$heading-line-height}
178
+ );
179
+ $h3-margin: var(--#{root-defaults.$prefix}h3-margin, #{$heading-margin});
180
+ $h3-font-family: var(
181
+ --#{root-defaults.$prefix}h3-font-family,
182
+ $heading-font-family
183
+ );
184
+ $h3-font-weight: var(
185
+ --#{root-defaults.$prefix}h3-font-weight,
186
+ $heading-font-weight
187
+ );
188
+ $h3-color: var(--#{root-defaults.$prefix}h3-color, #{$heading-color});
189
+
190
+ // H4 properties.
191
+ $h4-font-size: var(
192
+ --#{root-defaults.$prefix}h4-font-size,
193
+ #{map.get($font-sizes, 2xl)}
194
+ );
195
+ $h4-line-height: var(
196
+ --#{root-defaults.$prefix}h4-line-height,
197
+ #{$heading-line-height}
198
+ );
199
+ $h4-margin: var(--#{root-defaults.$prefix}h4-margin, #{$heading-margin});
200
+ $h4-font-family: var(
201
+ --#{root-defaults.$prefix}h4-font-family,
202
+ $heading-font-family
203
+ );
204
+ $h4-font-weight: var(
205
+ --#{root-defaults.$prefix}h4-font-weight,
206
+ $heading-font-weight
207
+ );
208
+ $h4-color: var(--#{root-defaults.$prefix}h4-color, #{$heading-color});
209
+
210
+ // H5 properties.
211
+ $h5-font-size: var(
212
+ --#{root-defaults.$prefix}h5-font-size,
213
+ #{map.get($font-sizes, xl)}
214
+ );
215
+ $h5-line-height: var(
216
+ --#{root-defaults.$prefix}h5-line-height,
217
+ #{$heading-line-height}
218
+ );
219
+ $h5-margin: var(--#{root-defaults.$prefix}h5-margin, #{$heading-margin});
220
+ $h5-font-family: var(
221
+ --#{root-defaults.$prefix}h5-font-family,
222
+ $heading-font-family
223
+ );
224
+ $h5-font-weight: var(
225
+ --#{root-defaults.$prefix}h5-font-weight,
226
+ $heading-font-weight
227
+ );
228
+ $h5-color: var(--#{root-defaults.$prefix}h5-color, #{$heading-color});
229
+
230
+ // H6 properties.
231
+ $h6-font-size: var(
232
+ --#{root-defaults.$prefix}h6-font-size,
233
+ #{map.get($font-sizes, lg)}
234
+ );
235
+ $h6-line-height: var(
236
+ --#{root-defaults.$prefix}h6-line-height,
237
+ #{$heading-line-height}
238
+ );
239
+ $h6-margin: var(--#{root-defaults.$prefix}h6-margin, #{$heading-margin});
240
+ $h6-font-family: var(
241
+ --#{root-defaults.$prefix}h6-font-family,
242
+ $heading-font-family
243
+ );
244
+ $h6-font-weight: var(
245
+ --#{root-defaults.$prefix}h6-font-weight,
246
+ $heading-font-weight
247
+ );
248
+ $h6-color: var(--#{root-defaults.$prefix}h6-color, #{$heading-color});
@@ -0,0 +1,23 @@
1
+ // @graupl/core utilities styles.
2
+
3
+ @forward "alignment";
4
+ @forward "background";
5
+ @forward "border";
6
+ @forward "color";
7
+ @forward "container";
8
+ @forward "display";
9
+ @forward "flex";
10
+ @forward "gradient";
11
+ @forward "height";
12
+ @forward "inset";
13
+ @forward "justification";
14
+ @forward "list";
15
+ @forward "order";
16
+ @forward "position";
17
+ @forward "ratio";
18
+ @forward "spacing";
19
+ @forward "typography";
20
+ @forward "visibility";
21
+ @forward "visually-hidden";
22
+ @forward "width";
23
+ @forward "z-index";
@@ -0,0 +1,41 @@
1
+ // @graupl/core [_template] 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 "../../defaults" as root-defaults;
10
+ @use "sass:map";
11
+
12
+ // Utility modifiers.
13
+ $selector-base: root-defaults.$utility-selector-base !default;
14
+ $use-important: root-defaults.$use-important !default;
15
+ $screen-aware: false !default;
16
+ $theme-aware: false !default;
17
+ $state-aware: false !default;
18
+ $container-aware: false !default;
19
+ $screen-aware-separator: root-defaults.$utility-screen-aware-separator !default;
20
+ $theme-aware-separator: root-defaults.$utility-theme-aware-separator !default;
21
+ $state-aware-separator: root-defaults.$utility-state-aware-separator !default;
22
+ $container-aware-separator: root-defaults.$utility-container-aware-separator !default;
23
+ $screen-aware-selector-prefix: root-defaults.$utility-screen-aware-selector-prefix !default;
24
+ $theme-aware-selector-prefix: root-defaults.$utility-theme-aware-selector-prefix !default;
25
+ $state-aware-selector-prefix: root-defaults.$utility-state-aware-selector-prefix !default;
26
+ $container-aware-selector-prefix: root-defaults.$utility-container-aware-selector-prefix !default;
27
+
28
+ // _Template properties.
29
+ //
30
+ // Remember when defining properties to make sure the defaults can be customized.
31
+ // This can be done by using variables for class names, or by defining base properties and merging them with custom properties provided by the user.
32
+ //
33
+ // Remember to replace references like [_template], or other placeholder content with appropriate descriptions!
34
+
35
+ $template-selector-prefix: "template-" !default;
36
+ $base-template-properties: ();
37
+ $custom-template-properties: () !default;
38
+ $template-properties: map.merge(
39
+ $base-template-properties,
40
+ $custom-template-properties
41
+ );
@@ -0,0 +1,171 @@
1
+ // @graupl/core [_template] utilities styles.
2
+ //
3
+ // This file generates the [_template] utility classes provided by Graupl.
4
+ //
5
+ // The following classes are generated by default:
6
+ // - `.template-class`: Applies the base value for the property.
7
+ //
8
+ // The following custom properties control the generated classes:
9
+ // - N/A.
10
+ //
11
+ // The following variables control the generated classes:
12
+ // - `$selector-base`: The base selector for the utility classes.
13
+ // - `$use-important`: A flag to determine if the `!important` flag should be added to the utility classes.
14
+ // - `$screen-aware`: A flag to generate screen-aware utility classes.
15
+ // - `$theme-aware`: A flag to generate theme-aware utility classes.
16
+ // - `$state-aware`: A flag to generate state-aware utility classes.
17
+ // - `$container-aware`: A flag to generate container-aware utility classes.
18
+ // - `$screen-aware-separator`: The separator for screen-aware utility classes.
19
+ // - `$theme-aware-separator`: The separator for theme-aware utility classes.
20
+ // - `$state-aware-separator`: The separator for state-aware utility classes.
21
+ // - `$container-aware-separator`: The separator for container-aware utility classes.
22
+ // - `$screen-aware-selector-prefix`: The prefix for screen-aware utility classes.
23
+ // - `$theme-aware-selector-prefix`: The prefix for theme-aware utility classes.
24
+ // - `$state-aware-selector-prefix`: The prefix for state-aware utility classes.
25
+ // - `$container-aware-selector-prefix`: The prefix for container-aware utility classes.
26
+ // - `$template-selector-prefix`: The prefix for the utility classes.
27
+ // - `$base-template-properties`: The base properties and values for the template utility classes.
28
+ // - `$custom-template-properties`: The custom properties and values for the template utility classes.
29
+ // - `$template-properties`: The merged properties and values for the template utility classes.
30
+ //
31
+ // Generating responsive utility classes can be done by setting `$screen-aware`, `$theme-aware`, or `$state-aware` to `true`.
32
+ // By default, no responsive utility classes are generated.
33
+ //
34
+ // When set to true, screen-aware utility classes will be generated for each screen size in the following pattern:
35
+ // - `.{screen-prefix}{screen-name}:{prefix}{value}`
36
+ //
37
+ // e.g. `.sm:[template-class]` will set the `template` property to `value` on screens equal to or larger than the `sm` breakpoint.
38
+ //
39
+ // When set to true, theme-aware utility classes will be generated for each theme in the following pattern:
40
+ // - `.{theme-prefix}{theme-name}:{prefix}{value}`
41
+ //
42
+ // e.g. `.dark:[template-class]` will set the `template` property to `value` when the `dark` theme is active.
43
+ //
44
+ // When set to true, state-aware utility classes will be generated for each state in the following pattern:
45
+ // - `.{state-prefix}{state-name}:{prefix}{value}`
46
+ //
47
+ // e.g. `.hover:[template-class]` will set the `template` property to `value` when the element is hovered.
48
+ //
49
+ // When set to true, container-aware utility classes will be generated for each container in the following pattern:
50
+ // - `.{container-prefix}{container-name}:{prefix}{value}`
51
+ //
52
+ // e.g. `.cq:md:[template-class]` will set the `template` property to `value` when the parent container is larger than the `md` breakpoint.
53
+ //
54
+ // @example
55
+ // <div class="template-class">This content showing you how to use this.</div>
56
+
57
+ @use "../../defaults" as root-defaults;
58
+ @use "../../mixins/layer" as *;
59
+ @use "../../mixins/utility";
60
+ @use "../../theme/color/variables" as color;
61
+ @use "defaults";
62
+ @use "sass:map";
63
+ @use "variables" as *;
64
+
65
+ @include layer(utilities) {
66
+ // `.`
67
+ $selector-prefix: defaults.$selector-base;
68
+
69
+ // For each template property, create a utility class.
70
+ @each $name, $value in defaults.$template-properties {
71
+ // e.g. `.template-property-name`
72
+ $selector: #{$selector-prefix}#{defaults.$template-selector-prefix}#{$name};
73
+
74
+ @include utility.create(
75
+ $selector,
76
+ property,
77
+ $value,
78
+ $important: #{defaults.$use-important}
79
+ );
80
+ }
81
+
82
+ // Generate screen-aware utilities.
83
+ @if defaults.$screen-aware and root-defaults.$screen-aware-utilities {
84
+ @each $screen-name in map.keys(root-defaults.$screen-sizes) {
85
+ // e.g. `.md:` or `.lg:`
86
+ $selector-prefix: #{defaults.$selector-base}#{defaults.$screen-aware-selector-prefix}#{$screen-name}#{defaults.$screen-aware-separator};
87
+
88
+ // For each template property, create a utility class.
89
+ @each $name, $value in defaults.$template-properties {
90
+ // e.g. `.md:template-property-name`
91
+ $selector: #{$selector-prefix}#{defaults.$template-selector-prefix}#{$name};
92
+
93
+ @include utility.create(
94
+ $selector,
95
+ property,
96
+ $value,
97
+ $important: #{defaults.$use-important},
98
+ $screen: $screen-name
99
+ );
100
+ }
101
+ }
102
+ }
103
+
104
+ // Generate theme-aware utilities.
105
+ @if defaults.$theme-aware and root-defaults.$theme-aware-utilities {
106
+ @each $theme-name, $colors in color.$themes {
107
+ @if $theme-name != active {
108
+ // e.g. `.dark:` or `.light:`
109
+ $selector-prefix: #{defaults.$selector-base}#{defaults.$theme-aware-selector-prefix}#{$theme-name}#{defaults.$theme-aware-separator};
110
+
111
+ // For each template property, create a utility class.
112
+ @each $name, $value in defaults.$template-properties {
113
+ // e.g. `.dark:template-property-name` or `.light:template-property-name`
114
+ $selector: #{$selector-prefix}#{defaults.$template-selector-prefix}#{$name};
115
+
116
+ @include utility.create(
117
+ $selector,
118
+ property,
119
+ $value,
120
+ $important: #{defaults.$use-important},
121
+ $theme: $theme-name
122
+ );
123
+ }
124
+ }
125
+ }
126
+ }
127
+
128
+ // Generate state-aware utilities.
129
+ @if defaults.$state-aware and root-defaults.$state-aware-utilities {
130
+ @each $state-name, $value in root-defaults.$state-selectors {
131
+ // e.g. `.hover:` or `.focus:`
132
+ $selector-prefix: #{defaults.$selector-base}#{defaults.$state-aware-selector-prefix}#{$state-name}#{defaults.$state-aware-separator};
133
+
134
+ // For each template property, create a utility class.
135
+ @each $name, $value in defaults.$template-properties {
136
+ // e.g. `.hover:template-property-name` or `.focus:template-property-name`
137
+ $selector: #{$selector-prefix}#{defaults.$template-selector-prefix}#{$name};
138
+
139
+ @include utility.create(
140
+ $selector,
141
+ property,
142
+ $value,
143
+ $important: #{defaults.$use-important},
144
+ $state: $state-name
145
+ );
146
+ }
147
+ }
148
+ }
149
+
150
+ // Generate container-aware utilities.
151
+ @if defaults.$container-aware and root-defaults.$container-aware-utilities {
152
+ @each $container-name in map.keys(root-defaults.$container-sizes) {
153
+ // e.g. `.md:` or `.lg:`
154
+ $selector-prefix: #{defaults.$selector-base}#{defaults.$container-aware-selector-prefix}#{$container-name}#{defaults.$container-aware-separator};
155
+
156
+ // For each template property, create a utility class.
157
+ @each $name, $value in defaults.$template-properties {
158
+ // e.g. `.cq:md:template-property-name`
159
+ $selector: #{$selector-prefix}#{defaults.$template-selector-prefix}#{$name};
160
+
161
+ @include utility.create(
162
+ $selector,
163
+ property,
164
+ $value,
165
+ $important: #{defaults.$use-important},
166
+ $container: $container-name
167
+ );
168
+ }
169
+ }
170
+ }
171
+ }
@@ -0,0 +1,6 @@
1
+ // @graupl/core [_template] 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";