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

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 (151) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/base/button.css +2 -0
  3. package/dist/base/button.css.map +1 -0
  4. package/dist/base/form.css.map +1 -1
  5. package/dist/base/link.css +1 -1
  6. package/dist/base/link.css.map +1 -1
  7. package/dist/base/table.css +1 -1
  8. package/dist/base/table.css.map +1 -1
  9. package/dist/base.css +1 -1
  10. package/dist/base.css.map +1 -1
  11. package/dist/component/input-group.css.map +1 -1
  12. package/dist/component.css +1 -1
  13. package/dist/component.css.map +1 -1
  14. package/dist/graupl.css +1 -1
  15. package/dist/graupl.css.map +1 -1
  16. package/dist/init.css +2 -0
  17. package/dist/init.css.map +1 -0
  18. package/dist/layout/columns.css.map +1 -1
  19. package/dist/layout/container.css.map +1 -1
  20. package/dist/layout.css +1 -1
  21. package/dist/layout.css.map +1 -1
  22. package/dist/normalize.css +2 -0
  23. package/dist/normalize.css.map +1 -0
  24. package/dist/state/focus.css.map +1 -1
  25. package/dist/state.css.map +1 -1
  26. package/dist/theme/color.css.map +1 -1
  27. package/dist/theme/typography.css.map +1 -1
  28. package/dist/theme.css.map +1 -1
  29. package/dist/utilities/spacing.css +1 -1
  30. package/dist/utilities/spacing.css.map +1 -1
  31. package/dist/utilities.css +1 -1
  32. package/dist/utilities.css.map +1 -1
  33. package/index.html +6 -7
  34. package/package.json +2 -1
  35. package/scss/base/button.scss +3 -0
  36. package/scss/base/form.scss +1 -1
  37. package/scss/base/link.scss +1 -1
  38. package/scss/base/table.scss +1 -1
  39. package/scss/base.scss +1 -1
  40. package/scss/component/input-group.scss +1 -1
  41. package/scss/component.scss +1 -1
  42. package/scss/graupl.scss +1 -3
  43. package/scss/init.scss +3 -0
  44. package/scss/layout/columns.scss +1 -1
  45. package/scss/layout/container.scss +1 -1
  46. package/scss/layout.scss +1 -1
  47. package/scss/normalize.scss +3 -0
  48. package/scss/state/focus.scss +1 -1
  49. package/scss/state.scss +1 -1
  50. package/scss/theme/color.scss +1 -1
  51. package/scss/theme/typography.scss +1 -1
  52. package/scss/theme.scss +1 -1
  53. package/scss/utilities/alignment.scss +1 -1
  54. package/scss/utilities/color.scss +1 -1
  55. package/scss/utilities/display.scss +1 -1
  56. package/scss/utilities/flex.scss +1 -1
  57. package/scss/utilities/inset.scss +1 -1
  58. package/scss/utilities/justification.scss +1 -1
  59. package/scss/utilities/list.scss +1 -1
  60. package/scss/utilities/postion.scss +1 -1
  61. package/scss/utilities/spacing.scss +1 -1
  62. package/scss/utilities/typography.scss +1 -1
  63. package/scss/utilities/visibility.scss +1 -1
  64. package/scss/utilities.scss +1 -1
  65. package/src/scss/_defaults.scss +6 -4
  66. package/src/scss/_index.scss +4 -3
  67. package/src/scss/_init.scss +2 -2
  68. package/src/scss/_normalize.scss +197 -0
  69. package/src/scss/_variables.scss +4 -1
  70. package/src/scss/base/_index.scss +2 -1
  71. package/src/scss/{component → base}/button/_defaults.scss +14 -5
  72. package/src/scss/{component → base}/button/_index.scss +40 -27
  73. package/src/scss/{component → base}/button/_variables.scss +8 -1
  74. package/src/scss/base/form/_defaults.scss +14 -4
  75. package/src/scss/base/form/_index.scss +21 -16
  76. package/src/scss/base/form/_variables.scss +4 -1
  77. package/src/scss/base/link/_defaults.scss +16 -4
  78. package/src/scss/base/link/_index.scss +31 -7
  79. package/src/scss/base/link/_variables.scss +65 -1
  80. package/src/scss/base/table/_defaults.scss +49 -4
  81. package/src/scss/base/table/_index.scss +104 -8
  82. package/src/scss/base/table/_variables.scss +63 -1
  83. package/src/scss/component/_index.scss +1 -3
  84. package/src/scss/component/input-group/_defaults.scss +11 -4
  85. package/src/scss/component/input-group/_index.scss +11 -9
  86. package/src/scss/component/input-group/_variables.scss +4 -1
  87. package/src/scss/functions/_important.scss +2 -0
  88. package/src/scss/functions/_theme.scss +2 -0
  89. package/src/scss/layout/_index.scss +1 -1
  90. package/src/scss/layout/columns/_defaults.scss +12 -4
  91. package/src/scss/layout/columns/_index.scss +5 -5
  92. package/src/scss/layout/columns/_variables.scss +4 -1
  93. package/src/scss/layout/container/_defaults.scss +13 -4
  94. package/src/scss/layout/container/_index.scss +12 -7
  95. package/src/scss/layout/container/_variables.scss +4 -1
  96. package/src/scss/mixins/_layer.scss +1 -1
  97. package/src/scss/mixins/_media-queries.scss +2 -1
  98. package/src/scss/state/_index.scss +1 -1
  99. package/src/scss/state/focus/_defaults.scss +6 -4
  100. package/src/scss/state/focus/_index.scss +1 -1
  101. package/src/scss/state/focus/_variables.scss +4 -1
  102. package/src/scss/theme/_index.scss +1 -1
  103. package/src/scss/theme/color/_defaults.scss +6 -4
  104. package/src/scss/theme/color/_index.scss +1 -1
  105. package/src/scss/theme/color/_variables.scss +4 -1
  106. package/src/scss/theme/typography/_defaults.scss +6 -4
  107. package/src/scss/theme/typography/_index.scss +1 -1
  108. package/src/scss/theme/typography/_variables.scss +4 -1
  109. package/src/scss/utilities/_index.scss +1 -1
  110. package/src/scss/utilities/alignment/_defaults.scss +6 -4
  111. package/src/scss/utilities/alignment/_index.scss +1 -1
  112. package/src/scss/utilities/alignment/_variables.scss +4 -1
  113. package/src/scss/utilities/color/_defaults.scss +6 -4
  114. package/src/scss/utilities/color/_index.scss +1 -1
  115. package/src/scss/utilities/color/_variables.scss +4 -1
  116. package/src/scss/utilities/display/_defaults.scss +6 -4
  117. package/src/scss/utilities/display/_index.scss +1 -1
  118. package/src/scss/utilities/display/_variables.scss +4 -1
  119. package/src/scss/utilities/flex/_defaults.scss +6 -4
  120. package/src/scss/utilities/flex/_index.scss +1 -1
  121. package/src/scss/utilities/flex/_variables.scss +4 -1
  122. package/src/scss/utilities/inset/_defaults.scss +6 -4
  123. package/src/scss/utilities/inset/_index.scss +1 -1
  124. package/src/scss/utilities/inset/_variables.scss +4 -1
  125. package/src/scss/utilities/justification/_defaults.scss +6 -4
  126. package/src/scss/utilities/justification/_index.scss +1 -1
  127. package/src/scss/utilities/justification/_variables.scss +4 -1
  128. package/src/scss/utilities/list/_defaults.scss +6 -4
  129. package/src/scss/utilities/list/_index.scss +1 -1
  130. package/src/scss/utilities/list/_variables.scss +4 -1
  131. package/src/scss/utilities/position/_defaults.scss +6 -4
  132. package/src/scss/utilities/position/_index.scss +1 -1
  133. package/src/scss/utilities/position/_variables.scss +4 -1
  134. package/src/scss/utilities/spacing/_defaults.scss +6 -4
  135. package/src/scss/utilities/spacing/_index.scss +8 -1
  136. package/src/scss/utilities/spacing/_variables.scss +4 -1
  137. package/src/scss/utilities/typography/_defaults.scss +6 -4
  138. package/src/scss/utilities/typography/_index.scss +1 -1
  139. package/src/scss/utilities/typography/_variables.scss +4 -1
  140. package/src/scss/utilities/visibility/_defaults.scss +6 -4
  141. package/src/scss/utilities/visibility/_index.scss +1 -1
  142. package/src/scss/utilities/visibility/_variables.scss +4 -1
  143. package/dist/component/button.css +0 -2
  144. package/dist/component/button.css.map +0 -1
  145. package/dist/component/table.css +0 -2
  146. package/dist/component/table.css.map +0 -1
  147. package/scss/component/button.scss +0 -3
  148. package/scss/component/table.scss +0 -3
  149. package/src/scss/component/table/_defaults.scss +0 -30
  150. package/src/scss/component/table/_index.scss +0 -77
  151. package/src/scss/component/table/_variables.scss +0 -64
@@ -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";
@@ -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
 
@@ -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";
@@ -1,11 +1,20 @@
1
- // Default values for Graupl.
1
+ // @graupl/graupl button base 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 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.
6
8
 
7
9
  @use "sass:map";
8
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;
9
18
  $button-hover-transform: none !default;
10
19
  $button-hover-transform-reduced-motion: none !default;
11
20
  $button-active-transform: scale(0.95) !default;
@@ -13,7 +22,7 @@ $button-active-transform-reduced-motion: scale(0.98) !default;
13
22
 
14
23
  // Button state theme defaults.
15
24
  // This map is used to define the default colour shades for the
16
- // themed button components.
25
+ // themed button bases.
17
26
  //
18
27
  // e.g.
19
28
  // Primary buttons will use primary--900 as the text colour, primary--100 as the background
@@ -1,4 +1,4 @@
1
- // Graupl Button Component.
1
+ // @gruapl/graupl button base styles.
2
2
 
3
3
  @use "defaults";
4
4
  @use "../../defaults" as root-defaults;
@@ -9,14 +9,15 @@
9
9
  @use "../../mixins/media-queries" as *;
10
10
  @use "sass:map";
11
11
 
12
- @include layer(component) {
13
- .button {
12
+ @include layer(base) {
13
+ #{defaults.$button-selector} {
14
14
  display: flex;
15
15
  align-items: center;
16
16
  justify-content: center;
17
17
  min-width: $button-min-width;
18
18
  min-height: $button-min-height;
19
19
  padding: $button-padding;
20
+ transform: $button-transform;
20
21
  transition: $button-transition;
21
22
  border-width: $button-border-width;
22
23
  border-style: $button-border-style;
@@ -25,14 +26,25 @@
25
26
  cursor: pointer;
26
27
 
27
28
  &:hover {
28
- transform: $button-hover-transform;
29
+ --#{root-defaults.$prefix}-button-transform: #{$button-hover-transform};
29
30
  }
30
31
 
31
32
  &:active {
32
- transform: $button-active-transform;
33
+ --#{root-defaults.$prefix}-button-transform: #{$button-active-transform};
33
34
  }
34
35
 
35
- &:disabled {
36
+ &:not(#{defaults.$button-link-selector}) {
37
+ --#{root-defaults.$prefix}-link-text-decoration: none;
38
+ --#{root-defaults.$prefix}-link-padding: #{$button-padding};
39
+ --#{root-defaults.$prefix}-link-transition: #{$button-transition};
40
+ --#{root-defaults.$prefix}-link-transition-reduced-motion: #{$button-transition-reduced-motion};
41
+ --#{root-defaults.$prefix}-link-transform: #{$button-transform};
42
+ --#{root-defaults.$prefix}-link-hover-transform: #{$button-hover-transform};
43
+ --#{root-defaults.$prefix}-link-active-transform: #{$button-active-transform};
44
+ }
45
+
46
+ &:disabled,
47
+ &[disabled] {
36
48
  cursor: not-allowed;
37
49
 
38
50
  &:hover,
@@ -41,10 +53,16 @@
41
53
  }
42
54
  }
43
55
 
44
- &.link {
56
+ &#{defaults.$button-link-selector} {
57
+ --#{root-defaults.$prefix}-button-padding: #{link.$link-padding};
58
+ --#{root-defaults.$prefix}-button-transition: #{link.$link-transition};
59
+ --#{root-defaults.$prefix}-button-transition-reduced-motion: #{link.$link-transition-reduced-motion};
60
+ --#{root-defaults.$prefix}-button-transform: #{link.$link-transform};
61
+ --#{root-defaults.$prefix}-button-hover-transform: #{link.$link-hover-transform};
62
+ --#{root-defaults.$prefix}-button-active-transform: #{link.$link-active-transform};
63
+
45
64
  min-width: auto;
46
65
  min-height: auto;
47
- padding: 0;
48
66
  border: 0;
49
67
  font-size: inherit;
50
68
  text-decoration: link.$link-text-decoration;
@@ -53,43 +71,37 @@
53
71
  }
54
72
 
55
73
  @include animation-off {
56
- .button {
57
- transition: $button-transition-reduced-motion;
58
-
59
- &:hover {
60
- transform: $button-hover-transform-reduced-motion;
61
- }
62
-
63
- &:active {
64
- transform: $button-active-transform-reduced-motion;
65
- }
74
+ #{defaults.$button-selector} {
75
+ --#{root-defaults.$prefix}-button-transition: #{$button-transition-reduced-motion};
76
+ --#{root-defaults.$prefix}-button-hover-transform: #{$button-hover-transform-reduced-motion};
77
+ --#{root-defaults.$prefix}-button-active-transform: #{$button-active-transform-reduced-motion};
66
78
  }
67
79
  }
68
80
  }
69
81
 
70
82
  @include layer(theme) {
71
- .button {
83
+ #{defaults.$button-selector} {
72
84
  border-color: $button-border-color;
73
85
  background: $button-background;
74
86
  color: $button-color;
75
87
 
76
88
  @each $color, $map in color.$theme-active {
77
- &.#{$color} {
89
+ &#{defaults.$button-theme-selector-prefix}#{$color} {
78
90
  @each $prop, $shade in defaults.$button-state-theme-map {
79
91
  --#{root-defaults.$prefix}-button-#{$prop}: #{map.get($map, $shade)};
80
92
  }
81
93
  }
82
94
  }
83
95
 
84
- &.link {
96
+ &#{defaults.$button-link-selector} {
85
97
  --#{root-defaults.$prefix}-button-color: #{link.$link-color};
86
98
  --#{root-defaults.$prefix}-button-hover-color: #{link.$link-hover-color};
87
99
  --#{root-defaults.$prefix}-button-active-color: #{link.$link-active-color};
88
100
  --#{root-defaults.$prefix}-button-disabled-color: #{link.$link-disabled-color};
89
- --#{root-defaults.$prefix}-button-background: none;
90
- --#{root-defaults.$prefix}-button-hover-background: none;
91
- --#{root-defaults.$prefix}-button-active-background: none;
92
- --#{root-defaults.$prefix}-button-disabled-background: none;
101
+ --#{root-defaults.$prefix}-button-background: #{link.$link-background};
102
+ --#{root-defaults.$prefix}-button-hover-background: #{link.$link-hover-background};
103
+ --#{root-defaults.$prefix}-button-active-background: #{link.$link-active-background};
104
+ --#{root-defaults.$prefix}-button-disabled-background: #{link.$link-disabled-background};
93
105
  --#{root-defaults.$prefix}-button-border-color: none;
94
106
  --#{root-defaults.$prefix}-button-hover-border-color: none;
95
107
  --#{root-defaults.$prefix}-button-active-border-color: none;
@@ -98,7 +110,7 @@
98
110
  --#{root-defaults.$prefix}-button-active-transform: none;
99
111
  }
100
112
 
101
- &:not(.link) {
113
+ &:not(#{defaults.$button-link-selector}) {
102
114
  --#{root-defaults.$prefix}-link-color: #{$button-color};
103
115
  --#{root-defaults.$prefix}-link-hover-color: #{$button-hover-color};
104
116
  --#{root-defaults.$prefix}-link-active-color: #{$button-active-color};
@@ -118,7 +130,8 @@
118
130
  --#{root-defaults.$prefix}-button-color: #{$button-active-color};
119
131
  }
120
132
 
121
- &:disabled {
133
+ &:disabled,
134
+ &[disabled] {
122
135
  --#{root-defaults.$prefix}-button-border-color: #{$button-disabled-border-color};
123
136
  --#{root-defaults.$prefix}-button-background: #{$button-disabled-background};
124
137
  --#{root-defaults.$prefix}-button-color: #{$button-disabled-color};
@@ -1,4 +1,7 @@
1
- // Variables referencing custom properties.
1
+ // @graupl/graupl button base variables.
2
+ //
3
+ // These values are to be used to directly style bases and provide a
4
+ // cleaner way to reference custom properties.
2
5
 
3
6
  @use "defaults";
4
7
  @use "../../variables" as root-variables;
@@ -46,6 +49,10 @@ $button-transition-reduced-motion: var(
46
49
  );
47
50
 
48
51
  // Transform properties.
52
+ $button-transform: var(
53
+ --#{root-defaults.$prefix}-button-transform,
54
+ #{defaults.$button-transform}
55
+ );
49
56
  $button-hover-transform: var(
50
57
  --#{root-defaults.$prefix}-button-hover-transform,
51
58
  #{defaults.$button-hover-transform}
@@ -1,7 +1,17 @@
1
- // Default values for Graupl.
1
+ // @graupl/graupl form base 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 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
+ // Form selectors.
10
+ $input-selector: "input" !default;
11
+ $textarea-selector: "textarea" !default;
12
+ $select-selector: "select" !default;
13
+ $label-selector: "label" !default;
14
+ $fieldset-selector: "fieldset" !default;
6
15
 
16
+ // Fieldset properties.
7
17
  $fieldset-direction: column !default;
@@ -1,12 +1,13 @@
1
- // Graupl form base styles.
1
+ // @gruapl/graupl form base styles.
2
2
 
3
+ @use "defaults";
3
4
  @use "variables" as *;
4
5
  @use "../../mixins/layer" as *;
5
6
 
6
7
  @include layer(base) {
7
- input,
8
- textarea,
9
- select {
8
+ #{defaults.$input-selector},
9
+ #{defaults.$textarea-selector},
10
+ #{defaults.$select-selector} {
10
11
  padding: $input-padding;
11
12
  border-width: $input-border-width;
12
13
  border-style: $input-border-style;
@@ -18,11 +19,11 @@
18
19
  }
19
20
  }
20
21
 
21
- label {
22
+ #{defaults.$label-selector} {
22
23
  font-size: $label-font-size;
23
24
  }
24
25
 
25
- fieldset {
26
+ #{defaults.$fieldset-selector} {
26
27
  display: flex;
27
28
  flex-flow: $fieldset-direction wrap;
28
29
  gap: $fieldset-gap;
@@ -33,9 +34,9 @@
33
34
  font-size: $fieldset-font-size;
34
35
 
35
36
  &:disabled {
36
- input,
37
- textarea,
38
- select {
37
+ #{defaults.$input-selector},
38
+ #{defaults.$textarea-selector},
39
+ #{defaults.$select-selector} {
39
40
  cursor: not-allowed;
40
41
  }
41
42
  }
@@ -43,9 +44,9 @@
43
44
  }
44
45
 
45
46
  @include layer(theme) {
46
- input,
47
- textarea,
48
- select {
47
+ #{defaults.$input-selector},
48
+ #{defaults.$textarea-selector},
49
+ #{defaults.$select-selector} {
49
50
  border-color: $input-border-color;
50
51
  background: $input-background;
51
52
  color: $input-color;
@@ -65,15 +66,19 @@
65
66
  }
66
67
  }
67
68
 
68
- label {
69
+ #{defaults.$label-selector} {
69
70
  color: $label-color;
70
71
 
71
- &:has(+ input:disabled, + textarea:disabled, + select:disabled) {
72
+ &:has(
73
+ + #{defaults.$input-selector}:disabled,
74
+ + #{defaults.$textarea-selector}:disabled,
75
+ + #{defaults.$select-selector}:disabled
76
+ ) {
72
77
  color: $label-disabled-color;
73
78
  }
74
79
  }
75
80
 
76
- fieldset {
81
+ #{defaults.$fieldset-selector} {
77
82
  border-color: $fieldset-border-color;
78
83
  background: $fieldset-background;
79
84
  color: $fieldset-color;
@@ -82,7 +87,7 @@
82
87
  border-color: $fieldset-disabled-border-color;
83
88
  color: $fieldset-disabled-color;
84
89
 
85
- label {
90
+ #{defaults.$label-selector} {
86
91
  color: $label-disabled-color;
87
92
  }
88
93
  }
@@ -1,4 +1,7 @@
1
- // Variables referencing custom properties.
1
+ // @graupl/graupl form base variables.
2
+ //
3
+ // These values are to be used to directly style bases and provide a
4
+ // cleaner way to reference custom properties.
2
5
 
3
6
  @use "defaults";
4
7
  @use "../../variables" as root-variables;
@@ -1,7 +1,19 @@
1
- // Default values for Graupl.
1
+ // @graupl/graupl link base 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 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
+ // Link selectors.
10
+ $link-selector: "a" !default;
6
11
 
12
+ // Link properties.
7
13
  $link-text-decoration: underline;
14
+ $link-hover-text-decoration: underline;
15
+ $link-transform: none !default;
16
+ $link-hover-transform: none !default;
17
+ $link-hover-transform-reduced-motion: none !default;
18
+ $link-active-transform: none !default;
19
+ $link-active-transform-reduced-motion: none !default;