@graupl/graupl 1.0.0-alpha.11 → 1.0.0-alpha.13

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 (195) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/dist/base/button.css +2 -0
  3. package/dist/base/button.css.map +1 -0
  4. package/dist/base/form.css +1 -1
  5. package/dist/base/form.css.map +1 -1
  6. package/dist/base/link.css +1 -1
  7. package/dist/base/link.css.map +1 -1
  8. package/dist/base/table.css +1 -1
  9. package/dist/base/table.css.map +1 -1
  10. package/dist/base.css +1 -1
  11. package/dist/base.css.map +1 -1
  12. package/dist/component/card.css +2 -0
  13. package/dist/component/card.css.map +1 -0
  14. package/dist/component/input-group.css +1 -1
  15. package/dist/component/input-group.css.map +1 -1
  16. package/dist/component/menu.css +2 -0
  17. package/dist/component/menu.css.map +1 -0
  18. package/dist/component/navigation.css +2 -0
  19. package/dist/component/navigation.css.map +1 -0
  20. package/dist/component.css +1 -1
  21. package/dist/component.css.map +1 -1
  22. package/dist/graupl.css +1 -1
  23. package/dist/graupl.css.map +1 -1
  24. package/dist/init.css +2 -0
  25. package/dist/init.css.map +1 -0
  26. package/dist/layout/columns.css +1 -1
  27. package/dist/layout/columns.css.map +1 -1
  28. package/dist/layout/container.css.map +1 -1
  29. package/dist/layout/flex-columns.css +2 -0
  30. package/dist/layout/flex-columns.css.map +1 -0
  31. package/dist/layout.css +1 -1
  32. package/dist/layout.css.map +1 -1
  33. package/dist/normalize.css +2 -0
  34. package/dist/normalize.css.map +1 -0
  35. package/dist/state/focus.css.map +1 -1
  36. package/dist/state.css.map +1 -1
  37. package/dist/theme/color.css.map +1 -1
  38. package/dist/theme/typography.css +1 -1
  39. package/dist/theme/typography.css.map +1 -1
  40. package/dist/theme.css +1 -1
  41. package/dist/theme.css.map +1 -1
  42. package/dist/utilities/order.css +2 -0
  43. package/dist/utilities/order.css.map +1 -0
  44. package/dist/utilities/spacing.css +1 -1
  45. package/dist/utilities/spacing.css.map +1 -1
  46. package/dist/utilities/typography.css +1 -1
  47. package/dist/utilities/typography.css.map +1 -1
  48. package/dist/utilities.css +1 -1
  49. package/dist/utilities.css.map +1 -1
  50. package/eslint.config.js +1 -0
  51. package/index.html +619 -326
  52. package/package.json +2 -1
  53. package/scss/base/button.scss +3 -0
  54. package/scss/base/form.scss +1 -1
  55. package/scss/base/link.scss +1 -1
  56. package/scss/base/table.scss +1 -1
  57. package/scss/base.scss +1 -1
  58. package/scss/component/card.scss +3 -0
  59. package/scss/component/input-group.scss +1 -1
  60. package/scss/component/menu.scss +3 -0
  61. package/scss/component/navigation.scss +3 -0
  62. package/scss/component.scss +1 -1
  63. package/scss/graupl.scss +1 -3
  64. package/scss/init.scss +3 -0
  65. package/scss/layout/columns.scss +1 -1
  66. package/scss/layout/container.scss +1 -1
  67. package/scss/layout/flex-columns.scss +3 -0
  68. package/scss/layout.scss +1 -1
  69. package/scss/normalize.scss +3 -0
  70. package/scss/state/focus.scss +1 -1
  71. package/scss/state.scss +1 -1
  72. package/scss/theme/color.scss +1 -1
  73. package/scss/theme/typography.scss +1 -1
  74. package/scss/theme.scss +1 -1
  75. package/scss/utilities/alignment.scss +1 -1
  76. package/scss/utilities/color.scss +1 -1
  77. package/scss/utilities/display.scss +1 -1
  78. package/scss/utilities/flex.scss +1 -1
  79. package/scss/utilities/inset.scss +1 -1
  80. package/scss/utilities/justification.scss +1 -1
  81. package/scss/utilities/list.scss +1 -1
  82. package/scss/utilities/order.scss +3 -0
  83. package/scss/utilities/postion.scss +1 -1
  84. package/scss/utilities/spacing.scss +1 -1
  85. package/scss/utilities/typography.scss +1 -1
  86. package/scss/utilities/visibility.scss +1 -1
  87. package/scss/utilities.scss +1 -1
  88. package/src/js/navigation.js +34 -0
  89. package/src/scss/_defaults.scss +21 -5
  90. package/src/scss/_index.scss +4 -3
  91. package/src/scss/_init.scss +2 -2
  92. package/src/scss/_normalize.scss +197 -0
  93. package/src/scss/_variables.scss +4 -1
  94. package/src/scss/base/_index.scss +2 -1
  95. package/src/scss/base/button/_defaults.scss +53 -0
  96. package/src/scss/base/button/_index.scss +210 -0
  97. package/src/scss/{component → base}/button/_variables.scss +51 -12
  98. package/src/scss/base/form/_defaults.scss +14 -4
  99. package/src/scss/base/form/_index.scss +23 -20
  100. package/src/scss/base/form/_variables.scss +12 -1
  101. package/src/scss/base/link/_defaults.scss +48 -5
  102. package/src/scss/base/link/_index.scss +101 -17
  103. package/src/scss/base/link/_variables.scss +226 -5
  104. package/src/scss/base/table/_defaults.scss +49 -4
  105. package/src/scss/base/table/_index.scss +102 -8
  106. package/src/scss/base/table/_variables.scss +71 -1
  107. package/src/scss/component/_index.scss +4 -3
  108. package/src/scss/component/card/_defaults.scss +29 -0
  109. package/src/scss/component/card/_index.scss +143 -0
  110. package/src/scss/component/card/_variables.scss +185 -0
  111. package/src/scss/component/input-group/_defaults.scss +11 -4
  112. package/src/scss/component/input-group/_index.scss +11 -9
  113. package/src/scss/component/input-group/_variables.scss +4 -1
  114. package/src/scss/component/menu/_defaults.scss +65 -0
  115. package/src/scss/component/menu/_index.scss +304 -0
  116. package/src/scss/component/menu/_variables.scss +491 -0
  117. package/src/scss/component/navigation/_defaults.scss +29 -0
  118. package/src/scss/component/navigation/_index.scss +189 -0
  119. package/src/scss/component/navigation/_variables.scss +237 -0
  120. package/src/scss/functions/_important.scss +2 -0
  121. package/src/scss/functions/_theme.scss +18 -0
  122. package/src/scss/layout/_index.scss +2 -1
  123. package/src/scss/layout/columns/_defaults.scss +12 -4
  124. package/src/scss/layout/columns/_index.scss +27 -5
  125. package/src/scss/layout/columns/_variables.scss +4 -1
  126. package/src/scss/layout/container/_defaults.scss +13 -4
  127. package/src/scss/layout/container/_index.scss +12 -7
  128. package/src/scss/layout/container/_variables.scss +4 -1
  129. package/src/scss/layout/flex-columns/_defaults.scss +18 -0
  130. package/src/scss/layout/flex-columns/_index.scss +77 -0
  131. package/src/scss/layout/flex-columns/_variables.scss +26 -0
  132. package/src/scss/mixins/_layer.scss +1 -1
  133. package/src/scss/mixins/_media-queries.scss +10 -1
  134. package/src/scss/state/_index.scss +1 -1
  135. package/src/scss/state/focus/_defaults.scss +6 -4
  136. package/src/scss/state/focus/_index.scss +1 -1
  137. package/src/scss/state/focus/_variables.scss +4 -1
  138. package/src/scss/theme/_index.scss +1 -1
  139. package/src/scss/theme/color/_defaults.scss +6 -4
  140. package/src/scss/theme/color/_index.scss +1 -1
  141. package/src/scss/theme/color/_variables.scss +4 -1
  142. package/src/scss/theme/typography/_defaults.scss +7 -5
  143. package/src/scss/theme/typography/_index.scss +1 -1
  144. package/src/scss/theme/typography/_variables.scss +9 -3
  145. package/src/scss/utilities/_index.scss +3 -1
  146. package/src/scss/utilities/alignment/_defaults.scss +6 -4
  147. package/src/scss/utilities/alignment/_index.scss +1 -1
  148. package/src/scss/utilities/alignment/_variables.scss +4 -1
  149. package/src/scss/utilities/color/_defaults.scss +6 -4
  150. package/src/scss/utilities/color/_index.scss +1 -1
  151. package/src/scss/utilities/color/_variables.scss +4 -1
  152. package/src/scss/utilities/display/_defaults.scss +6 -4
  153. package/src/scss/utilities/display/_index.scss +1 -1
  154. package/src/scss/utilities/display/_variables.scss +4 -1
  155. package/src/scss/utilities/flex/_defaults.scss +6 -4
  156. package/src/scss/utilities/flex/_index.scss +1 -1
  157. package/src/scss/utilities/flex/_variables.scss +4 -1
  158. package/src/scss/utilities/inset/_defaults.scss +6 -4
  159. package/src/scss/utilities/inset/_index.scss +1 -1
  160. package/src/scss/utilities/inset/_variables.scss +4 -1
  161. package/src/scss/utilities/justification/_defaults.scss +6 -4
  162. package/src/scss/utilities/justification/_index.scss +1 -1
  163. package/src/scss/utilities/justification/_variables.scss +4 -1
  164. package/src/scss/utilities/list/_defaults.scss +6 -4
  165. package/src/scss/utilities/list/_index.scss +1 -1
  166. package/src/scss/utilities/list/_variables.scss +4 -1
  167. package/src/scss/utilities/order/_defaults.scss +19 -0
  168. package/src/scss/utilities/order/_index.scss +35 -0
  169. package/src/scss/utilities/order/_variables.scss +6 -0
  170. package/src/scss/utilities/position/_defaults.scss +6 -4
  171. package/src/scss/utilities/position/_index.scss +1 -1
  172. package/src/scss/utilities/position/_variables.scss +4 -1
  173. package/src/scss/utilities/ratio/_defaults.scss +24 -0
  174. package/src/scss/utilities/ratio/_index.scss +26 -0
  175. package/src/scss/utilities/ratio/_variables.scss +9 -0
  176. package/src/scss/utilities/spacing/_defaults.scss +6 -4
  177. package/src/scss/utilities/spacing/_index.scss +41 -17
  178. package/src/scss/utilities/spacing/_variables.scss +4 -1
  179. package/src/scss/utilities/typography/_defaults.scss +6 -4
  180. package/src/scss/utilities/typography/_index.scss +1 -1
  181. package/src/scss/utilities/typography/_variables.scss +4 -1
  182. package/src/scss/utilities/visibility/_defaults.scss +6 -4
  183. package/src/scss/utilities/visibility/_index.scss +1 -1
  184. package/src/scss/utilities/visibility/_variables.scss +4 -1
  185. package/dist/component/button.css +0 -2
  186. package/dist/component/button.css.map +0 -1
  187. package/dist/component/table.css +0 -2
  188. package/dist/component/table.css.map +0 -1
  189. package/scss/component/button.scss +0 -3
  190. package/scss/component/table.scss +0 -3
  191. package/src/scss/component/button/_defaults.scss +0 -39
  192. package/src/scss/component/button/_index.scss +0 -134
  193. package/src/scss/component/table/_defaults.scss +0 -30
  194. package/src/scss/component/table/_index.scss +0 -77
  195. package/src/scss/component/table/_variables.scss +0 -64
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graupl/graupl",
3
- "version": "1.0.0-alpha.11",
3
+ "version": "1.0.0-alpha.13",
4
4
  "description": "A modular and modern CSS framework.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -56,6 +56,7 @@
56
56
  "globals": "^15.0.0",
57
57
  "husky": "^9.0.11",
58
58
  "lint-staged": "^15.2.2",
59
+ "normalize.css": "^8.0.1",
59
60
  "postcss": "^8.4.38",
60
61
  "postcss-cli": "^11.0.0",
61
62
  "postcss-discard-comments": "^7.0.0",
@@ -0,0 +1,3 @@
1
+ // @graupl/graupl button base.
2
+
3
+ @forward "../../src/scss/base/button";
@@ -1,3 +1,3 @@
1
- // Graupl form base styles.
1
+ // @graupl/graupl form base.
2
2
 
3
3
  @forward "../../src/scss/base/form";
@@ -1,3 +1,3 @@
1
- // Link base styles.
1
+ // @graupl/graupl link base.
2
2
 
3
3
  @forward "../../src/scss/base/link";
@@ -1,3 +1,3 @@
1
- // Table base styles.
1
+ // @graupl/graupl table base.
2
2
 
3
3
  @forward "../../src/scss/base/table";
package/scss/base.scss CHANGED
@@ -1,3 +1,3 @@
1
- // Graupl base.
1
+ // @graupl/graupl base.
2
2
 
3
3
  @forward "../src/scss/base";
@@ -0,0 +1,3 @@
1
+ // @graupl/graupl card component.
2
+
3
+ @forward "../../src/scss/component/card";
@@ -1,3 +1,3 @@
1
- // Graupl Input group Component.
1
+ // @graupl/graupl input group component.
2
2
 
3
3
  @forward "../../src/scss/component/input-group";
@@ -0,0 +1,3 @@
1
+ // @graupl/graupl menu component.
2
+
3
+ @forward "../../src/scss/component/menu";
@@ -0,0 +1,3 @@
1
+ // @graupl/graupl navigation component.
2
+
3
+ @forward "../../src/scss/component/navigation";
@@ -1,3 +1,3 @@
1
- // Graupl components.
1
+ // @graupl/graupl components.
2
2
 
3
3
  @forward "../src/scss/component";
package/scss/graupl.scss CHANGED
@@ -1,5 +1,3 @@
1
- // Graupl Components.
2
- //
3
- // Forwards all components for easy development.
1
+ // @graupl/graupl
4
2
 
5
3
  @forward "../src/scss";
package/scss/init.scss ADDED
@@ -0,0 +1,3 @@
1
+ // @graupl/graupl layer initialization.
2
+
3
+ @forward "../src/scss/init";
@@ -1,3 +1,3 @@
1
- // Graupl Columns layout.
1
+ // @graupl/graupl columns layout.
2
2
 
3
3
  @forward "../../src/scss/layout/columns";
@@ -1,3 +1,3 @@
1
- // Graupl Container layout.
1
+ // @graupl/graupl container layout.
2
2
 
3
3
  @forward "../../src/scss/layout/container";
@@ -0,0 +1,3 @@
1
+ // @graupl/graupl flex columns layout.
2
+
3
+ @forward "../../src/scss/layout/flex-columns";
package/scss/layout.scss CHANGED
@@ -1,3 +1,3 @@
1
- // Graupl layout.
1
+ // @graupl/graupl layout.
2
2
 
3
3
  @forward "../src/scss/";
@@ -0,0 +1,3 @@
1
+ // @graupl/graupl normalize.
2
+
3
+ @forward "../src/scss/normalize";
@@ -1,3 +1,3 @@
1
- // Focus state styles.
1
+ // @graupl/graupl focus state.
2
2
 
3
3
  @forward "../../src/scss/state/focus";
package/scss/state.scss CHANGED
@@ -1,3 +1,3 @@
1
- // Graupl state.
1
+ // @graupl/graupl state.
2
2
 
3
3
  @forward "../src/scss/state";
@@ -1,3 +1,3 @@
1
- // Color theme styles.
1
+ // @graupl/graupl color theme.
2
2
 
3
3
  @forward "../../src/scss/theme/color";
@@ -1,3 +1,3 @@
1
- // Typography theme styles.
1
+ // @graupl/graupl typography theme.
2
2
 
3
3
  @forward "../../src/scss/theme/typography";
package/scss/theme.scss CHANGED
@@ -1,3 +1,3 @@
1
- // Graupl theme.
1
+ // @graupl/graupl theme.
2
2
 
3
3
  @forward "../src/scss/theme";
@@ -1,3 +1,3 @@
1
- // Graupl alignment utilities.
1
+ // @graupl/graupl alignment utilities.
2
2
 
3
3
  @forward "../../src/scss/utilities/alignment";
@@ -1,3 +1,3 @@
1
- // Graupl color utilities.
1
+ // @graupl/graupl color utilities.
2
2
 
3
3
  @forward "../../src/scss/utilities/color";
@@ -1,3 +1,3 @@
1
- // Graupl display utilities.
1
+ // @graupl/graupl display utilities.
2
2
 
3
3
  @forward "../../src/scss/utilities/display";
@@ -1,3 +1,3 @@
1
- // Graupl flex utilities.
1
+ // @graupl/graupl flex utilities.
2
2
 
3
3
  @forward "../../src/scss/utilities/flex";
@@ -1,3 +1,3 @@
1
- // Graupl inset utilities.
1
+ // @graupl/graupl inset utilities.
2
2
 
3
3
  @forward "../../src/scss/utilities/inset";
@@ -1,3 +1,3 @@
1
- // Graupl justification utilities.
1
+ // @graupl/graupl justification utilities.
2
2
 
3
3
  @forward "../../src/scss/utilities/justification";
@@ -1,3 +1,3 @@
1
- // Graupl list utilities.
1
+ // @graupl/graupl list utilities.
2
2
 
3
3
  @forward "../../src/scss/utilities/list";
@@ -0,0 +1,3 @@
1
+ // @graupl/graupl order utilities.
2
+
3
+ @forward "../../src/scss/utilities/order";
@@ -1,3 +1,3 @@
1
- // Graupl position utilities.
1
+ // @graupl/graupl position utilities.
2
2
 
3
3
  @forward "../../src/scss/utilities/position";
@@ -1,3 +1,3 @@
1
- // Graupl spacing utilities.
1
+ // @graupl/graupl spacing utilities.
2
2
 
3
3
  @forward "../../src/scss/utilities/spacing";
@@ -1,3 +1,3 @@
1
- // Graupl typography utilities.
1
+ // @graupl/graupl typography utilities.
2
2
 
3
3
  @forward "../../src/scss/utilities/typography";
@@ -1,3 +1,3 @@
1
- // Graupl visibility utilities.
1
+ // @graupl/graupl visibility utilities.
2
2
 
3
3
  @forward "../../src/scss/utilities/visibility";
@@ -1,3 +1,3 @@
1
- // Graupl utilities.
1
+ // @graupl/graupl utilities.
2
2
 
3
3
  @forward "../src/scss/utilities";
@@ -0,0 +1,34 @@
1
+ document.addEventListener("DOMContentLoaded", function () {
2
+ const navs = document.querySelectorAll(".navigation");
3
+ const menus = [];
4
+
5
+ navs.forEach((nav) => {
6
+ const MenuConstructor = nav.dataset.grauplMenuType || DisclosureMenu;
7
+
8
+ if (window[MenuConstructor] === undefined) {
9
+ console.warn(
10
+ `Graupl navigation requires accessible-menu's ${MenuConstructor}. Please make sure to include it on this page.`
11
+ );
12
+
13
+ return;
14
+ }
15
+
16
+ const menuOptions =
17
+ JSON.parse(nav.dataset.grauplMenuOptions.replace(/'/g, '"')) || {};
18
+ const menuElement = nav.querySelector(".menu");
19
+ const controllerElement = nav.querySelector(".navigation-toggle");
20
+ const containerElement = nav;
21
+ const menu = new window[MenuConstructor]({
22
+ menuElement,
23
+ menuItemSelector: ".menu-item",
24
+ menuLinkSelector: ".menu-link",
25
+ submenuItemSelector: ".submenu-item",
26
+ submenuToggleSelector: ".submenu-toggle",
27
+ controllerElement,
28
+ containerElement,
29
+ ...menuOptions,
30
+ });
31
+
32
+ menus.push(menu);
33
+ });
34
+ });
@@ -1,8 +1,10 @@
1
- // Default values for Graupl.
1
+ // @graupl/graupl 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
 
@@ -17,10 +19,24 @@ $content-max-width: 96ch !default;
17
19
 
18
20
  // Screen sizes.
19
21
  $base-screen-sizes: (
20
- xs: "(0 <= width <= 48ch)",
22
+ xs: "(width <= 48ch)",
23
+ sm: "(48ch < width)",
24
+ md: "(72ch < width)",
25
+ lg: "(108ch < width)",
26
+ xl: "(156ch < width)",
21
27
  );
22
28
  $custom-screen-sizes: () !default;
23
29
  $screen-sizes: map.merge($base-screen-sizes, $custom-screen-sizes);
30
+ $base-screen-size-triggers: (
31
+ navigation-collapse: "(width <= 72ch)",
32
+ navigation-expand: "(72ch < width)",
33
+ force-vertical-card: "(width <= 72ch)",
34
+ );
35
+ $custom-screen-size-triggers: () !default;
36
+ $screen-size-triggers: map.merge(
37
+ $base-screen-size-triggers,
38
+ $custom-screen-size-triggers
39
+ );
24
40
 
25
41
  // Spacing properties.
26
42
  $spacer: 1rem !default;
@@ -1,10 +1,11 @@
1
- // Graupl Components.
2
- //
3
- // Forwards all components for easy development.
1
+ // @graupl/graupl styles.
4
2
 
5
3
  // Forward the layer initialization.
6
4
  @forward "init";
7
5
 
6
+ // Forward normalize.
7
+ @forward "normalize";
8
+
8
9
  // Forward all layers.
9
10
  @forward "base";
10
11
  @forward "layout";
@@ -1,3 +1,3 @@
1
- // Graupl layer initialization.
1
+ // @graupl/graupl layer initialization styles.
2
2
 
3
- @layer graupl.base, graupl.layout, graupl.component, graupl.theme, graupl.utilities, graupl.state;
3
+ @layer graupl.normalize, graupl.base, graupl.layout, graupl.component, graupl.theme, graupl.utilities, graupl.state;
@@ -0,0 +1,197 @@
1
+ // @graupl/graupl normalize.
2
+ //
3
+ // This file is manually forked from normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css
4
+ //
5
+ // We wanted to scope normalize.css to a normalize layer along with some customizations, so we forked it here.
6
+ //
7
+ // @use cannot be used in this file because you cannot insert it into a layer.
8
+ //
9
+ // @import would technically work, but it is not recommended by Sass and will eventually be removed.
10
+ // Using @import would cause headaches down the line, so a manual fork was the best option.
11
+
12
+ @use "mixins/layer" as *;
13
+
14
+ @include layer(normalize) {
15
+ // Correct box sizing of all elements to ensure everything is consistent.
16
+ *,
17
+ *::before,
18
+ *::after {
19
+ box-sizing: border-box;
20
+ }
21
+
22
+ // Document.
23
+
24
+ // 1. Correct the line height in all browsers.
25
+ // 2. Prevent adjustments of font size after orientation changes in iOS.
26
+ html {
27
+ line-height: 1.15; // 1.
28
+ text-size-adjust: 100%; // 2.
29
+ }
30
+
31
+ // Secions.
32
+
33
+ // Remove the margin in all browsers.
34
+ body {
35
+ margin: 0;
36
+ }
37
+
38
+ // Grouping content.
39
+
40
+ // Add the correct box sizing in Firefox.
41
+ hr {
42
+ box-sizing: content-box;
43
+ height: 0;
44
+ }
45
+
46
+ // 1. Correct the inheritance and scaling of font size in all browsers.
47
+ // 2. Correct the odd `em` font sizing in all browsers.
48
+ pre {
49
+ font-family: monospace; // 1.
50
+ font-size: 1em; // 2.
51
+ }
52
+
53
+ // Text-level semantics.
54
+
55
+ // 1. Remove the bottom border in Chrome 57-
56
+ // 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
57
+ abbr[title] {
58
+ border-bottom: 0; // 1.
59
+ text-decoration: underline dotted; // 2.
60
+ }
61
+
62
+ // Add the correct font weight in Chrome, Edge, and Safari.
63
+ b,
64
+ strong {
65
+ font-weight: bolder;
66
+ }
67
+
68
+ // 1. Correct the inheritance and scaling of font size in all browsers.
69
+ // 2. Correct the odd `em` font sizing in all browsers.
70
+ code,
71
+ kbd,
72
+ samp {
73
+ font-family: monospace; // 1.
74
+ font-size: 1em; // 2.
75
+ }
76
+
77
+ // Add the correct font size in all browsers.
78
+ small {
79
+ font-size: 80%;
80
+ }
81
+
82
+ // Prevent `sub` and `sup` elements from affecting the line height in all browsers.
83
+ sub,
84
+ sup {
85
+ position: relative;
86
+ font-size: 75%;
87
+ line-height: 0;
88
+ vertical-align: baseline;
89
+ }
90
+
91
+ sub {
92
+ bottom: -0.25em;
93
+ }
94
+
95
+ sup {
96
+ top: -0.5em;
97
+ }
98
+
99
+ // Forms.
100
+
101
+ // 1. Change the font styles in all browsers.
102
+ // 2. Remove the margin in Firefox and Safari.
103
+ button,
104
+ input,
105
+ optgroup,
106
+ select,
107
+ textarea {
108
+ margin: 0; // 2.
109
+ font-family: inherit; // 1.
110
+ font-size: 100%; // 1.
111
+ line-height: 1.15; // 1.
112
+ }
113
+
114
+ // Remove the inheritance of text transform in Firefox.
115
+ button,
116
+ select {
117
+ /* 1 */
118
+ text-transform: none;
119
+ }
120
+
121
+ // Correct the inability to style clickable types in iOS and Safari.
122
+ button,
123
+ [type="button"],
124
+ [type="reset"],
125
+ [type="submit"] {
126
+ appearance: button;
127
+ }
128
+
129
+ // Remove the inner border and padding in Firefox.
130
+ button::-moz-focus-inner,
131
+ [type="button"]::-moz-focus-inner,
132
+ [type="reset"]::-moz-focus-inner,
133
+ [type="submit"]::-moz-focus-inner {
134
+ padding: 0;
135
+ border-style: none;
136
+ }
137
+
138
+ // Restore the focus styles unset by the previous rule.
139
+ button:-moz-focusring,
140
+ [type="button"]:-moz-focusring,
141
+ [type="reset"]:-moz-focusring,
142
+ [type="submit"]:-moz-focusring {
143
+ outline: 1px dotted ButtonText;
144
+ }
145
+
146
+ // Correct the padding in Firefox.
147
+ fieldset {
148
+ padding: 0.35em 0.75em 0.625em;
149
+ }
150
+
151
+ // Remove the padding so developers are not caught out when they zero out `fieldset` elements in all browsers.
152
+ legend {
153
+ padding: 0;
154
+ }
155
+
156
+ // Add the correct vertical alignment in Chrome, Firefox, and Opera.
157
+ progress {
158
+ vertical-align: baseline;
159
+ }
160
+
161
+ // Correct the cursor style of increment and decrement buttons in Chrome.
162
+ [type="number"]::-webkit-inner-spin-button,
163
+ [type="number"]::-webkit-outer-spin-button {
164
+ height: auto;
165
+ }
166
+
167
+ // 1. Correct the odd appearance in Chrome and Safari.
168
+ // 2. Correct the outline style in Safari.
169
+ [type="search"] {
170
+ appearance: textfield; // 1.
171
+ outline-offset: -2px; // 2.
172
+ }
173
+
174
+ // Remove the inner padding in Chrome and Safari on macOS.
175
+ [type="search"]::-webkit-search-decoration {
176
+ appearance: none;
177
+ }
178
+
179
+ // 1. Correct the inability to style clickable types in iOS and Safari.
180
+ // 2. Change font properties to `inherit` in Safari.
181
+ ::-webkit-file-upload-button {
182
+ appearance: button; /* 1 */
183
+ font: inherit; /* 2 */
184
+ }
185
+
186
+ // Interactive.
187
+
188
+ // Add the correct display in Edge, IE 10+, and Firefox.
189
+ details {
190
+ display: block;
191
+ }
192
+
193
+ // Add the correct display in all browsers.
194
+ summary {
195
+ display: list-item;
196
+ }
197
+ }
@@ -1,4 +1,7 @@
1
- // Variables referencing custom properties.
1
+ // @graupl/graupl 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 "sass:map";
@@ -1,5 +1,6 @@
1
- // Graupl base.
1
+ // @gruapl/graupl base styles.
2
2
 
3
+ @forward "button";
3
4
  @forward "form";
4
5
  @forward "link";
5
6
  @forward "table";
@@ -0,0 +1,53 @@
1
+ // @graupl/graupl button base default values.
2
+ //
3
+ // Generally, these should not be used directly when styling bases 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
+ // Button selectors.
12
+ $button-selector: ".button" !default;
13
+ $button-link-selector: ".link" !default;
14
+ $button-theme-selector-prefix: "." !default;
15
+
16
+ // Button properties.
17
+ $button-transform: none !default;
18
+ $button-visited-transform: $button-transform !default;
19
+ $button-focus-transform: $button-transform !default;
20
+ $button-hover-transform: $button-transform !default;
21
+ $button-active-transform: scale(0.95) !default;
22
+ $button-disabled-transform: $button-transform !default;
23
+
24
+ // Button state theme defaults.
25
+ // This map is used to define the default colour shades for the
26
+ // themed button bases.
27
+ //
28
+ // e.g.
29
+ // Primary buttons will use primary--900 as the text colour, primary--100 as the background
30
+ // and primary--900 as the border colour.
31
+ //
32
+ // Secondary/tertiary buttons will use the same shade for their respective colours.
33
+ $base-button-state-theme-map: (
34
+ color: 900,
35
+ border-color: 700,
36
+ visited-color: 900,
37
+ visited-border-color: 700,
38
+ focus-color: 900,
39
+ focus-border-color: 700,
40
+ hover-color: 100,
41
+ hover-background: 700,
42
+ hover-border-color: 700,
43
+ active-color: 100,
44
+ active-background: 700,
45
+ active-border-color: 700,
46
+ disabled-color: 200,
47
+ disabled-border-color: 200,
48
+ );
49
+ $custom-button-state-theme-map: () !default;
50
+ $button-state-theme-map: map.merge(
51
+ $base-button-state-theme-map,
52
+ $custom-button-state-theme-map
53
+ );