nuvio 0.0.2 → 1.2.0

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 (81) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +337 -6
  3. package/dist/nuvio-base-dark.css +1497 -0
  4. package/dist/nuvio-base-dark.min.css +1 -0
  5. package/dist/nuvio-base-light.css +1497 -0
  6. package/dist/nuvio-base-light.min.css +1 -0
  7. package/dist/nuvio-base-prefer.css +1549 -0
  8. package/dist/nuvio-base-prefer.min.css +1 -0
  9. package/dist/nuvio-base.css +1655 -0
  10. package/dist/nuvio-base.min.css +1 -0
  11. package/dist/nuvio-dark.css +9755 -0
  12. package/dist/nuvio-dark.min.css +1 -0
  13. package/dist/nuvio-light.css +9755 -0
  14. package/dist/nuvio-light.min.css +1 -0
  15. package/dist/nuvio-prefer.css +9876 -0
  16. package/dist/nuvio-prefer.min.css +1 -0
  17. package/dist/nuvio.css +10103 -18
  18. package/dist/nuvio.min.css +1 -2
  19. package/package.json +37 -22
  20. package/src/_config-base.scss +6 -0
  21. package/src/_includes-base.scss +10 -0
  22. package/src/_includes-full.scss +44 -0
  23. package/src/base/_index.scss +295 -0
  24. package/src/config/_index.scss +322 -0
  25. package/src/config/_layers.scss +27 -0
  26. package/src/config/themes.scss +308 -0
  27. package/src/config/utilities.scss +106 -0
  28. package/src/elements/accordion.scss +65 -0
  29. package/src/elements/block.scss +14 -0
  30. package/src/elements/box.scss +66 -0
  31. package/src/elements/dropdown.scss +149 -0
  32. package/src/elements/footer.scss +9 -0
  33. package/src/elements/icon.scss +63 -0
  34. package/src/elements/image.scss +36 -0
  35. package/src/elements/modal.scss +123 -0
  36. package/src/elements/navbar.scss +463 -0
  37. package/src/elements/notification.scss +53 -0
  38. package/src/elements/placeholder.scss +55 -0
  39. package/src/elements/progress.scss +85 -0
  40. package/src/elements/table.scss +149 -0
  41. package/src/elements/tag.scss +88 -0
  42. package/src/forms/button.scss +415 -0
  43. package/src/forms/checkbox-radio.scss +38 -0
  44. package/src/forms/controls.scss +181 -0
  45. package/src/forms/file.scss +237 -0
  46. package/src/forms/form-utilities.scss +109 -0
  47. package/src/forms/input.scss +27 -0
  48. package/src/forms/range.scss +96 -0
  49. package/src/forms/segmented.scss +130 -0
  50. package/src/forms/select.scss +100 -0
  51. package/src/forms/textarea.scss +26 -0
  52. package/src/forms/toggle.scss +106 -0
  53. package/src/layout/border.scss +34 -0
  54. package/src/layout/container.scss +36 -0
  55. package/src/layout/flexbox-base.scss +204 -0
  56. package/src/layout/flexbox-shorthands.scss +48 -0
  57. package/src/layout/grid.scss +72 -0
  58. package/src/layout/overflow.scss +23 -0
  59. package/src/layout/position.scss +16 -0
  60. package/src/layout/spacing.scss +70 -0
  61. package/src/layout/visibility.scss +50 -0
  62. package/src/main-base-auto.scss +4 -0
  63. package/src/main-base-dark.scss +4 -0
  64. package/src/main-base-light.scss +4 -0
  65. package/src/main-base-prefer.scss +4 -0
  66. package/src/main-full-auto.scss +4 -0
  67. package/src/main-full-dark.scss +6 -0
  68. package/src/main-full-light.scss +6 -0
  69. package/src/main-full-prefer.scss +6 -0
  70. package/src/typography/color.scss +25 -0
  71. package/src/typography/content.scss +185 -0
  72. package/src/typography/interaction.scss +20 -0
  73. package/src/typography/text.scss +71 -0
  74. package/src/typography/title.scss +76 -0
  75. package/dist/nuvio.css.map +0 -1
  76. package/dist/nuvio.min.css.map +0 -1
  77. package/src/_buttons.scss +0 -19
  78. package/src/_reset.scss +0 -5
  79. package/src/_typography.scss +0 -13
  80. package/src/_variables.scss +0 -5
  81. package/src/main.scss +0 -3
@@ -0,0 +1,308 @@
1
+ @use "sass:color";
2
+ @use "sass:map";
3
+ @use "sass:math";
4
+ @use "sass:meta";
5
+ @use "sass:string";
6
+ @use "." as c;
7
+ // Loaded here, first of all emitting modules, so the @layer order statement is
8
+ // emitted ahead of any layered rule.
9
+ @use "layers" as l;
10
+
11
+ // ── Public: theme() Mixin ────────────────────────────────────────────────────
12
+ //
13
+ // .my-element {
14
+ // @include t.theme("color", "text");
15
+ // @include t.theme("background-color", "surface-1");
16
+ // }
17
+
18
+ @mixin theme($prop, $key, $important: false) {
19
+ @if $important {
20
+ #{$prop}: var(--nv-#{$key}) !important;
21
+ } @else {
22
+ #{$prop}: var(--nv-#{$key});
23
+ }
24
+ }
25
+
26
+ // ── Public: fill() Mixin ─────────────────────────────────────────────────────
27
+ //
28
+ // .my-element {
29
+ // @include t.fill("primary");
30
+ // }
31
+
32
+ @mixin fill($name) {
33
+ @include theme("background-color", "fill-#{$name}");
34
+ @include theme("border-color", "fill-#{$name}");
35
+ @include theme("color", "fill-text-#{$name}");
36
+ }
37
+
38
+ // ── Per-Token Override Helper ────────────────────────────────────────────────
39
+ // A semantic-color entry may carry optional override sub-maps (hover, active,
40
+ // ink, tint-*) to skip derivation and emit verbatim values. Returns null when
41
+ // no override is present – caller falls back to derivation.
42
+
43
+ @function _override($entry, $token, $theme) {
44
+ $sub: map.get($entry, $token);
45
+ @if $sub != null and meta.type-of($sub) == "map" {
46
+ @return map.get($sub, $theme);
47
+ }
48
+ @return null;
49
+ }
50
+
51
+ // ── Semantic Color Token Tables ──────────────────────────────────────────────
52
+ // Each color produces 9 tokens per theme:
53
+ // fill-{N} exact solid surface color
54
+ // fill-{N}-hover fill darkened by $hover-lightness-offset (override: hover)
55
+ // fill-{N}-active fill darkened by $active-lightness-offset (override: active)
56
+ // fill-text-{N} foreground text on solid surface
57
+ // ink-{N} foreground text on background (override: ink)
58
+ // tint-light-{N} pale wash (override: tint-light)
59
+ // tint-light-text-{N} text on pale wash (override: tint-light-text)
60
+ // tint-dark-{N} dark wash (override: tint-dark)
61
+ // tint-dark-text-{N} text on dark wash (override: tint-dark-text)
62
+
63
+ $_sem-light: ();
64
+ $_sem-dark: ();
65
+
66
+ @each $name, $entry in c.$semantic-colors {
67
+ $lc: map.get($entry, "light");
68
+ $dc: map.get($entry, "dark");
69
+ $lt: map.get($entry, "text-light");
70
+ $dt: map.get($entry, "text-dark");
71
+
72
+ $lc-hover: _override($entry, "hover", "light");
73
+ @if $lc-hover == null { $lc-hover: color.adjust($lc, $lightness: -(c.$hover-lightness-offset)); }
74
+ $dc-hover: _override($entry, "hover", "dark");
75
+ @if $dc-hover == null { $dc-hover: color.adjust($dc, $lightness: -(c.$hover-lightness-offset)); }
76
+
77
+ $lc-active: _override($entry, "active", "light");
78
+ @if $lc-active == null { $lc-active: color.adjust($lc, $lightness: -(c.$active-lightness-offset)); }
79
+ $dc-active: _override($entry, "active", "dark");
80
+ @if $dc-active == null { $dc-active: color.adjust($dc, $lightness: -(c.$active-lightness-offset)); }
81
+
82
+ $lc-color: _override($entry, "ink", "light");
83
+ @if $lc-color == null {
84
+ $lc-color: $lc;
85
+ $ll: color.channel($lc, "lightness", $space: hsl);
86
+ @if $ll > c.$outline-light-max-lightness {
87
+ $lc-color: color.change($lc, $lightness: c.$outline-light-max-lightness);
88
+ }
89
+ }
90
+
91
+ $dc-color: _override($entry, "ink", "dark");
92
+ @if $dc-color == null {
93
+ $dc-color: $dc;
94
+ $dl: color.channel($dc, "lightness", $space: hsl);
95
+ @if $dl < c.$outline-dark-min-lightness {
96
+ $dc-color: color.change($dc, $lightness: c.$outline-dark-min-lightness);
97
+ }
98
+ }
99
+
100
+ $lc-tint-light: _override($entry, "tint-light", "light");
101
+ @if $lc-tint-light == null { $lc-tint-light: color.mix($lc, c.$light-surface-1, c.$tint-light-weight-light); }
102
+ $dc-tint-light: _override($entry, "tint-light", "dark");
103
+ @if $dc-tint-light == null { $dc-tint-light: color.mix($dc, c.$light-bg, c.$tint-light-weight-dark); }
104
+
105
+ $lc-tint-light-text: _override($entry, "tint-light-text", "light");
106
+ @if $lc-tint-light-text == null { $lc-tint-light-text: color.mix($lc-color, c.$light-text, c.$tint-light-text-weight-light); }
107
+ $_dco-tint-light-text: _override($entry, "tint-light-text", "dark");
108
+ $dc-tint-light-text: $_dco-tint-light-text;
109
+ @if $dc-tint-light-text == null { $dc-tint-light-text: color.mix($dc-color, c.$dark-text, c.$tint-light-text-weight-dark); }
110
+
111
+ // Dark-block emission of tint-light-text-{N}: framework default reuses the
112
+ // light-computed value (theme-invariant text on pale wash). An explicit dark
113
+ // override takes precedence.
114
+ $_dark-emit-tint-light-text: $lc-tint-light-text;
115
+ @if $_dco-tint-light-text != null { $_dark-emit-tint-light-text: $_dco-tint-light-text; }
116
+
117
+ $lc-tint-dark: _override($entry, "tint-dark", "light");
118
+ @if $lc-tint-dark == null { $lc-tint-dark: color.mix($lc, #000, c.$tint-dark-weight-light); }
119
+ $dc-tint-dark: _override($entry, "tint-dark", "dark");
120
+ @if $dc-tint-dark == null { $dc-tint-dark: color.mix($dc, c.$dark-bg, c.$tint-dark-weight-dark); }
121
+
122
+ $lc-tint-dark-text: _override($entry, "tint-dark-text", "light");
123
+ @if $lc-tint-dark-text == null { $lc-tint-dark-text: c.$light-bg; }
124
+ $dc-tint-dark-text: _override($entry, "tint-dark-text", "dark");
125
+ @if $dc-tint-dark-text == null { $dc-tint-dark-text: $dc-tint-light-text; }
126
+
127
+ $_sem-light: map.merge($_sem-light, (
128
+ "fill-#{$name}": $lc,
129
+ "fill-#{$name}-hover": $lc-hover,
130
+ "fill-#{$name}-active": $lc-active,
131
+ "fill-text-#{$name}": $lt,
132
+ "ink-#{$name}": $lc-color,
133
+ "tint-light-#{$name}": $lc-tint-light,
134
+ "tint-light-text-#{$name}": $lc-tint-light-text,
135
+ "tint-dark-#{$name}": $lc-tint-dark,
136
+ "tint-dark-text-#{$name}": $lc-tint-dark-text,
137
+ "tint-#{$name}": $lc-tint-light,
138
+ "tint-text-#{$name}": $lc-tint-light-text,
139
+ ));
140
+
141
+ $_sem-dark: map.merge($_sem-dark, (
142
+ "fill-#{$name}": $dc,
143
+ "fill-#{$name}-hover": $dc-hover,
144
+ "fill-#{$name}-active": $dc-active,
145
+ "fill-text-#{$name}": $dt,
146
+ "ink-#{$name}": $dc-color,
147
+ "tint-light-#{$name}": $dc-tint-light,
148
+ "tint-light-text-#{$name}": $_dark-emit-tint-light-text,
149
+ "tint-dark-#{$name}": $dc-tint-dark,
150
+ "tint-dark-text-#{$name}": $dc-tint-dark-text,
151
+ "tint-#{$name}": $dc-tint-dark,
152
+ "tint-text-#{$name}": $dc-tint-light-text,
153
+ ));
154
+ }
155
+
156
+ // ── Token Maps ───────────────────────────────────────────────────────────────
157
+
158
+ $_light: map.merge((
159
+ "bg": c.$light-bg,
160
+ "surface-1": c.$light-surface-1,
161
+ "surface-2": c.$light-surface-2,
162
+ "surface-3": c.$light-surface-3,
163
+ "surface-4": c.$light-surface-4,
164
+ "surface-1-hover": c.$light-surface-1-hover,
165
+ "surface-2-hover": c.$light-surface-2-hover,
166
+ "surface-3-hover": c.$light-surface-3-hover,
167
+ "surface-4-hover": c.$light-surface-4-hover,
168
+ "border": c.$light-border,
169
+ "text": c.$light-text,
170
+ "text-muted": c.$light-text-muted,
171
+ "text-highlight": c.$light-text-highlight,
172
+ "control-bg": c.$light-control-bg,
173
+ "control-border": c.$light-control-border,
174
+ "control-text": c.$light-control-text,
175
+ "control-hover": c.$light-control-hover,
176
+ "focus-ring": c.$focus-ring-color-light,
177
+ ), $_sem-light);
178
+
179
+ $_dark: map.merge((
180
+ "bg": c.$dark-bg,
181
+ "surface-1": c.$dark-surface-1,
182
+ "surface-2": c.$dark-surface-2,
183
+ "surface-3": c.$dark-surface-3,
184
+ "surface-4": c.$dark-surface-4,
185
+ "surface-1-hover": c.$dark-surface-1-hover,
186
+ "surface-2-hover": c.$dark-surface-2-hover,
187
+ "surface-3-hover": c.$dark-surface-3-hover,
188
+ "surface-4-hover": c.$dark-surface-4-hover,
189
+ "border": c.$dark-border,
190
+ "text": c.$dark-text,
191
+ "text-muted": c.$dark-text-muted,
192
+ "text-highlight": c.$dark-text-highlight,
193
+ "control-bg": c.$dark-control-bg,
194
+ "control-border": c.$dark-control-border,
195
+ "control-text": c.$dark-control-text,
196
+ "control-hover": c.$dark-control-hover,
197
+ "focus-ring": c.$focus-ring-color-dark,
198
+ ), $_sem-dark);
199
+
200
+ // ── Hex Color Output ─────────────────────────────────────────────────────────
201
+ // Converts any Sass color to its shortest #rrggbb / #rgb hex form, rounding
202
+ // each RGB channel once at emit time.
203
+ //
204
+ // The color is clipped into the sRGB gamut first. Since Sass 1.79,
205
+ // color.adjust() no longer clamps HSL lightness, so a derivation that runs past
206
+ // either end – e.g. the text-highlight of $light-text: #000 (lightness -9%) or
207
+ // of $dark-text: #fff (lightness +9%) – yields channels below 0 or above 255.
208
+ // Unclipped, a negative channel made string.slice() index from the end of the
209
+ // digit string and turned pure black into #f8fafa.
210
+
211
+ @function _hex-digit($n) {
212
+ @return string.slice("0123456789abcdef", $n + 1, $n + 1);
213
+ }
214
+
215
+ @function _hex-byte($n) {
216
+ @return _hex-digit(math.floor(math.div($n, 16))) + _hex-digit($n % 16);
217
+ }
218
+
219
+ @function _hex($c) {
220
+ $c: color.to-gamut($c, $space: srgb, $method: clip);
221
+ $r: math.round(color.channel($c, "red", $space: srgb) * 255);
222
+ $g: math.round(color.channel($c, "green", $space: srgb) * 255);
223
+ $b: math.round(color.channel($c, "blue", $space: srgb) * 255);
224
+ // #rgb shorthand when each byte is a repeated-nibble (divisible by 17)
225
+ @if $r % 17 == 0 and $g % 17 == 0 and $b % 17 == 0 {
226
+ @return string.unquote("#" +
227
+ _hex-digit(math.floor(math.div($r, 17))) +
228
+ _hex-digit(math.floor(math.div($g, 17))) +
229
+ _hex-digit(math.floor(math.div($b, 17))));
230
+ }
231
+ @return string.unquote("#" + _hex-byte($r) + _hex-byte($g) + _hex-byte($b));
232
+ }
233
+
234
+ // ── Internal Helpers ─────────────────────────────────────────────────────────
235
+
236
+ @function _light($key) {
237
+ $v: map.get($_light, $key);
238
+ @if $v == null { @error "nuvio: unknown theme token '#{$key}'"; }
239
+ @return $v;
240
+ }
241
+
242
+ @function _dark($key) {
243
+ $v: map.get($_dark, $key);
244
+ @if $v == null { @error "nuvio: unknown theme token '#{$key}'"; }
245
+ @return $v;
246
+ }
247
+
248
+ @mixin _emit-vars($map) {
249
+ @each $key, $val in $map {
250
+ @if meta.type-of($val) == "color" {
251
+ --nv-#{$key}: #{_hex($val)};
252
+ } @else {
253
+ --nv-#{$key}: #{$val};
254
+ }
255
+ }
256
+ }
257
+
258
+ // ── CSS Property Emission ────────────────────────────────────────────────────
259
+
260
+ @include l.layer("tokens") {
261
+ @if c.$output-mode == "light" {
262
+ :root {
263
+ color-scheme: light;
264
+ @include _emit-vars($_light);
265
+ }
266
+ }
267
+
268
+ @else if c.$output-mode == "dark" {
269
+ :root {
270
+ color-scheme: dark;
271
+ @include _emit-vars($_dark);
272
+ }
273
+ }
274
+
275
+ @else if c.$output-mode == "prefer" {
276
+ :root {
277
+ color-scheme: light dark;
278
+ @include _emit-vars($_light);
279
+ }
280
+ @media (prefers-color-scheme: dark) {
281
+ :root { @include _emit-vars($_dark); }
282
+ }
283
+ }
284
+
285
+ @else {
286
+ :root {
287
+ color-scheme: light dark;
288
+ @include _emit-vars($_light);
289
+ }
290
+ @media (prefers-color-scheme: dark) {
291
+ :root { @include _emit-vars($_dark); }
292
+ }
293
+ // The `:has()` selectors let a checked control anywhere on the page switch
294
+ // the theme with no JavaScript – a radio group with `.theme-light` /
295
+ // `.theme-dark` on two of its inputs, and a third, unclassed input for
296
+ // "follow the system". The classes cost nothing when unused.
297
+ html.is-light,
298
+ html:has(.theme-light:checked) {
299
+ color-scheme: light;
300
+ @include _emit-vars($_light);
301
+ }
302
+ html.is-dark,
303
+ html:has(.theme-dark:checked) {
304
+ color-scheme: dark;
305
+ @include _emit-vars($_dark);
306
+ }
307
+ }
308
+ }
@@ -0,0 +1,106 @@
1
+ @use "sass:map";
2
+ @use "." as c;
3
+
4
+ // ── Breakpoints ──────────────────────────────────────────────────────────────
5
+
6
+ @mixin bp-from($key) {
7
+ $entry: map.get(c.$breakpoints, $key);
8
+ @media screen and (min-width: map.get($entry, "min")) {
9
+ @content;
10
+ }
11
+ }
12
+
13
+ @mixin bp-below($key) {
14
+ $entry: map.get(c.$breakpoints, $key);
15
+ @media screen and (max-width: #{map.get($entry, "min") - 1px}) {
16
+ @content;
17
+ }
18
+ }
19
+
20
+ // ── Helpers ──────────────────────────────────────────────────────────────────
21
+
22
+ // Hover styles gated to devices with a hover-capable, precise pointer.
23
+ // Prevents "sticky hover" lingering on touch devices after a tap.
24
+ @mixin on-hover {
25
+ @media (hover: hover) and (pointer: fine) {
26
+ &:hover {
27
+ @content;
28
+ }
29
+ }
30
+ }
31
+
32
+ @mixin placeholder {
33
+ &::placeholder { @content; }
34
+ &::-webkit-input-placeholder { @content; }
35
+ &:-moz-placeholder { @content; }
36
+ &::-moz-placeholder { @content; }
37
+ &:-ms-input-placeholder { @content; }
38
+ }
39
+
40
+ // Block spacing helper – applies bottom margin to all but last child
41
+ @mixin block($spacing: c.$block-spacing) {
42
+ &:not(:last-child) {
43
+ margin-bottom: $spacing;
44
+ }
45
+ }
46
+
47
+ // Downward arrow, used in dropdowns and selects. The dropped borders stay
48
+ // physical on purpose – this is a glyph, and mirroring them under `dir="rtl"`
49
+ // would rotate the chevron instead of flipping it.
50
+ @mixin arrow($color: currentColor) {
51
+ border: 0.125em solid $color;
52
+ border-right: 0;
53
+ border-top: 0;
54
+ content: " ";
55
+ display: block;
56
+ height: 0.625em;
57
+ margin-top: -0.4375em;
58
+ pointer-events: none;
59
+ position: absolute;
60
+ top: 50%;
61
+ transform: rotate(-45deg);
62
+ transform-origin: center;
63
+ transition: border-color c.$duration c.$easing;
64
+ width: 0.625em;
65
+ }
66
+
67
+ // X glyph drawn from two crossed bars, the same technique the navbar burger
68
+ // uses for its open state. Lets a close control ship with no icon font.
69
+ @mixin close-x($color: currentColor, $thickness: 0.125em, $length: 0.65em) {
70
+ position: relative;
71
+
72
+ &::before,
73
+ &::after {
74
+ background-color: $color;
75
+ content: "";
76
+ height: $thickness;
77
+ left: 50%;
78
+ position: absolute;
79
+ top: 50%;
80
+ transition: background-color c.$duration c.$easing;
81
+ width: $length;
82
+ }
83
+
84
+ &::before { transform: translate(-50%, -50%) rotate(45deg); }
85
+ &::after { transform: translate(-50%, -50%) rotate(-45deg); }
86
+ }
87
+
88
+ // Spinning loader ring
89
+ @mixin loader {
90
+ animation: spinAround 800ms infinite linear;
91
+ border: 2px solid;
92
+ border-radius: c.$radius-pill;
93
+ border-right-color: transparent;
94
+ border-top-color: transparent;
95
+ content: "";
96
+ display: block;
97
+ height: 1em;
98
+ position: relative;
99
+ width: 1em;
100
+
101
+ // Slow down rather than stop – the ring is the only "busy" cue a loading
102
+ // control has left once its label is hidden.
103
+ @media (prefers-reduced-motion: reduce) {
104
+ animation-duration: 2.4s;
105
+ }
106
+ }
@@ -0,0 +1,65 @@
1
+ @use "sass:math";
2
+ @use "../config" as c;
3
+ @use "../config/themes" as t;
4
+ @use "../config/utilities" as u;
5
+ @use "../config/layers" as l;
6
+
7
+ @include l.layer("components") {
8
+ // ── .accordion ─────────────────────────────────────────────────────────────
9
+ // Styles a native <details>. Open/close is the platform's; giving several
10
+ // accordions the same `name` attribute makes them mutually exclusive – no JS.
11
+
12
+ .accordion {
13
+ // Tighter than the usual block rhythm: accordions are normally stacked.
14
+ @include u.block(math.div(c.$block-spacing, 3));
15
+ @include t.theme("background-color", "surface-1");
16
+ @include t.theme("border-color", "border");
17
+ border-radius: c.$accordion-radius;
18
+ border-style: solid;
19
+ border-width: c.$accordion-border-width;
20
+ overflow: hidden; // keeps the summary hover fill inside the radius
21
+
22
+ > summary {
23
+ @include t.theme("color", "text-highlight");
24
+ cursor: pointer;
25
+ font-weight: c.$accordion-summary-weight;
26
+ list-style: none; // hides the marker in Firefox
27
+ padding: c.$accordion-padding-y c.$accordion-padding-x;
28
+ padding-inline-end: 2.5em;
29
+ position: relative;
30
+ transition: background-color c.$duration c.$easing;
31
+
32
+ &::-webkit-details-marker { display: none; } // …and in Safari
33
+
34
+ &::after {
35
+ @include u.arrow;
36
+ @include t.theme("border-color", "text-muted");
37
+ inset-inline-end: 1.125em;
38
+ }
39
+
40
+ @include u.on-hover {
41
+ @include t.theme("background-color", "surface-1-hover");
42
+ }
43
+
44
+ // Inset, because `overflow: hidden` above would clip an outer ring.
45
+ &:focus-visible {
46
+ outline: 2px solid;
47
+ @include t.theme("outline-color", "focus-ring");
48
+ outline-offset: -2px;
49
+ }
50
+ }
51
+
52
+ &[open] > summary::after {
53
+ transform: rotate(135deg);
54
+ }
55
+
56
+ &.is-small { font-size: c.$font-size-sm; }
57
+ &.is-medium { font-size: c.$font-size-lg; }
58
+ &.is-large { font-size: c.$font-size-xl; }
59
+ }
60
+
61
+ .accordion-content {
62
+ padding-block-end: c.$accordion-padding-y;
63
+ padding-inline: c.$accordion-padding-x;
64
+ }
65
+ }
@@ -0,0 +1,14 @@
1
+ @use "sass:math";
2
+ @use "../config" as c;
3
+ @use "../config/utilities" as u;
4
+ @use "../config/layers" as l;
5
+
6
+ @include l.layer("utilities") {
7
+ .block {
8
+ @include u.block;
9
+ }
10
+
11
+ .halfblock {
12
+ @include u.block(math.div(c.$block-spacing, 2));
13
+ }
14
+ }
@@ -0,0 +1,66 @@
1
+ @use "../config" as c;
2
+ @use "../config/themes" as t;
3
+ @use "../config/layers" as l;
4
+
5
+ @include l.layer("components") {
6
+ .box {
7
+ @include t.theme("background-color", "surface-1");
8
+ @include t.theme("border-color", "border");
9
+ border-width: c.$box-border-width;
10
+ border-style: solid;
11
+ border-radius: c.$box-radius;
12
+ display: block;
13
+ padding: c.$box-padding;
14
+ --nv-control-bg: var(--nv-surface-2);
15
+ --nv-control-hover: var(--nv-surface-2-hover);
16
+
17
+ a:not(.button):not(.dropdown-item) {
18
+ color: currentColor;
19
+ }
20
+
21
+ strong {
22
+ color: currentColor;
23
+ }
24
+
25
+ code,
26
+ pre {
27
+ @include t.theme("background-color", "surface-2");
28
+ }
29
+
30
+ pre code {
31
+ background: transparent;
32
+ }
33
+
34
+ .title,
35
+ .subtitle,
36
+ .content {
37
+ color: currentColor;
38
+ }
39
+
40
+ &.is-level-bg {
41
+ @include t.theme("background-color", "bg");
42
+ --nv-control-bg: var(--nv-surface-1);
43
+ --nv-control-hover: var(--nv-surface-1-hover);
44
+ }
45
+
46
+ &.is-level-2 {
47
+ @include t.theme("background-color", "surface-2");
48
+ --nv-control-bg: var(--nv-surface-3);
49
+ --nv-control-hover: var(--nv-surface-3-hover);
50
+ }
51
+
52
+ &.is-level-3 {
53
+ @include t.theme("background-color", "surface-3");
54
+ --nv-control-bg: var(--nv-surface-4);
55
+ --nv-control-hover: var(--nv-surface-4-hover);
56
+ }
57
+
58
+ @each $name, $_ in c.$semantic-colors {
59
+ &.is-#{$name} {
60
+ @include t.theme("background-color", "tint-#{$name}");
61
+ @include t.theme("border-color", "fill-#{$name}");
62
+ @include t.theme("color", "tint-text-#{$name}");
63
+ }
64
+ }
65
+ }
66
+ }