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

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 (143) 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 +38 -0
  5. package/dist/base/button.css +1 -1
  6. package/dist/base/button.css.map +1 -1
  7. package/dist/base/form.css.map +1 -1
  8. package/dist/base/link.css.map +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/alert.css +2 -0
  13. package/dist/component/alert.css.map +1 -0
  14. package/dist/component/card.css +1 -1
  15. package/dist/component/card.css.map +1 -1
  16. package/dist/component/carousel.css +2 -0
  17. package/dist/component/carousel.css.map +1 -0
  18. package/dist/component/input-group.css.map +1 -1
  19. package/dist/component/menu.css +1 -1
  20. package/dist/component/menu.css.map +1 -1
  21. package/dist/component/navigation.css.map +1 -1
  22. package/dist/component.css +1 -1
  23. package/dist/component.css.map +1 -1
  24. package/dist/graupl.css +1 -1
  25. package/dist/graupl.css.map +1 -1
  26. package/dist/layout/columns.css.map +1 -1
  27. package/dist/layout/container.css.map +1 -1
  28. package/dist/layout/flex-columns.css.map +1 -1
  29. package/dist/layout.css +1 -1
  30. package/dist/layout.css.map +1 -1
  31. package/dist/normalize.css.map +1 -1
  32. package/dist/state/focus.css.map +1 -1
  33. package/dist/state.css.map +1 -1
  34. package/dist/theme/color.css.map +1 -1
  35. package/dist/theme/typography.css.map +1 -1
  36. package/dist/theme.css.map +1 -1
  37. package/dist/utilities/alignment.css.map +1 -1
  38. package/dist/utilities/color.css.map +1 -1
  39. package/dist/utilities/display.css +1 -1
  40. package/dist/utilities/display.css.map +1 -1
  41. package/dist/utilities/flex.css.map +1 -1
  42. package/dist/utilities/height.css +2 -0
  43. package/dist/utilities/height.css.map +1 -0
  44. package/dist/utilities/inset.css.map +1 -1
  45. package/dist/utilities/justification.css.map +1 -1
  46. package/dist/utilities/list.css.map +1 -1
  47. package/dist/utilities/order.css.map +1 -1
  48. package/dist/utilities/postion.css.map +1 -1
  49. package/dist/utilities/spacing.css.map +1 -1
  50. package/dist/utilities/typography.css.map +1 -1
  51. package/dist/utilities/visibility.css.map +1 -1
  52. package/dist/utilities/width.css +2 -0
  53. package/dist/utilities/width.css.map +1 -0
  54. package/dist/utilities.css +1 -1
  55. package/dist/utilities.css.map +1 -1
  56. package/docs/.vitepress/config.js +39 -12
  57. package/docs/components/alert.md +130 -0
  58. package/docs/components/button.md +84 -0
  59. package/docs/components/card.md +369 -0
  60. package/docs/components/index.md +1 -0
  61. package/docs/components/inputgroup.md +159 -0
  62. package/docs/components/menu.md +326 -0
  63. package/docs/components/navigation.md +158 -0
  64. package/docs/content.md +237 -0
  65. package/docs/defaults.md +121 -0
  66. package/docs/forms.md +79 -0
  67. package/docs/functions.md +9 -0
  68. package/docs/getting-started.md +1 -0
  69. package/docs/index.md +1 -7
  70. package/docs/introduction.md +22 -2
  71. package/docs/layout.md +200 -0
  72. package/docs/mixins.md +47 -0
  73. package/docs/state.md +67 -0
  74. package/docs/theme.md +258 -0
  75. package/docs/utilities.md +357 -0
  76. package/index.html +178 -37
  77. package/package.json +5 -6
  78. package/scss/component/alert.scss +3 -0
  79. package/scss/component/carousel.scss +3 -0
  80. package/scss/utilities/height.scss +3 -0
  81. package/scss/utilities/width.scss +3 -0
  82. package/src/js/alert/Alert.js +511 -0
  83. package/src/js/alert/index.js +21 -0
  84. package/src/js/carousel/Carousel.js +1376 -0
  85. package/src/js/carousel/index.js +20 -0
  86. package/src/js/domHelpers.js +37 -0
  87. package/src/js/eventHandlers.js +32 -0
  88. package/src/js/validate.js +225 -0
  89. package/src/scss/base/_index.scss +1 -1
  90. package/src/scss/base/button/_defaults.scss +7 -0
  91. package/src/scss/base/button/_index.scss +46 -149
  92. package/src/scss/base/button/_mixins.scss +164 -0
  93. package/src/scss/base/form/_index.scss +1 -1
  94. package/src/scss/base/link/_index.scss +1 -1
  95. package/src/scss/base/table/_index.scss +1 -1
  96. package/src/scss/component/_index.scss +3 -1
  97. package/src/scss/component/alert/_defaults.scss +49 -0
  98. package/src/scss/component/alert/_index.scss +118 -0
  99. package/src/scss/component/alert/_variables.scss +170 -0
  100. package/src/scss/component/card/_defaults.scss +3 -0
  101. package/src/scss/component/card/_index.scss +43 -9
  102. package/src/scss/component/carousel/_defaults.scss +43 -0
  103. package/src/scss/component/carousel/_index.scss +182 -0
  104. package/src/scss/component/carousel/_variables.scss +104 -0
  105. package/src/scss/component/input-group/_index.scss +1 -1
  106. package/src/scss/component/menu/_defaults.scss +2 -1
  107. package/src/scss/component/menu/_index.scss +2 -1
  108. package/src/scss/component/menu/_variables.scss +4 -0
  109. package/src/scss/component/navigation/_index.scss +1 -1
  110. package/src/scss/layout/_index.scss +1 -1
  111. package/src/scss/layout/columns/_index.scss +1 -1
  112. package/src/scss/layout/container/_index.scss +1 -1
  113. package/src/scss/layout/flex-columns/_index.scss +1 -1
  114. package/src/scss/mixins/_layer.scss +2 -4
  115. package/src/scss/mixins/_visually-hidden.scss +20 -0
  116. package/src/scss/state/_index.scss +1 -1
  117. package/src/scss/state/focus/_index.scss +1 -1
  118. package/src/scss/theme/_index.scss +1 -1
  119. package/src/scss/theme/color/_index.scss +1 -1
  120. package/src/scss/theme/typography/_index.scss +1 -1
  121. package/src/scss/utilities/_index.scss +3 -1
  122. package/src/scss/utilities/alignment/_index.scss +1 -1
  123. package/src/scss/utilities/color/_index.scss +1 -1
  124. package/src/scss/utilities/display/_defaults.scss +2 -0
  125. package/src/scss/utilities/display/_index.scss +11 -1
  126. package/src/scss/utilities/flex/_index.scss +1 -1
  127. package/src/scss/utilities/height/_defaults.scss +38 -0
  128. package/src/scss/utilities/height/_index.scss +23 -0
  129. package/src/scss/utilities/height/_variables.scss +6 -0
  130. package/src/scss/utilities/inset/_index.scss +1 -1
  131. package/src/scss/utilities/justification/_index.scss +1 -1
  132. package/src/scss/utilities/list/_index.scss +1 -1
  133. package/src/scss/utilities/order/_index.scss +1 -1
  134. package/src/scss/utilities/position/_index.scss +1 -1
  135. package/src/scss/utilities/ratio/_defaults.scss +1 -0
  136. package/src/scss/utilities/ratio/_index.scss +9 -1
  137. package/src/scss/utilities/spacing/_index.scss +1 -1
  138. package/src/scss/utilities/typography/_index.scss +1 -1
  139. package/src/scss/utilities/visibility/_index.scss +1 -1
  140. package/src/scss/utilities/width/_defaults.scss +38 -0
  141. package/src/scss/utilities/width/_index.scss +23 -0
  142. package/src/scss/utilities/width/_variables.scss +6 -0
  143. package/stylelint.config.js +5 -0
@@ -0,0 +1,20 @@
1
+ import Carousel from "./Carousel.js";
2
+
3
+ document.addEventListener("DOMContentLoaded", () => {
4
+ const carousels = [];
5
+
6
+ document.querySelectorAll(".carousel").forEach((carouselElement) => {
7
+ const carousel = new Carousel({
8
+ carouselElement,
9
+ initialize: true,
10
+ });
11
+
12
+ carousels.push(carousel);
13
+ });
14
+
15
+ const graupl = window.Graupl || {};
16
+
17
+ graupl.carousels = carousels;
18
+
19
+ window.Graupl = graupl;
20
+ });
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Add a class or array of classes to an element.
3
+ *
4
+ * @param {string|string[]} className - The class or classes to add.
5
+ * @param {HTMLElement} element - The element to add the class to.
6
+ */
7
+ export function addClass(className, element) {
8
+ // Gracefully handle empty strings or arrays.
9
+ if (className === "" || className.length === 0) {
10
+ return;
11
+ }
12
+
13
+ if (typeof className === "string") {
14
+ element.classList.add(className);
15
+ } else {
16
+ element.classList.add(...className);
17
+ }
18
+ }
19
+
20
+ /**
21
+ * Remove a class or array of classes from an element.
22
+ *
23
+ * @param {string|string[]} className - The class or classes to remove.
24
+ * @param {HTMLElement} element - The element to remove the class from.
25
+ */
26
+ export function removeClass(className, element) {
27
+ // Gracefully handle empty strings or arrays.
28
+ if (className === "" || className.length === 0) {
29
+ return;
30
+ }
31
+
32
+ if (typeof className === "string") {
33
+ element.classList.remove(className);
34
+ } else {
35
+ element.classList.remove(...className);
36
+ }
37
+ }
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Retrieves the pressed key from an event.
3
+ *
4
+ * @param {KeyboardEvent} event - The keyboard event.
5
+ * @return {string} - The name of the key or an empty string.
6
+ */
7
+ export function keyPress(event) {
8
+ try {
9
+ // Use event.key or event.keyCode to support older browsers.
10
+ const key = event.key || event.keyCode;
11
+ const keys = {
12
+ Enter: key === "Enter" || key === 13,
13
+ Space: key === " " || key === "Spacebar" || key === 32,
14
+ Escape: key === "Escape" || key === "Esc" || key === 27,
15
+ };
16
+
17
+ return Object.keys(keys).find((key) => keys[key] === true) || "";
18
+ } catch {
19
+ // Return an empty string if something goes wrong.
20
+ return "";
21
+ }
22
+ }
23
+
24
+ /**
25
+ * Stops an event from taking action.
26
+ *
27
+ * @param {Event} event - The event.
28
+ */
29
+ export function preventEvent(event) {
30
+ event.preventDefault();
31
+ event.stopPropagation();
32
+ }
@@ -0,0 +1,225 @@
1
+ /**
2
+ * Check to see if the provided elements have a specific contructor.
3
+ *
4
+ * The values must be provided inside of an object
5
+ * so the variable name can be retrieved in case of errors.
6
+ *
7
+ * This is essentially just a wrapper function around checking instanceof with
8
+ * more descriptive error message to help debugging.
9
+ *
10
+ * Will return `{ status: true }` if the check is successful.
11
+ *
12
+ * @param {object} contructor - The constructor to check for.
13
+ * @param {object} elements - The element(s) to check.
14
+ * @return {Object<boolean, string>} - The result of the check.
15
+ */
16
+ export function isValidInstance(contructor, elements) {
17
+ try {
18
+ if (typeof elements !== "object") {
19
+ const elementsType = typeof elements;
20
+
21
+ throw new TypeError(
22
+ `Elements given to isValidInstance() must be inside of an object. "${elementsType}" given.`
23
+ );
24
+ }
25
+
26
+ for (const key in elements) {
27
+ if (!(elements[key] instanceof contructor)) {
28
+ const elementType = typeof elements[key];
29
+ throw new TypeError(
30
+ `${key} must be an instance of ${contructor.name}. "${elementType}" given.`
31
+ );
32
+ }
33
+ }
34
+
35
+ return {
36
+ status: true,
37
+ error: null,
38
+ };
39
+ } catch (error) {
40
+ return {
41
+ status: false,
42
+ error,
43
+ };
44
+ }
45
+ }
46
+
47
+ /**
48
+ * Check to see if the provided values are of a specific type.
49
+ *
50
+ * The values must be provided inside of an object
51
+ * so the variable name can be retrieved in case of errors.
52
+ *
53
+ * This is essentially just a wrapper function around checking typeof with
54
+ * more descriptive error message to help debugging.
55
+ *
56
+ * Will return `{ status: true }` if the check is successful.
57
+ *
58
+ * @param {string} type - The type to check for.
59
+ * @param {object} values - The value(s) to check.
60
+ * @return {Object<boolean, string>} - The result of the check.
61
+ */
62
+ export function isValidType(type, values) {
63
+ try {
64
+ if (typeof values !== "object") {
65
+ const valuesType = typeof values;
66
+
67
+ throw new TypeError(
68
+ `Values given to isValidType() must be inside of an object. "${valuesType}" given.`
69
+ );
70
+ }
71
+
72
+ for (const key in values) {
73
+ const valueType = typeof values[key];
74
+
75
+ if (valueType !== type) {
76
+ throw new TypeError(`${key} must be a ${type}. "${valueType}" given.`);
77
+ }
78
+ }
79
+
80
+ return {
81
+ status: true,
82
+ error: null,
83
+ };
84
+ } catch (error) {
85
+ return {
86
+ status: false,
87
+ error,
88
+ };
89
+ }
90
+ }
91
+
92
+ /**
93
+ * Checks to see if the provided values are valid query selectors.
94
+ *
95
+ * The values must be provided inside of an object
96
+ * so the variable name can be retrieved in case of errors.
97
+ *
98
+ * Will return `{ status: true }` if the check is successful.
99
+ *
100
+ * @param {Object<string>} values - The value(s) to check.
101
+ * @return {Object<boolean, string>} - The result of the check.
102
+ */
103
+ export function isQuerySelector(values) {
104
+ try {
105
+ if (typeof values !== "object") {
106
+ const type = typeof values;
107
+
108
+ throw new TypeError(
109
+ `Values given to isQuerySelector() must be inside of an object. "${type}" given.`
110
+ );
111
+ }
112
+
113
+ for (const key in values) {
114
+ try {
115
+ if (values[key] === null) {
116
+ throw new Error();
117
+ }
118
+
119
+ document.querySelector(values[key]);
120
+ } catch {
121
+ throw new TypeError(
122
+ `${key} must be a valid query selector. "${values[key]}" given.`
123
+ );
124
+ }
125
+ }
126
+
127
+ return {
128
+ status: true,
129
+ error: null,
130
+ };
131
+ } catch (error) {
132
+ return {
133
+ status: false,
134
+ error,
135
+ };
136
+ }
137
+ }
138
+
139
+ /**
140
+ * Checks to see if the provided value is either a string or an array of strings.
141
+ *
142
+ * The values must be provided inside of an object
143
+ * so the variable name can be retrieved in case of errors.
144
+ *
145
+ * Will return `{ status: true }` if the check is successful.
146
+ *
147
+ * @param {Object<string, string[]>} values - The value(s) to check.
148
+ * @return {Object<boolean, string>} - The result of the check.
149
+ */
150
+ export function isValidClassList(values) {
151
+ try {
152
+ if (typeof values !== "object" || Array.isArray(values)) {
153
+ const type = typeof values;
154
+
155
+ throw new TypeError(
156
+ `Values given to isValidClassList() must be inside of an object. "${type}" given.`
157
+ );
158
+ }
159
+
160
+ for (const key in values) {
161
+ const type = typeof values[key];
162
+
163
+ if (type !== "string") {
164
+ if (Array.isArray(values[key])) {
165
+ values[key].forEach((value) => {
166
+ if (typeof value !== "string") {
167
+ throw new TypeError(
168
+ `${key} must be a string or an array of strings. An array containing non-strings given.`
169
+ );
170
+ }
171
+ });
172
+ } else {
173
+ throw new TypeError(
174
+ `${key} must be a string or an array of strings. "${type}" given.`
175
+ );
176
+ }
177
+ } else {
178
+ const obj = {};
179
+ obj[key] = values[key];
180
+
181
+ isQuerySelector(obj);
182
+ }
183
+ }
184
+
185
+ return {
186
+ status: true,
187
+ error: null,
188
+ };
189
+ } catch (error) {
190
+ return {
191
+ status: false,
192
+ error,
193
+ };
194
+ }
195
+ }
196
+
197
+ /**
198
+ * Checks to see if the provided elements are using a specific tag.
199
+ *
200
+ * The elements must be provided inside of an object
201
+ * so the variable name can be retrieved in case of errors.
202
+ *
203
+ * Will return `true` if the check is successful.
204
+ *
205
+ * @param {string} tagName - The name of the tag.
206
+ * @param {Object<HTMLElement>} elements - The element(s) to check.
207
+ * @return {boolean} - The result of the check.
208
+ */
209
+ export function isTag(tagName, elements) {
210
+ if (
211
+ isValidType("string", { tagName }).status &&
212
+ isValidInstance(HTMLElement, elements).status
213
+ ) {
214
+ const tag = tagName.toLowerCase();
215
+ let check = true;
216
+
217
+ for (const key in elements) {
218
+ if (elements[key].tagName.toLowerCase() !== tag) check = false;
219
+ }
220
+
221
+ return check;
222
+ } else {
223
+ return false;
224
+ }
225
+ }
@@ -1,4 +1,4 @@
1
- // @gruapl/graupl base styles.
1
+ // @graupl/graupl base styles.
2
2
 
3
3
  @forward "button";
4
4
  @forward "form";
@@ -13,6 +13,13 @@ $button-selector: ".button" !default;
13
13
  $button-link-selector: ".link" !default;
14
14
  $button-theme-selector-prefix: "." !default;
15
15
 
16
+ // State selectors.
17
+ $button-active-selector: ".active" !default;
18
+ $button-disabled-selector: ".disabled" !default;
19
+ $button-focus-selector: ".focus" !default;
20
+ $button-hover-selector: ".hover" !default;
21
+ $button-visited-selector: ".visited" !default;
22
+
16
23
  // Button properties.
17
24
  $button-transform: none !default;
18
25
  $button-visited-transform: $button-transform !default;
@@ -1,80 +1,58 @@
1
- // @gruapl/graupl button base styles.
1
+ // @graupl/graupl button base styles.
2
2
 
3
3
  @use "defaults";
4
4
  @use "../../defaults" as root-defaults;
5
5
  @use "../link/defaults" as link-defaults;
6
- @use "../../theme/color/variables" as color;
7
6
  @use "../../base/link/variables" as link;
8
7
  @use "variables" as *;
8
+ @use "mixins" as *;
9
9
  @use "../../mixins/layer" as *;
10
- @use "../../mixins/media-queries" as *;
11
- @use "../../functions/theme";
12
- @use "sass:map";
13
10
 
14
- @include layer(base) {
15
- #{defaults.$button-selector} {
16
- display: flex;
17
- align-items: center;
18
- justify-content: center;
19
- min-width: $button-min-width;
20
- min-height: $button-min-height;
21
- padding: $button-padding;
22
- transform: $button-transform;
23
- transition: $button-transition;
24
- border: $button-border;
25
- border-radius: $button-border-radius;
26
- font-size: $button-font-size;
27
- cursor: pointer;
28
-
29
- &:visited {
30
- --#{root-defaults.$prefix}-button-transform: #{$button-visited-transform};
31
- }
32
-
33
- &:focus-visible {
34
- --#{root-defaults.$prefix}-button-transform: #{$button-focus-transform};
35
- }
36
-
37
- &:hover {
38
- --#{root-defaults.$prefix}-button-transform: #{$button-hover-transform};
39
- }
40
-
41
- &:active {
42
- --#{root-defaults.$prefix}-button-transform: #{$button-active-transform};
43
- }
44
-
45
- &:disabled,
46
- &[disabled] {
47
- cursor: not-allowed;
48
-
49
- &,
50
- &:visited,
51
- &:focus-visible,
52
- &:hover,
53
- &:active {
54
- --#{root-defaults.$prefix}-button-transform: #{$button-disabled-transform};
55
- }
56
- }
57
-
58
- &#{defaults.$button-link-selector} {
59
- --#{root-defaults.$prefix}-button-padding: #{link.$link-padding};
60
- --#{root-defaults.$prefix}-button-transition: #{link.$link-transition};
61
- --#{root-defaults.$prefix}-button-transition-reduced-motion: #{link.$link-transition-reduced-motion};
62
- --#{root-defaults.$prefix}-button-transform: #{link.$link-transform};
63
- --#{root-defaults.$prefix}-button-visited-transform: #{link.$link-visited-transform};
64
- --#{root-defaults.$prefix}-button-focus-transform: #{link.$link-transform};
65
- --#{root-defaults.$prefix}-button-hover-transform: #{link.$link-hover-transform};
66
- --#{root-defaults.$prefix}-button-active-transform: #{link.$link-active-transform};
67
- --#{root-defaults.$prefix}-button-border-width: #{link.$link-border-width};
68
- --#{root-defaults.$prefix}-button-border-style: #{link.$link-border-style};
69
- --#{root-defaults.$prefix}-button-border-radius: #{link.$link-border-radius};
70
- --#{root-defaults.$prefix}-button-min-width: #{link.$link-min-width};
71
- --#{root-defaults.$prefix}-button-min-height: #{link.$link-min-height};
72
- --#{root-defaults.$prefix}-button-font-size: inherit;
11
+ #{defaults.$button-selector} {
12
+ @include apply-button;
13
+
14
+ &#{defaults.$button-link-selector} {
15
+ --#{root-defaults.$prefix}-button-padding: #{link.$link-padding};
16
+ --#{root-defaults.$prefix}-button-transition: #{link.$link-transition};
17
+ --#{root-defaults.$prefix}-button-transition-reduced-motion: #{link.$link-transition-reduced-motion};
18
+ --#{root-defaults.$prefix}-button-transform: #{link.$link-transform};
19
+ --#{root-defaults.$prefix}-button-visited-transform: #{link.$link-visited-transform};
20
+ --#{root-defaults.$prefix}-button-focus-transform: #{link.$link-transform};
21
+ --#{root-defaults.$prefix}-button-hover-transform: #{link.$link-hover-transform};
22
+ --#{root-defaults.$prefix}-button-active-transform: #{link.$link-active-transform};
23
+ --#{root-defaults.$prefix}-button-border-width: #{link.$link-border-width};
24
+ --#{root-defaults.$prefix}-button-border-style: #{link.$link-border-style};
25
+ --#{root-defaults.$prefix}-button-border-radius: #{link.$link-border-radius};
26
+ --#{root-defaults.$prefix}-button-min-width: #{link.$link-min-width};
27
+ --#{root-defaults.$prefix}-button-min-height: #{link.$link-min-height};
28
+ --#{root-defaults.$prefix}-button-font-size: inherit;
29
+
30
+ text-decoration: link.$link-text-decoration;
31
+ text-decoration-thickness: link.$link-text-decoration-thickness;
32
+ text-decoration-style: link.$link-text-decoration-style;
33
+ }
34
+ }
73
35
 
74
- text-decoration: link.$link-text-decoration;
75
- text-decoration-thickness: link.$link-text-decoration-thickness;
76
- text-decoration-style: link.$link-text-decoration-style;
77
- }
36
+ @include layer(base) {
37
+ #{defaults.$button-selector}#{defaults.$button-link-selector} {
38
+ --#{root-defaults.$prefix}-button-color: #{link.$link-color};
39
+ --#{root-defaults.$prefix}-button-visited-color: #{link.$link-visited-color};
40
+ --#{root-defaults.$prefix}-button-focus-color: #{link.$link-focus-color};
41
+ --#{root-defaults.$prefix}-button-hover-color: #{link.$link-hover-color};
42
+ --#{root-defaults.$prefix}-button-active-color: #{link.$link-active-color};
43
+ --#{root-defaults.$prefix}-button-disabled-color: #{link.$link-disabled-color};
44
+ --#{root-defaults.$prefix}-button-background: #{link.$link-background};
45
+ --#{root-defaults.$prefix}-button-visited-background: #{link.$link-visited-background};
46
+ --#{root-defaults.$prefix}-button-focus-background: #{link.$link-focus-background};
47
+ --#{root-defaults.$prefix}-button-hover-background: #{link.$link-hover-background};
48
+ --#{root-defaults.$prefix}-button-active-background: #{link.$link-active-background};
49
+ --#{root-defaults.$prefix}-button-disabled-background: #{link.$link-disabled-background};
50
+ --#{root-defaults.$prefix}-button-border-color: #{link.$link-border-color};
51
+ --#{root-defaults.$prefix}-button-visited-border-color: #{link.$link-visited-border-color};
52
+ --#{root-defaults.$prefix}-button-focus-border-color: #{link.$link-focus-border-color};
53
+ --#{root-defaults.$prefix}-button-hover-border-color: #{link.$link-hover-border-color};
54
+ --#{root-defaults.$prefix}-button-active-border-color: #{link.$link-active-border-color};
55
+ --#{root-defaults.$prefix}-button-disabled-border-color: #{link.$link-disabled-border-color};
78
56
  }
79
57
 
80
58
  #{link-defaults.$link-selector} {
@@ -101,90 +79,9 @@
101
79
  --#{root-defaults.$prefix}-link-disabled-text-decoration: none;
102
80
  }
103
81
  }
104
-
105
- @include animation-off {
106
- #{defaults.$button-selector} {
107
- --#{root-defaults.$prefix}-button-transition: #{$button-transition-reduced-motion};
108
- }
109
- }
110
82
  }
111
83
 
112
84
  @include layer(theme) {
113
- #{defaults.$button-selector} {
114
- border-color: $button-border-color;
115
- background: $button-background;
116
- color: $button-color;
117
-
118
- @each $color, $map in color.$theme-active {
119
- &#{defaults.$button-theme-selector-prefix}#{$color} {
120
- @each $prop, $shade in defaults.$button-state-theme-map {
121
- --#{root-defaults.$prefix}-button-#{$prop}: #{theme.get(
122
- $color,
123
- $shade
124
- )};
125
- }
126
- }
127
- }
128
-
129
- &#{defaults.$button-link-selector} {
130
- --#{root-defaults.$prefix}-button-color: #{link.$link-color};
131
- --#{root-defaults.$prefix}-button-visited-color: #{link.$link-visited-color};
132
- --#{root-defaults.$prefix}-button-focus-color: #{link.$link-focus-color};
133
- --#{root-defaults.$prefix}-button-hover-color: #{link.$link-hover-color};
134
- --#{root-defaults.$prefix}-button-active-color: #{link.$link-active-color};
135
- --#{root-defaults.$prefix}-button-disabled-color: #{link.$link-disabled-color};
136
- --#{root-defaults.$prefix}-button-background: #{link.$link-background};
137
- --#{root-defaults.$prefix}-button-visited-background: #{link.$link-visited-background};
138
- --#{root-defaults.$prefix}-button-focus-background: #{link.$link-focus-background};
139
- --#{root-defaults.$prefix}-button-hover-background: #{link.$link-hover-background};
140
- --#{root-defaults.$prefix}-button-active-background: #{link.$link-active-background};
141
- --#{root-defaults.$prefix}-button-disabled-background: #{link.$link-disabled-background};
142
- --#{root-defaults.$prefix}-button-border-color: #{link.$link-border-color};
143
- --#{root-defaults.$prefix}-button-visited-border-color: #{link.$link-visited-border-color};
144
- --#{root-defaults.$prefix}-button-focus-border-color: #{link.$link-focus-border-color};
145
- --#{root-defaults.$prefix}-button-hover-border-color: #{link.$link-hover-border-color};
146
- --#{root-defaults.$prefix}-button-active-border-color: #{link.$link-active-border-color};
147
- --#{root-defaults.$prefix}-button-disabled-border-color: #{link.$link-disabled-border-color};
148
- }
149
-
150
- &:visited {
151
- --#{root-defaults.$prefix}-button-border-color: #{$button-visited-border-color};
152
- --#{root-defaults.$prefix}-button-background: #{$button-visited-background};
153
- --#{root-defaults.$prefix}-button-color: #{$button-visited-color};
154
- }
155
-
156
- &:focus-visible {
157
- --#{root-defaults.$prefix}-button-border-color: #{$button-focus-border-color};
158
- --#{root-defaults.$prefix}-button-background: #{$button-focus-background};
159
- --#{root-defaults.$prefix}-button-color: #{$button-focus-color};
160
- }
161
-
162
- &:hover {
163
- --#{root-defaults.$prefix}-button-border-color: #{$button-hover-border-color};
164
- --#{root-defaults.$prefix}-button-background: #{$button-hover-background};
165
- --#{root-defaults.$prefix}-button-color: #{$button-hover-color};
166
- }
167
-
168
- &:active {
169
- --#{root-defaults.$prefix}-button-border-color: #{$button-active-border-color};
170
- --#{root-defaults.$prefix}-button-background: #{$button-active-background};
171
- --#{root-defaults.$prefix}-button-color: #{$button-active-color};
172
- }
173
-
174
- &:disabled,
175
- &[disabled] {
176
- &,
177
- &:visited,
178
- &:focus-visible,
179
- &:hover,
180
- &:active {
181
- --#{root-defaults.$prefix}-button-border-color: #{$button-disabled-border-color};
182
- --#{root-defaults.$prefix}-button-background: #{$button-disabled-background};
183
- --#{root-defaults.$prefix}-button-color: #{$button-disabled-color};
184
- }
185
- }
186
- }
187
-
188
85
  #{link-defaults.$link-selector} {
189
86
  &#{defaults.$button-selector}:not(#{defaults.$button-link-selector}) {
190
87
  --#{root-defaults.$prefix}-link-color: #{$button-color};