@voidable/theme 0.6.0 → 0.8.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 (95) hide show
  1. package/README.md +133 -8
  2. package/package.json +66 -8
  3. package/src/app-shell/detail.css +7 -5
  4. package/src/app-shell/subtable.css +7 -6
  5. package/src/base.css +28 -0
  6. package/src/components/accordion.css +96 -19
  7. package/src/components/action-input.css +51 -61
  8. package/src/components/alert.css +63 -23
  9. package/src/components/avatar.css +0 -2
  10. package/src/components/badge.css +35 -25
  11. package/src/components/banner.css +60 -19
  12. package/src/components/bar-chart.css +75 -0
  13. package/src/components/breadcrumbs.css +20 -16
  14. package/src/components/button.css +130 -55
  15. package/src/components/calendar.css +40 -17
  16. package/src/components/card.css +122 -23
  17. package/src/components/carousel.css +85 -118
  18. package/src/components/checkbox-group.css +3 -1
  19. package/src/components/checkbox.css +18 -23
  20. package/src/components/collapsible.css +95 -29
  21. package/src/components/color-picker.css +10 -10
  22. package/src/components/combobox.css +47 -29
  23. package/src/components/compose-input.css +3 -3
  24. package/src/components/dialog.css +115 -41
  25. package/src/components/divider.css +7 -4
  26. package/src/components/donut-chart.css +105 -0
  27. package/src/components/drawer.css +135 -68
  28. package/src/components/dropdown-menu.css +21 -43
  29. package/src/components/editable.css +7 -7
  30. package/src/components/error-fallback.css +48 -27
  31. package/src/components/field.css +12 -5
  32. package/src/components/file-upload.css +2 -1
  33. package/src/components/gauge.css +194 -0
  34. package/src/components/hamburger.css +10 -10
  35. package/src/components/hover-card.css +13 -113
  36. package/src/components/indicator.css +22 -18
  37. package/src/components/input.css +15 -12
  38. package/src/components/line-chart.css +137 -0
  39. package/src/components/list.css +28 -7
  40. package/src/components/menu.css +48 -33
  41. package/src/components/multiselect.css +57 -40
  42. package/src/components/nav-bar.css +23 -14
  43. package/src/components/nav-menu.css +31 -22
  44. package/src/components/number-input.css +85 -62
  45. package/src/components/overlay.css +215 -0
  46. package/src/components/pagination.css +42 -31
  47. package/src/components/panel.css +37 -11
  48. package/src/components/pin-input.css +23 -22
  49. package/src/components/popover.css +19 -35
  50. package/src/components/progress.css +19 -10
  51. package/src/components/radio-group.css +2 -1
  52. package/src/components/radio.css +15 -20
  53. package/src/components/scroll-area.css +3 -3
  54. package/src/components/segmented-control.css +46 -29
  55. package/src/components/select.css +99 -31
  56. package/src/components/sidebar.css +8 -4
  57. package/src/components/skeleton.css +8 -3
  58. package/src/components/slider.css +4 -2
  59. package/src/components/spinner.css +5 -4
  60. package/src/components/stat.css +59 -52
  61. package/src/components/status-dot.css +0 -1
  62. package/src/components/switch.css +18 -26
  63. package/src/components/table.css +443 -16
  64. package/src/components/tabs.css +92 -29
  65. package/src/components/tag.css +44 -20
  66. package/src/components/tags-input.css +43 -55
  67. package/src/components/textarea.css +15 -12
  68. package/src/components/toast.css +84 -22
  69. package/src/components/toggle.css +35 -42
  70. package/src/components/tooltip.css +19 -38
  71. package/src/core.css +98 -0
  72. package/src/forced-colors.css +134 -0
  73. package/src/index.css +4 -71
  74. package/src/knobs.css +101 -0
  75. package/src/layers.css +38 -0
  76. package/src/media/media.css +258 -0
  77. package/src/media/surface.css +143 -0
  78. package/src/patterns/data.css +461 -0
  79. package/src/patterns/page.css +348 -0
  80. package/src/patterns/shell.css +371 -0
  81. package/src/pre-upgrade.css +202 -0
  82. package/src/primitives.css +44 -71
  83. package/src/reset.css +45 -21
  84. package/src/skins/loft.css +114 -0
  85. package/src/skins/slab.css +107 -0
  86. package/src/themes/aurora.css +16 -0
  87. package/src/themes/capsule.css +16 -0
  88. package/src/themes/console.css +16 -0
  89. package/src/themes/dune.css +16 -0
  90. package/src/themes/iris.css +16 -0
  91. package/src/themes/orbit.css +16 -0
  92. package/src/themes/paper.css +18 -0
  93. package/src/themes/void.css +16 -0
  94. package/src/tokens.css +552 -98
  95. package/src/type.css +103 -0
@@ -1,34 +1,52 @@
1
+ /* A tag names a property of a thing. The plain tag is neutral: a
2
+ hairline pill. A colour tints it. */
3
+ /* @tokens void-tag
4
+ --void-tag-height Least height.
5
+ --void-tag-padding Inline padding.
6
+ --void-tag-font-size Size of the text.
7
+ --void-tag-radius Corner radius: a pill by default, whatever the radius knob says.
8
+ --void-tag-border Edge colour, of the plain tag and of a coloured one, in place of the hairline or the tint of its tone. */
9
+
1
10
  void-tag {
2
- --tone: var(--void-color-accent);
3
- --tone-subtle: color-mix(in srgb, var(--tone) 14%, transparent);
4
- --tone-border: color-mix(in srgb, var(--tone) 36%, transparent);
11
+ --_void-tone: var(--void-color-accent);
12
+ --_void-tone-subtle: transparent;
13
+ --_void-tone-border: var(--void-color-border-strong);
14
+ --_void-tag-height: var(--void-tag-height, 1.375rem);
15
+ --_void-tag-padding: var(--void-tag-padding, var(--void-space-2));
16
+ --_void-tag-font-size: var(--void-tag-font-size, var(--void-text-xs));
5
17
 
6
18
  display: inline-flex;
7
19
  align-items: center;
8
20
  gap: var(--void-space-1);
9
- padding: 0.125rem var(--void-space-2);
10
- border: 1px solid var(--tone-border);
11
- border-radius: var(--void-radius-full);
12
- background: var(--tone-subtle);
21
+ min-height: var(--_void-tag-height);
22
+ padding: 0 var(--_void-tag-padding);
23
+ border: var(--void-control-border-width) solid var(--void-tag-border, var(--_void-tone-border));
24
+ border-radius: var(--void-tag-radius, var(--void-radius-full));
25
+ background: var(--_void-tone-subtle);
13
26
  color: var(--void-color-text);
14
27
  font-family: var(--void-font-sans);
15
- font-size: var(--void-text-xs);
16
- font-weight: var(--void-weight-medium);
17
- line-height: var(--void-leading-tight);
28
+ font-size: var(--_void-tag-font-size);
29
+ font-weight: var(--void-weight-normal);
30
+ line-height: var(--void-leading-none);
18
31
  white-space: nowrap;
19
32
  }
20
33
 
21
- void-tag[color="error"] { --tone: var(--void-color-error); }
22
- void-tag[color="warning"] { --tone: var(--void-color-warning); }
23
- void-tag[color="caution"] { --tone: var(--void-color-caution); }
24
- void-tag[color="success"] { --tone: var(--void-color-success); }
25
- void-tag[color="info"] { --tone: var(--void-color-info); }
26
- void-tag[color="notice"] { --tone: var(--void-color-notice); }
34
+ void-tag[color="error"] { --_void-tone: var(--void-color-error); }
35
+ void-tag[color="warning"] { --_void-tone: var(--void-color-warning); }
36
+ void-tag[color="caution"] { --_void-tone: var(--void-color-caution); }
37
+ void-tag[color="highlight"] { --_void-tone: var(--void-color-highlight); }
38
+ void-tag[color="success"] { --_void-tone: var(--void-color-success); }
39
+ void-tag[color="info"] { --_void-tone: var(--void-color-info); }
40
+ void-tag[color="notice"] { --_void-tone: var(--void-color-notice); }
41
+
42
+ /* The attribute is reflected, so the plain tag carries color="default". */
43
+ void-tag[color]:not([color="default"]) {
44
+ --_void-tone-subtle: color-mix(in srgb, var(--_void-tone) var(--void-tone-tint), transparent);
45
+ --_void-tone-border: color-mix(in srgb, var(--_void-tone) 36%, transparent);
46
+ }
27
47
 
28
- void-tag[size="sm"] { font-size: var(--void-text-2xs); padding: 0 var(--void-space-1); }
29
- void-tag[size="lg"] { font-size: var(--void-text-sm); padding: 0.1875rem var(--void-space-3); }
30
- void-tag[size="xl"] { font-size: var(--void-text-base); padding: 0.25rem var(--void-space-4); }
31
- void-tag[size="xxl"] { font-size: var(--void-text-lg); padding: 0.3125rem var(--void-space-5); }
48
+ void-tag[size="sm"] { --_void-tag-height: var(--void-tag-height, 1.125rem); --_void-tag-padding: var(--void-tag-padding, var(--void-space-1h)); --_void-tag-font-size: var(--void-tag-font-size, var(--void-type-label-size)); }
49
+ void-tag[size="lg"] { --_void-tag-height: var(--void-tag-height, 1.75rem); --_void-tag-padding: var(--void-tag-padding, var(--void-space-3)); --_void-tag-font-size: var(--void-tag-font-size, var(--void-text-sm)); }
32
50
 
33
51
  .void-tag-close {
34
52
  display: inline-flex;
@@ -50,3 +68,9 @@ void-tag[size="xxl"] { font-size: var(--void-text-lg); padding: 0.3125rem var(--
50
68
  .void-tag-close:hover {
51
69
  opacity: 1;
52
70
  }
71
+
72
+ .void-tag-close:focus-visible {
73
+ opacity: 1;
74
+ outline: var(--void-focus-ring-width) solid currentColor;
75
+ outline-offset: var(--void-focus-ring-offset);
76
+ }
@@ -1,35 +1,39 @@
1
1
  void-tags-input {
2
- --tone: var(--void-color-accent);
3
- --tone-border: color-mix(in srgb, var(--tone) 36%, transparent);
2
+ --_void-tone: var(--void-color-accent);
3
+ --_void-tone-border: color-mix(in srgb, var(--_void-tone) 36%, transparent);
4
+ --_void-field-height: var(--void-control-height);
5
+ --_void-field-padding: var(--void-control-padding);
6
+ --_void-field-text: var(--void-control-text);
4
7
 
5
8
  display: block;
6
9
  font-family: var(--void-font-sans);
7
10
  }
8
11
 
9
- void-tags-input[color="error"] { --tone: var(--void-color-error); }
10
- void-tags-input[color="warning"] { --tone: var(--void-color-warning); }
11
- void-tags-input[color="caution"] { --tone: var(--void-color-caution); }
12
- void-tags-input[color="success"] { --tone: var(--void-color-success); }
13
- void-tags-input[color="info"] { --tone: var(--void-color-info); }
14
- void-tags-input[color="notice"] { --tone: var(--void-color-notice); }
12
+ void-tags-input[color="error"] { --_void-tone: var(--void-color-error); }
13
+ void-tags-input[color="warning"] { --_void-tone: var(--void-color-warning); }
14
+ void-tags-input[color="caution"] { --_void-tone: var(--void-color-caution); }
15
+ void-tags-input[color="highlight"] { --_void-tone: var(--void-color-highlight); }
16
+ void-tags-input[color="success"] { --_void-tone: var(--void-color-success); }
17
+ void-tags-input[color="info"] { --_void-tone: var(--void-color-info); }
18
+ void-tags-input[color="notice"] { --_void-tone: var(--void-color-notice); }
15
19
 
16
20
  .void-tags-input {
17
21
  display: flex;
18
22
  flex-wrap: wrap;
19
23
  align-items: center;
20
24
  gap: var(--void-space-1);
21
- padding: var(--void-space-2) var(--void-space-3);
22
- min-height: 2.25rem;
23
- background: var(--void-color-bg-secondary);
24
- border: 1px solid var(--void-color-border);
25
- border-radius: var(--void-radius-md);
25
+ padding: var(--void-space-1) var(--_void-field-padding);
26
+ min-height: var(--_void-field-height);
27
+ background: var(--void-field-surface);
28
+ border: var(--void-control-border-width) solid var(--void-field-border);
29
+ border-radius: var(--void-control-radius);
26
30
  cursor: text;
27
31
  transition: border-color var(--void-duration-fast) var(--void-ease-in-out),
28
32
  box-shadow var(--void-duration-fast) var(--void-ease-in-out);
29
33
  }
30
34
 
31
35
  .void-tags-input:hover {
32
- border-color: var(--void-color-border-strong);
36
+ border-color: var(--void-field-border);
33
37
  }
34
38
 
35
39
  .void-tags-input:focus-within {
@@ -38,18 +42,18 @@ void-tags-input[color="notice"] { --tone: var(--void-color-notice); }
38
42
  }
39
43
 
40
44
  void-tags-input[color]:not([color=""]):not([color="default"]) .void-tags-input:focus-within {
41
- border-color: var(--tone);
42
- box-shadow: 0 0 0 1px var(--tone);
45
+ border-color: var(--_void-tone);
46
+ box-shadow: 0 0 0 1px var(--_void-tone);
43
47
  }
44
48
 
45
49
  void-tags-input[color]:not([color=""]):not([color="default"]) .void-tags-input {
46
- border-color: var(--tone-border);
50
+ border-color: var(--_void-tone-border);
47
51
  }
48
52
 
49
53
  .void-tags-input-tag {
50
- --tag-tone: var(--void-color-accent);
51
- --tag-tone-subtle: color-mix(in srgb, var(--tag-tone) 14%, transparent);
52
- --tag-tone-border: color-mix(in srgb, var(--tag-tone) 36%, transparent);
54
+ --_void-tag-tone: var(--void-color-accent);
55
+ --_void-tag-tone-subtle: color-mix(in srgb, var(--_void-tag-tone) 14%, transparent);
56
+ --_void-tag-tone-border: color-mix(in srgb, var(--_void-tag-tone) 36%, transparent);
53
57
 
54
58
  display: inline-flex;
55
59
  align-items: center;
@@ -66,29 +70,30 @@ void-tags-input[color]:not([color=""]):not([color="default"]) .void-tags-input {
66
70
  }
67
71
 
68
72
  /* Per-tag colors */
69
- .void-tags-input-tag[data-color="error"] { --tag-tone: var(--void-color-error); }
70
- .void-tags-input-tag[data-color="warning"] { --tag-tone: var(--void-color-warning); }
71
- .void-tags-input-tag[data-color="caution"] { --tag-tone: var(--void-color-caution); }
72
- .void-tags-input-tag[data-color="success"] { --tag-tone: var(--void-color-success); }
73
- .void-tags-input-tag[data-color="info"] { --tag-tone: var(--void-color-info); }
74
- .void-tags-input-tag[data-color="notice"] { --tag-tone: var(--void-color-notice); }
75
- .void-tags-input-tag[data-color="accent"] { --tag-tone: var(--void-color-accent); }
73
+ .void-tags-input-tag[data-color="error"] { --_void-tag-tone: var(--void-color-error); }
74
+ .void-tags-input-tag[data-color="warning"] { --_void-tag-tone: var(--void-color-warning); }
75
+ .void-tags-input-tag[data-color="caution"] { --_void-tag-tone: var(--void-color-caution); }
76
+ .void-tags-input-tag[data-color="highlight"] { --_void-tag-tone: var(--void-color-highlight); }
77
+ .void-tags-input-tag[data-color="success"] { --_void-tag-tone: var(--void-color-success); }
78
+ .void-tags-input-tag[data-color="info"] { --_void-tag-tone: var(--void-color-info); }
79
+ .void-tags-input-tag[data-color="notice"] { --_void-tag-tone: var(--void-color-notice); }
80
+ .void-tags-input-tag[data-color="accent"] { --_void-tag-tone: var(--void-color-accent); }
76
81
 
77
82
  /* Outline variant — per-tag color */
78
83
  void-tags-input[variant="outline"] .void-tags-input-tag[data-color] {
79
- border-color: var(--tag-tone-border);
80
- background: var(--tag-tone-subtle);
84
+ border-color: var(--_void-tag-tone-border);
85
+ background: var(--_void-tag-tone-subtle);
81
86
  }
82
87
 
83
88
  /* Filled variant */
84
89
  void-tags-input[variant="filled"] .void-tags-input-tag {
85
- background: var(--tag-tone-subtle);
86
- border-color: var(--tag-tone-border);
90
+ background: var(--_void-tag-tone-subtle);
91
+ border-color: var(--_void-tag-tone-border);
87
92
  }
88
93
 
89
94
  void-tags-input[variant="filled"] .void-tags-input-tag[data-color] {
90
- background: var(--tag-tone);
91
- border-color: var(--tag-tone);
95
+ background: var(--_void-tag-tone);
96
+ border-color: var(--_void-tag-tone);
92
97
  color: var(--void-white);
93
98
  }
94
99
 
@@ -122,7 +127,7 @@ void-tags-input[variant="filled"] .void-tags-input-tag[data-color] {
122
127
  background: transparent;
123
128
  color: var(--void-color-text);
124
129
  font-family: inherit;
125
- font-size: var(--void-text-sm);
130
+ font-size: var(--_void-field-text);
126
131
  line-height: var(--void-leading-normal);
127
132
  outline: none;
128
133
  }
@@ -131,32 +136,11 @@ void-tags-input[variant="filled"] .void-tags-input-tag[data-color] {
131
136
  color: var(--void-color-text-muted);
132
137
  }
133
138
 
134
- /* Size variants */
135
- void-tags-input[size="sm"] .void-tags-input {
136
- padding: var(--void-space-1) var(--void-space-2);
137
- min-height: 1.75rem;
138
- gap: var(--void-space-1);
139
- }
140
-
141
- void-tags-input[size="sm"] .void-tags-input-field {
142
- font-size: var(--void-text-xs);
143
- }
144
-
145
139
  void-tags-input[size="sm"] .void-tags-input-tag {
146
140
  font-size: var(--void-text-2xs);
147
141
  padding: 0 var(--void-space-1);
148
142
  }
149
143
 
150
- void-tags-input[size="lg"] .void-tags-input {
151
- padding: var(--void-space-3) var(--void-space-4);
152
- min-height: 2.75rem; /* token-ok: intrinsic lg size min-height */
153
- gap: var(--void-space-2);
154
- }
155
-
156
- void-tags-input[size="lg"] .void-tags-input-field {
157
- font-size: var(--void-text-base);
158
- }
159
-
160
144
  void-tags-input[size="lg"] .void-tags-input-tag {
161
145
  font-size: var(--void-text-sm);
162
146
  padding: 0.1875rem var(--void-space-3); /* token-ok: intrinsic lg tag padding */
@@ -176,3 +160,7 @@ void-tags-input[disabled] .void-tags-input {
176
160
  void-tags-input[readonly] .void-tags-input {
177
161
  cursor: default;
178
162
  }
163
+
164
+ /* Size variants: each step sets the field tokens and nothing else */
165
+ void-tags-input[size="sm"] { --_void-field-height: var(--void-control-height-sm); --_void-field-padding: var(--void-control-padding-sm); --_void-field-text: var(--void-control-text-sm); }
166
+ void-tags-input[size="lg"] { --_void-field-height: var(--void-control-height-lg); --_void-field-padding: var(--void-control-padding-lg); --_void-field-text: var(--void-control-text-lg); }
@@ -1,20 +1,24 @@
1
1
  void-textarea {
2
+ --_void-field-height: var(--void-control-height);
3
+ --_void-field-padding: var(--void-control-padding);
4
+ --_void-field-text: var(--void-control-text);
2
5
  display: flex;
3
6
  flex-direction: column;
4
- gap: var(--void-space-1);
7
+ gap: var(--void-space-1h);
5
8
  font-family: var(--void-font-sans);
6
9
  }
7
10
 
8
11
  void-textarea textarea {
9
12
  width: 100%;
10
13
  resize: var(--void-textarea-resize, vertical);
11
- padding: var(--void-space-2) var(--void-space-3);
12
- background: var(--void-color-bg-secondary);
13
- border: 1px solid var(--void-color-border);
14
- border-radius: var(--void-radius-md);
14
+ /* One line of text sits exactly where it does in an input. */
15
+ padding: calc((var(--_void-field-height) - 2px - var(--_void-field-text) * var(--void-leading-normal)) / 2) var(--_void-field-padding);
16
+ background: var(--void-field-surface);
17
+ border: var(--void-control-border-width) solid var(--void-field-border);
18
+ border-radius: var(--void-control-radius);
15
19
  color: var(--void-color-text);
16
20
  font-family: inherit;
17
- font-size: var(--void-text-sm);
21
+ font-size: var(--_void-field-text);
18
22
  line-height: var(--void-leading-normal);
19
23
  outline: none;
20
24
  transition: border-color var(--void-duration-fast) var(--void-ease-in-out),
@@ -26,7 +30,7 @@ void-textarea textarea::placeholder {
26
30
  }
27
31
 
28
32
  void-textarea textarea:hover {
29
- border-color: var(--void-color-border-strong);
33
+ border-color: var(--void-field-border);
30
34
  }
31
35
 
32
36
  void-textarea textarea:focus {
@@ -49,10 +53,9 @@ void-textarea[error]:not([error=""]) textarea:focus {
49
53
 
50
54
  .void-textarea-error {
51
55
  color: var(--void-color-error);
52
- font-size: var(--void-text-xs);
56
+ font-size: var(--void-type-caption-size);
57
+ line-height: var(--void-type-caption-leading);
53
58
  }
54
59
 
55
- void-textarea[size="sm"] textarea { padding: var(--void-space-1) var(--void-space-2); font-size: var(--void-text-xs); }
56
- void-textarea[size="lg"] textarea { padding: var(--void-space-3) var(--void-space-4); font-size: var(--void-text-base); }
57
- void-textarea[size="xl"] textarea { padding: var(--void-space-4) var(--void-space-5); font-size: var(--void-text-lg); }
58
- void-textarea[size="xxl"] textarea { padding: var(--void-space-5) var(--void-space-6); font-size: var(--void-text-xl); }
60
+ void-textarea[size="sm"] { --_void-field-height: var(--void-control-height-sm); --_void-field-padding: var(--void-control-padding-sm); --_void-field-text: var(--void-control-text-sm); }
61
+ void-textarea[size="lg"] { --_void-field-height: var(--void-control-height-lg); --_void-field-padding: var(--void-control-padding-lg); --_void-field-text: var(--void-control-text-lg); }
@@ -1,7 +1,18 @@
1
+ /* @tokens void-toast
2
+ --void-toast-shadow Shadow of a toast, which lies highest over the page. */
3
+
4
+ /* While it holds toasts the container is a popover="manual" in the top layer;
5
+ reset the UA popover box. */
1
6
  void-toast-container {
2
7
  position: fixed;
8
+ inset: auto;
3
9
  bottom: 0;
4
10
  right: 0;
11
+ margin: 0;
12
+ border: none;
13
+ background: transparent;
14
+ color: inherit;
15
+ overflow: visible;
5
16
  z-index: var(--void-z-toast);
6
17
  display: flex;
7
18
  flex-direction: column;
@@ -10,49 +21,94 @@ void-toast-container {
10
21
  pointer-events: none;
11
22
  }
12
23
 
13
- void-toast-container[position='top-right'] { top: 0; right: 0; bottom: auto; left: auto; }
14
- void-toast-container[position='top-left'] { top: 0; left: 0; bottom: auto; right: auto; }
15
- void-toast-container[position='bottom-right'] { bottom: 0; right: 0; top: auto; left: auto; }
16
- void-toast-container[position='bottom-left'] { bottom: 0; left: 0; top: auto; right: auto; }
17
- void-toast-container[position='top-center'] { top: 0; left: 50%; bottom: auto; right: auto; transform: translateX(-50%); }
18
- void-toast-container[position='bottom-center'] { bottom: 0; left: 50%; top: auto; right: auto; transform: translateX(-50%); }
24
+ void-toast-container[popover]:not(:popover-open) {
25
+ display: none;
26
+ }
27
+
28
+ void-toast-container[placement='top-right'] { top: 0; right: 0; bottom: auto; left: auto; }
29
+ void-toast-container[placement='top-left'] { top: 0; left: 0; bottom: auto; right: auto; }
30
+ void-toast-container[placement='bottom-right'] { bottom: 0; right: 0; top: auto; left: auto; }
31
+ void-toast-container[placement='bottom-left'] { bottom: 0; left: 0; top: auto; right: auto; }
32
+ void-toast-container[placement='top-center'] { top: 0; left: 50%; bottom: auto; right: auto; transform: translateX(-50%); }
33
+ void-toast-container[placement='bottom-center'] { bottom: 0; left: 50%; top: auto; right: auto; transform: translateX(-50%); }
34
+
35
+ /* In-flow strip: the container takes its place in the page layout (position it with sticky, grid, etc. from the app) instead of overlaying content. */
36
+ void-toast-container[placement='inline'] {
37
+ position: static;
38
+ z-index: auto;
39
+ pointer-events: auto;
40
+ align-items: stretch;
41
+ }
42
+
43
+ /* Nothing to show: take no space, whatever the placement. */
44
+ void-toast-container:not(:has(void-toast)) { display: none; }
19
45
 
20
46
  void-toast {
21
- --tone: var(--void-color-accent);
47
+ --_void-tone: var(--void-color-accent);
22
48
  position: relative;
23
49
  pointer-events: auto;
24
50
  display: flex;
25
51
  flex-direction: column;
26
52
  gap: var(--void-space-1);
27
53
  padding: var(--void-space-3) var(--void-space-4);
28
- background: var(--void-color-bg-elevated);
29
- border: 1px solid var(--void-color-border);
30
- border-left: 3px solid var(--tone);
31
- border-radius: var(--void-radius-md);
32
- box-shadow: var(--void-shadow-lg);
54
+ /* One edge all the way round, as every float has. The tone is a straight
55
+ stripe painted on the surface inside that edge and cut off by the
56
+ corners: a wider, differently coloured left border bent round the
57
+ corners into two hooks and replaced the frame a skin had drawn. */
58
+ background:
59
+ linear-gradient(var(--_void-tone), var(--_void-tone)) left / var(--void-space-0h) 100% no-repeat,
60
+ var(--void-float-surface);
61
+ border: var(--void-float-border-width) solid var(--void-float-border);
62
+ border-radius: var(--void-float-radius);
63
+ box-shadow: var(--void-toast-shadow, var(--void-shadow-lg));
33
64
  min-width: 20rem;
34
65
  max-width: 28rem;
35
66
  color: var(--void-color-text);
36
67
  font-family: var(--void-font-sans);
37
- font-size: var(--void-text-sm);
68
+ font-size: var(--void-type-body-size);
38
69
  line-height: var(--void-leading-normal);
39
70
  }
40
71
 
41
- void-toast[color='error'] { --tone: var(--void-color-error); }
42
- void-toast[color='warning'] { --tone: var(--void-color-warning); }
43
- void-toast[color='caution'] { --tone: var(--void-color-caution); }
44
- void-toast[color='success'] { --tone: var(--void-color-success); }
45
- void-toast[color='info'] { --tone: var(--void-color-info); }
72
+ /* Room at the end for the close control, so the message never runs under it. */
73
+ void-toast:has(> void-toast-close) {
74
+ padding-inline-end: var(--void-space-9);
75
+ }
76
+
77
+ void-toast[color='error'] { --_void-tone: var(--void-color-error); }
78
+ void-toast[color='warning'] { --_void-tone: var(--void-color-warning); }
79
+ void-toast[color='caution'] { --_void-tone: var(--void-color-caution); }
80
+ void-toast[color='highlight'] { --_void-tone: var(--void-color-highlight); }
81
+ void-toast[color='success'] { --_void-tone: var(--void-color-success); }
82
+ void-toast[color='info'] { --_void-tone: var(--void-color-info); }
83
+ void-toast[color='notice'] { --_void-tone: var(--void-color-notice); }
46
84
 
47
- .void-toast-heading {
85
+ /* Parts (CSS-only): title, description, actions and the close control the
86
+ author wrote (or the toast() helper built). */
87
+ void-toast-title {
88
+ display: block;
48
89
  font-weight: var(--void-weight-medium);
49
- order: -1;
50
90
  }
51
91
 
52
- .void-toast-close {
92
+ void-toast-description {
93
+ display: block;
94
+ }
95
+
96
+ void-toast-actions {
97
+ display: flex;
98
+ flex-wrap: wrap;
99
+ align-items: center;
100
+ gap: var(--void-space-2);
101
+ margin-top: var(--void-space-1);
102
+ }
103
+
104
+ void-toast-close {
53
105
  position: absolute;
54
106
  top: var(--void-space-2);
55
107
  right: var(--void-space-2);
108
+ display: flex;
109
+ }
110
+
111
+ void-toast-close > button {
56
112
  display: inline-flex;
57
113
  align-items: center;
58
114
  justify-content: center;
@@ -69,6 +125,12 @@ void-toast[color='info'] { --tone: var(--void-color-info); }
69
125
  transition: opacity var(--void-duration-fast) var(--void-ease-in-out);
70
126
  }
71
127
 
72
- .void-toast-close:hover {
128
+ void-toast-close > button:hover {
129
+ opacity: 1;
130
+ }
131
+
132
+ void-toast-close > button:focus-visible {
73
133
  opacity: 1;
134
+ outline: var(--void-focus-ring-width) solid currentColor;
135
+ outline-offset: var(--void-focus-ring-offset);
74
136
  }
@@ -1,18 +1,27 @@
1
+ /* @tokens void-toggle
2
+ --void-toggle-size Least height and width. Applies at every size step; for a proportional change set the --void-control-* steps instead.
3
+ --void-toggle-font-size Size of the label. Applies at every size step; for a proportional change set the --void-control-* steps instead. */
4
+
1
5
  void-toggle {
2
- --tone: var(--void-color-accent);
3
- --tone-subtle: color-mix(in srgb, var(--tone) 14%, transparent);
4
- --tone-border: color-mix(in srgb, var(--tone) 36%, transparent);
5
- --tone-hover: color-mix(in srgb, var(--tone) 22%, transparent);
6
+ --_void-tone: var(--void-color-accent);
7
+ --_void-tone-subtle: color-mix(in srgb, var(--_void-tone) 14%, transparent);
8
+ --_void-tone-border: color-mix(in srgb, var(--_void-tone) 36%, transparent);
9
+ --_void-tone-hover: color-mix(in srgb, var(--_void-tone) 22%, transparent);
10
+
11
+ --_void-toggle-size: var(--void-toggle-size, var(--void-control-height));
12
+ --_void-toggle-font-size: var(--void-toggle-font-size, var(--void-control-text));
6
13
 
7
14
  display: inline-grid;
8
15
  place-content: center;
9
- padding: var(--void-space-2);
10
- border: 1px solid var(--void-color-border);
11
- border-radius: var(--void-radius-md);
16
+ min-width: var(--_void-toggle-size);
17
+ min-height: var(--_void-toggle-size);
18
+ padding: 0 var(--void-space-2);
19
+ border: var(--void-control-border-width) solid var(--void-control-border);
20
+ border-radius: var(--void-control-radius);
12
21
  background: transparent;
13
22
  color: var(--void-color-text-secondary);
14
23
  font-family: var(--void-font-sans);
15
- font-size: var(--void-text-sm);
24
+ font-size: var(--_void-toggle-font-size);
16
25
  font-weight: var(--void-weight-medium);
17
26
  cursor: pointer;
18
27
  user-select: none;
@@ -22,28 +31,28 @@ void-toggle {
22
31
  }
23
32
 
24
33
  void-toggle:hover {
25
- background: var(--tone-hover);
26
- border-color: var(--void-color-border-strong);
34
+ background: var(--_void-tone-hover);
35
+ border-color: var(--void-control-border);
27
36
  }
28
37
 
29
38
  void-toggle:focus-visible {
30
- outline: 2px solid var(--void-color-border-focus);
31
- outline-offset: 2px;
39
+ outline: var(--void-focus-ring-width) solid var(--void-focus-ring-color);
40
+ outline-offset: var(--void-focus-ring-offset);
32
41
  }
33
42
 
34
43
  void-toggle[pressed] {
35
- background: var(--tone-subtle);
36
- border-color: var(--tone-border);
44
+ background: var(--_void-tone-subtle);
45
+ border-color: var(--_void-tone-border);
37
46
  color: var(--void-color-text);
38
47
  }
39
48
 
40
49
  void-toggle[pressed]:hover {
41
- background: var(--tone-hover);
50
+ background: var(--_void-tone-hover);
42
51
  }
43
52
 
44
53
  void-toggle[variant="filled"][pressed] {
45
- background: var(--tone);
46
- border-color: var(--tone);
54
+ background: var(--_void-tone);
55
+ border-color: var(--_void-tone);
47
56
  color: var(--void-color-text-on-accent);
48
57
  }
49
58
 
@@ -51,32 +60,16 @@ void-toggle[variant="filled"][pressed]:hover {
51
60
  opacity: 0.9;
52
61
  }
53
62
 
54
- void-toggle[color="error"] { --tone: var(--void-color-error); }
55
- void-toggle[color="warning"] { --tone: var(--void-color-warning); }
56
- void-toggle[color="caution"] { --tone: var(--void-color-caution); }
57
- void-toggle[color="success"] { --tone: var(--void-color-success); }
58
- void-toggle[color="info"] { --tone: var(--void-color-info); }
59
- void-toggle[color="notice"] { --tone: var(--void-color-notice); }
63
+ void-toggle[color="error"] { --_void-tone: var(--void-color-error); }
64
+ void-toggle[color="warning"] { --_void-tone: var(--void-color-warning); }
65
+ void-toggle[color="caution"] { --_void-tone: var(--void-color-caution); }
66
+ void-toggle[color="highlight"] { --_void-tone: var(--void-color-highlight); }
67
+ void-toggle[color="success"] { --_void-tone: var(--void-color-success); }
68
+ void-toggle[color="info"] { --_void-tone: var(--void-color-info); }
69
+ void-toggle[color="notice"] { --_void-tone: var(--void-color-notice); }
60
70
 
61
- void-toggle[size="sm"] {
62
- padding: var(--void-space-1);
63
- font-size: var(--void-text-xs);
64
- }
65
-
66
- void-toggle[size="lg"] {
67
- padding: var(--void-space-3);
68
- font-size: var(--void-text-base);
69
- }
70
-
71
- void-toggle[size="xl"] {
72
- padding: var(--void-space-4);
73
- font-size: var(--void-text-lg);
74
- }
75
-
76
- void-toggle[size="xxl"] {
77
- padding: var(--void-space-5);
78
- font-size: var(--void-text-xl);
79
- }
71
+ void-toggle[size="sm"] { --_void-toggle-size: var(--void-toggle-size, var(--void-control-height-sm)); --_void-toggle-font-size: var(--void-toggle-font-size, var(--void-control-text-sm)); }
72
+ void-toggle[size="lg"] { --_void-toggle-size: var(--void-toggle-size, var(--void-control-height-lg)); --_void-toggle-font-size: var(--void-toggle-font-size, var(--void-control-text-lg)); }
80
73
 
81
74
  void-toggle[disabled] {
82
75
  opacity: 0.5;
@@ -1,49 +1,30 @@
1
+ /* @tokens void-tooltip
2
+ --void-tooltip-surface Fill of the bubble.
3
+ --void-tooltip-ink Text colour of the bubble. Set it with the surface: lint:contrast checks the pair.
4
+ --void-tooltip-border Edge colour of the bubble. */
5
+
1
6
  void-tooltip {
2
- position: relative;
3
7
  display: inline-flex;
4
8
  }
5
9
 
6
- .void-tooltip-bubble {
7
- position: absolute;
8
- bottom: calc(100% + var(--void-space-1));
9
- left: 50%;
10
- transform: translateX(-50%);
11
- background: var(--void-color-bg-elevated);
12
- border: 1px solid var(--void-color-border);
10
+ /* The trigger part wraps the control and draws nothing itself: the control is
11
+ the box (and the anchor's only in-flow content), before and after upgrade. */
12
+ void-tooltip-trigger {
13
+ display: contents;
14
+ }
15
+
16
+ /* A popover="manual" surface in the top layer; placement, gap, flipping and
17
+ transitions are shared (overlay.css). */
18
+ void-tooltip-content {
19
+ --void-overlay-gap: var(--void-space-1);
20
+ background: var(--void-tooltip-surface, var(--void-float-surface));
21
+ border: var(--void-float-border-width) solid var(--void-tooltip-border, var(--void-float-border));
13
22
  border-radius: var(--void-radius-sm);
14
23
  padding: var(--void-space-1) var(--void-space-2);
15
24
  font-family: var(--void-font-sans);
16
25
  font-size: var(--void-text-xs);
17
- color: var(--void-color-text);
26
+ color: var(--void-tooltip-ink, var(--void-color-text));
18
27
  white-space: nowrap;
19
28
  pointer-events: none;
20
- opacity: 0;
21
- transition: opacity var(--void-duration-fast) var(--void-ease-in-out);
22
- z-index: var(--void-z-tooltip);
23
- }
24
-
25
- void-tooltip[visible] .void-tooltip-bubble {
26
- opacity: 1;
27
- }
28
-
29
- void-tooltip[position="bottom"] .void-tooltip-bubble {
30
- bottom: auto;
31
- top: calc(100% + var(--void-space-1));
32
- left: 50%;
33
- transform: translateX(-50%);
34
- }
35
-
36
- void-tooltip[position="left"] .void-tooltip-bubble {
37
- bottom: auto;
38
- left: auto;
39
- top: 50%;
40
- right: calc(100% + var(--void-space-1));
41
- transform: translateY(-50%);
42
- }
43
-
44
- void-tooltip[position="right"] .void-tooltip-bubble {
45
- bottom: auto;
46
- left: calc(100% + var(--void-space-1));
47
- top: 50%;
48
- transform: translateY(-50%);
29
+ overflow: visible;
49
30
  }