m3-svelte 6.0.0 → 6.0.2

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 (42) hide show
  1. package/README.md +1 -1
  2. package/package/buttons/Button.svelte +15 -46
  3. package/package/buttons/FAB.svelte +1 -8
  4. package/package/buttons/SplitButton.svelte +2 -9
  5. package/package/containers/BottomSheet.svelte +4 -4
  6. package/package/containers/Dialog.svelte +3 -15
  7. package/package/containers/ListItem.svelte +7 -31
  8. package/package/containers/MenuItem.svelte +4 -10
  9. package/package/containers/Snackbar.svelte +3 -15
  10. package/package/containers/StandardSideSheet.svelte +1 -7
  11. package/package/forms/Checkbox.svelte +2 -3
  12. package/package/forms/Chip.svelte +4 -11
  13. package/package/forms/CircularProgressEstimate.svelte +1 -33
  14. package/package/forms/DateField.svelte +7 -19
  15. package/package/forms/DateFieldOutlined.svelte +9 -21
  16. package/package/forms/LinearProgressEstimate.svelte +1 -98
  17. package/package/forms/RadioAnim1.svelte +1 -2
  18. package/package/forms/RadioAnim2.svelte +1 -2
  19. package/package/forms/RadioAnim3.svelte +1 -2
  20. package/package/forms/Select.svelte +4 -16
  21. package/package/forms/SelectOutlined.svelte +4 -16
  22. package/package/forms/Slider.svelte +6 -12
  23. package/package/forms/Switch.svelte +7 -8
  24. package/package/forms/TextField.svelte +10 -29
  25. package/package/forms/TextFieldMultiline.svelte +11 -37
  26. package/package/forms/TextFieldOutlined.svelte +8 -27
  27. package/package/forms/TextFieldOutlinedMultiline.svelte +9 -35
  28. package/package/forms/_picker/CalendarPicker.svelte +1 -7
  29. package/package/forms/_picker/FocusPicker.svelte +1 -7
  30. package/package/forms/_picker/Header.svelte +2 -8
  31. package/package/forms/_picker/Item.svelte +2 -8
  32. package/package/misc/Layer.svelte +18 -16
  33. package/package/misc/recommended-styles.css +1 -1
  34. package/package/misc/styles.css +109 -16
  35. package/package/misc/tailwind-styles.css +15 -105
  36. package/package/nav/NavCMLX.svelte +8 -38
  37. package/package/nav/NavCMLXItem.svelte +19 -277
  38. package/package/nav/Tabs.svelte +1 -8
  39. package/package/nav/TabsLink.svelte +1 -8
  40. package/package/nav/VariableTabs.svelte +1 -8
  41. package/package/nav/VariableTabsLink.svelte +1 -8
  42. package/package.json +7 -5
package/README.md CHANGED
@@ -1,3 +1,3 @@
1
- # m3-svelte
1
+ # M3 Svelte
2
2
 
3
3
  M3 Svelte implements the Material 3 design system in Svelte. See the [website](https://ktibow.github.io/m3-svelte/) for demos and usage instructions.
@@ -55,14 +55,8 @@
55
55
 
56
56
  <style>
57
57
  .m3-container.xs {
58
-
59
- font-family: var(--m3-font);
60
- font-size: 0.875rem;
61
- line-height: 1.429;
62
- letter-spacing: 0.006rem;
63
- font-weight: 500;
64
-
65
- height: calc(2rem + (var(--m3v-density) * 0.25rem));
58
+ @apply --m3-label-large;
59
+ height: --m3-density(2rem);
66
60
  padding: 0 0.75rem;
67
61
  gap: 0.5rem;
68
62
  --shape: 1rem;
@@ -76,14 +70,8 @@
76
70
  }
77
71
 
78
72
  .m3-container.s {
79
-
80
- font-family: var(--m3-font);
81
- font-size: 0.875rem;
82
- line-height: 1.429;
83
- letter-spacing: 0.006rem;
84
- font-weight: 500;
85
-
86
- height: calc(2.5rem + (var(--m3v-density) * 0.25rem));
73
+ @apply --m3-label-large;
74
+ height: --m3-density(2.5rem);
87
75
  padding: 0 1rem;
88
76
  gap: 0.5rem;
89
77
  --shape: 1.25rem;
@@ -97,14 +85,8 @@
97
85
  }
98
86
 
99
87
  .m3-container.m {
100
-
101
- font-family: var(--m3-font);
102
- font-size: 1rem;
103
- line-height: 1.5;
104
- letter-spacing: 0;
105
- font-weight: 500;
106
-
107
- height: calc(3.5rem + (var(--m3v-density) * 0.25rem));
88
+ @apply --m3-title-medium;
89
+ height: --m3-density(3.5rem);
108
90
  padding: 0 1.5rem;
109
91
  gap: 0.5rem;
110
92
  --shape: 1.75rem;
@@ -126,14 +108,8 @@
126
108
  }
127
109
 
128
110
  .m3-container.l {
129
-
130
- font-family: var(--m3-font);
131
- font-size: 1.5rem;
132
- line-height: 1.333;
133
- letter-spacing: 0;
134
- font-weight: 400;
135
-
136
- height: calc(6rem + (var(--m3v-density) * 0.25rem));
111
+ @apply --m3-headline-small;
112
+ height: --m3-density(6rem);
137
113
  padding: 0 3rem;
138
114
  gap: 0.75rem;
139
115
  --shape: 3rem;
@@ -155,14 +131,8 @@
155
131
  }
156
132
 
157
133
  .m3-container.xl {
158
-
159
- font-family: var(--m3-font);
160
- font-size: 2rem;
161
- line-height: 1.25;
162
- letter-spacing: 0;
163
- font-weight: 400;
164
-
165
- height: calc(8.5rem + (var(--m3v-density) * 0.25rem));
134
+ @apply --m3-headline-large;
135
+ height: --m3-density(8.5rem);
166
136
  padding: 0 4rem;
167
137
  gap: 1rem;
168
138
  --shape: 4.25rem;
@@ -202,8 +172,8 @@
202
172
 
203
173
  &:disabled,
204
174
  &:is(:global(input:disabled) + label) {
205
- background-color: oklab(from var(--m3c-on-surface) l a b / 0.12);
206
- color: oklab(from var(--m3c-on-surface) l a b / 0.38);
175
+ background-color: --translucent(var(--m3c-on-surface), 0.12);
176
+ color: --translucent(var(--m3c-on-surface), 0.38);
207
177
  cursor: auto;
208
178
  }
209
179
 
@@ -259,7 +229,7 @@
259
229
  }
260
230
  }
261
231
  &.outlined:is(:disabled, :global(input:disabled) + label) {
262
- outline-color: oklab(from var(--m3c-on-surface) l a b / 0.12);
232
+ outline-color: --translucent(var(--m3c-on-surface), 0.12);
263
233
  background-color: transparent;
264
234
  }
265
235
  &.text:not(:disabled, :global(input:disabled) + label) {
@@ -271,8 +241,8 @@
271
241
  }
272
242
  }
273
243
 
274
- &.square:not(:is(:global(input:checked) + label, :global(:open) > summary)),
275
- &:is(:global(input:checked) + label, :global(:open) > summary):not(.square) {
244
+ &.square:not(:global(input:checked) + label, :global(:open) > summary),
245
+ &:not(.square):is(:global(input:checked) + label, :global(:open) > summary) {
276
246
  border-radius: var(--square-shape);
277
247
  }
278
248
  &:active:not(:disabled, :global(input:disabled) + label) {
@@ -290,7 +260,6 @@
290
260
 
291
261
  .m3-container {
292
262
  print-color-adjust: exact;
293
- -webkit-print-color-adjust: exact;
294
263
  }
295
264
  @media screen and (forced-colors: active) {
296
265
  .m3-container:is(.elevated, .filled, .tonal) {
@@ -59,13 +59,7 @@
59
59
  }
60
60
  }
61
61
  button {
62
-
63
- font-family: var(--m3-font);
64
- font-size: 0.875rem;
65
- line-height: 1.429;
66
- letter-spacing: 0.006rem;
67
- font-weight: 500;
68
-
62
+ @apply --m3-label-large;
69
63
  display: inline-flex;
70
64
  border: none;
71
65
  position: relative;
@@ -147,7 +141,6 @@
147
141
 
148
142
  .m3-container {
149
143
  print-color-adjust: exact;
150
- -webkit-print-color-adjust: exact;
151
144
  }
152
145
  @media screen and (forced-colors: active) {
153
146
  button {
@@ -93,7 +93,7 @@
93
93
  display: flex;
94
94
  align-items: center;
95
95
  justify-content: center;
96
- height: calc(2.5rem + (var(--m3v-density) * 0.25rem));
96
+ height: --m3-density(2.5rem);
97
97
  gap: 0.5rem;
98
98
 
99
99
  cursor: pointer;
@@ -107,13 +107,7 @@
107
107
  }
108
108
 
109
109
  button {
110
-
111
- font-family: var(--m3-font);
112
- font-size: 0.875rem;
113
- line-height: 1.429;
114
- letter-spacing: 0.006rem;
115
- font-weight: 500;
116
-
110
+ @apply --m3-label-large;
117
111
  padding-inline-start: 1rem;
118
112
  padding-inline-end: 0.75rem;
119
113
  border-start-start-radius: var(--m3-split-button-outer-shape);
@@ -187,6 +181,5 @@
187
181
 
188
182
  .m3-container {
189
183
  print-color-adjust: exact;
190
- -webkit-print-color-adjust: exact;
191
184
  }
192
185
  </style>
@@ -110,7 +110,7 @@
110
110
  padding: 0;
111
111
  }
112
112
  dialog::backdrop {
113
- background-color: oklab(from var(--m3c-scrim) l a b / 0.5);
113
+ background-color: --translucent(var(--m3c-scrim), 0.5);
114
114
  animation: backdrop 400ms;
115
115
  }
116
116
  dialog:global(.leaving)::backdrop {
@@ -129,7 +129,7 @@
129
129
  cursor: grab;
130
130
  }
131
131
  .handle {
132
- background-color: oklab(from var(--m3c-on-surface-variant) l a b / 0.4);
132
+ background-color: --translucent(var(--m3c-on-surface-variant), 0.4);
133
133
  width: 2rem;
134
134
  height: 0.25rem;
135
135
  border-radius: 0.25rem;
@@ -139,12 +139,12 @@
139
139
  background-color: transparent;
140
140
  }
141
141
  100% {
142
- background-color: oklab(from var(--m3c-scrim) l a b / 0.5);
142
+ background-color: --translucent(var(--m3c-scrim), 0.5);
143
143
  }
144
144
  }
145
145
  @keyframes backdropReverse {
146
146
  0% {
147
- background-color: oklab(from var(--m3c-scrim) l a b / 0.5);
147
+ background-color: --translucent(var(--m3c-scrim), 0.5);
148
148
  }
149
149
  100% {
150
150
  background-color: transparent;
@@ -76,13 +76,7 @@
76
76
  }
77
77
  }
78
78
  .headline {
79
-
80
- font-family: var(--m3-font);
81
- font-size: 1.5rem;
82
- line-height: 1.333;
83
- letter-spacing: 0;
84
- font-weight: 400;
85
-
79
+ @apply --m3-headline-small;
86
80
  color: var(--m3c-on-surface);
87
81
  margin-top: 0;
88
82
  margin-bottom: 1rem;
@@ -91,13 +85,7 @@
91
85
  text-align: center;
92
86
  }
93
87
  .content {
94
-
95
- font-family: var(--m3-font);
96
- font-size: 0.875rem;
97
- line-height: 1.429;
98
- letter-spacing: 0.016rem;
99
- font-weight: 400;
100
-
88
+ @apply --m3-body-medium;
101
89
  color: var(--m3c-on-surface-variant);
102
90
  margin-bottom: 1.5rem;
103
91
  }
@@ -137,7 +125,7 @@
137
125
  opacity var(--m3-easing-fast) 100ms backwards;
138
126
  }
139
127
  dialog::backdrop {
140
- background-color: oklab(from var(--m3c-scrim) l a b / 0.3);
128
+ background-color: --translucent(var(--m3c-scrim), 0.3);
141
129
  animation: opacity var(--m3-timing-function-emphasized-decel) 500ms;
142
130
  }
143
131
  @keyframes dialogIn {
@@ -93,13 +93,13 @@
93
93
  cursor: pointer;
94
94
  }
95
95
  .lines-1 {
96
- height: calc(3.5rem + (var(--m3v-density) * 0.25rem));
96
+ height: --m3-density(3.5rem);
97
97
  }
98
98
  .lines-2 {
99
- height: calc(4.5rem + (var(--m3v-density) * 0.25rem));
99
+ height: --m3-density(4.5rem);
100
100
  }
101
101
  .lines-3 {
102
- height: calc(5.5rem + (var(--m3v-density) * 0.25rem));
102
+ height: --m3-density(5.5rem);
103
103
  padding-top: 0.75rem;
104
104
  padding-bottom: 0.75rem;
105
105
  align-items: flex-start;
@@ -113,13 +113,7 @@
113
113
  color: var(--m3c-on-surface-variant);
114
114
  }
115
115
  .trailing {
116
-
117
- font-family: var(--m3-font);
118
- font-size: 0.688rem;
119
- line-height: 1.455;
120
- letter-spacing: 0.031rem;
121
- font-weight: 500;
122
-
116
+ @apply --m3-label-small;
123
117
  }
124
118
  .leading > :global(svg),
125
119
  .trailing > :global(svg) {
@@ -132,33 +126,15 @@
132
126
  margin: 0;
133
127
  }
134
128
  .supporting {
135
-
136
- font-family: var(--m3-font);
137
- font-size: 0.875rem;
138
- line-height: 1.429;
139
- letter-spacing: 0.016rem;
140
- font-weight: 400;
141
-
129
+ @apply --m3-body-medium;
142
130
  color: var(--m3c-on-surface-variant);
143
131
  }
144
132
  .overline- {
145
-
146
- font-family: var(--m3-font);
147
- font-size: 0.688rem;
148
- line-height: 1.455;
149
- letter-spacing: 0.031rem;
150
- font-weight: 500;
151
-
133
+ @apply --m3-label-small;
152
134
  color: var(--m3c-on-surface-variant);
153
135
  }
154
136
  .headline {
155
-
156
- font-family: var(--m3-font);
157
- font-size: 1rem;
158
- line-height: 1.5;
159
- letter-spacing: 0;
160
- font-weight: 400;
161
-
137
+ @apply --m3-body-large;
162
138
  color: var(--m3c-on-surface);
163
139
  }
164
140
  </style>
@@ -31,16 +31,10 @@
31
31
 
32
32
  <style>
33
33
  .item {
34
-
35
- font-family: var(--m3-font);
36
- font-size: 0.875rem;
37
- line-height: 1.429;
38
- letter-spacing: 0.006rem;
39
- font-weight: 500;
40
-
34
+ @apply --m3-label-large;
41
35
  display: flex;
42
36
  align-items: center;
43
- height: calc(3rem + (var(--m3v-density) * 0.25rem));
37
+ height: --m3-density(3rem);
44
38
  padding: 0 0.75rem;
45
39
  gap: 0.75rem;
46
40
  white-space: nowrap;
@@ -63,10 +57,10 @@
63
57
  }
64
58
 
65
59
  .item:disabled {
66
- color: oklab(from var(--m3c-on-surface) l a b / 0.38);
60
+ color: --translucent(var(--m3c-on-surface), 0.38);
67
61
  cursor: auto;
68
62
  }
69
63
  .item:disabled > .icon > :global(svg) {
70
- color: oklab(from var(--m3c-on-surface) l a b / 0.38);
64
+ color: --translucent(var(--m3c-on-surface), 0.38);
71
65
  }
72
66
  </style>
@@ -27,7 +27,7 @@
27
27
  let shown:
28
28
  | { message: string; actions: Record<string, () => void>; closable: boolean }
29
29
  | undefined = $state();
30
- let timeoutId: number;
30
+ let timeoutId: ReturnType<typeof setTimeout>;
31
31
  _show = (message, actions = {}, closable = false, timeout = 4000) => {
32
32
  clearTimeout(timeoutId);
33
33
  shown = { message, actions, closable };
@@ -86,13 +86,7 @@
86
86
  z-index: 3;
87
87
  }
88
88
  p {
89
-
90
- font-family: var(--m3-font);
91
- font-size: 0.875rem;
92
- line-height: 1.429;
93
- letter-spacing: 0.016rem;
94
- font-weight: 400;
95
-
89
+ @apply --m3-body-medium;
96
90
  margin-right: auto;
97
91
  }
98
92
  button {
@@ -114,13 +108,7 @@
114
108
  }
115
109
 
116
110
  .action {
117
-
118
- font-family: var(--m3-font);
119
- font-size: 0.875rem;
120
- line-height: 1.429;
121
- letter-spacing: 0.006rem;
122
- font-weight: 500;
123
-
111
+ @apply --m3-label-large;
124
112
  color: var(--m3c-inverse-primary);
125
113
  padding: 0 0.5rem;
126
114
  }
@@ -38,13 +38,7 @@
38
38
  padding: 1.5rem;
39
39
  }
40
40
  .header > span {
41
-
42
- font-family: var(--m3-font);
43
- font-size: 1.375rem;
44
- line-height: 1.273;
45
- letter-spacing: 0;
46
- font-weight: 400;
47
-
41
+ @apply --m3-title-large;
48
42
  }
49
43
  .header > :global(button.m3-container) {
50
44
  color: var(--m3c-on-surface-variant);
@@ -93,7 +93,7 @@
93
93
  }
94
94
 
95
95
  :global(input:disabled) + .layer-container {
96
- color: oklab(from var(--m3c-on-surface) l a b / 0.38);
96
+ color: --translucent(var(--m3c-on-surface), 0.38);
97
97
  cursor: not-allowed;
98
98
  }
99
99
 
@@ -101,7 +101,7 @@
101
101
  color: transparent;
102
102
  }
103
103
  :global(input:disabled:checked) + .layer-container .checkbox-box {
104
- background-color: oklab(from var(--m3c-on-surface) l a b / 0.38);
104
+ background-color: --translucent(var(--m3c-on-surface), 0.38);
105
105
  }
106
106
 
107
107
  :global(input:disabled) ~ svg {
@@ -110,7 +110,6 @@
110
110
 
111
111
  .m3-container {
112
112
  print-color-adjust: exact;
113
- -webkit-print-color-adjust: exact;
114
113
  }
115
114
  @media screen and (forced-colors: active) {
116
115
  :global(input:checked) + .layer-container .checkbox-box {
@@ -105,13 +105,7 @@
105
105
  }
106
106
 
107
107
  span {
108
-
109
- font-family: var(--m3-font);
110
- font-size: 0.875rem;
111
- line-height: 1.429;
112
- letter-spacing: 0.006rem;
113
- font-weight: 500;
114
-
108
+ @apply --m3-label-large;
115
109
  }
116
110
 
117
111
  .assist {
@@ -147,9 +141,9 @@
147
141
  .m3-container:disabled {
148
142
  cursor: auto;
149
143
  box-shadow: none;
150
- border-color: oklab(from var(--m3c-on-surface) l a b / 0.12);
144
+ border-color: --translucent(var(--m3c-on-surface), 0.12);
151
145
  background-color: var(--m3c-surface);
152
- color: oklab(from var(--m3c-on-surface) l a b / 0.38);
146
+ color: --translucent(var(--m3c-on-surface), 0.38);
153
147
  }
154
148
  .selected:disabled,
155
149
  .elevated:disabled {
@@ -157,12 +151,11 @@
157
151
  }
158
152
  .selected:disabled,
159
153
  .elevated:disabled {
160
- background-color: oklab(from var(--m3c-on-surface) l a b / 0.12);
154
+ background-color: --translucent(var(--m3c-on-surface), 0.12);
161
155
  }
162
156
 
163
157
  .m3-container {
164
158
  print-color-adjust: exact;
165
- -webkit-print-color-adjust: exact;
166
159
  }
167
160
  @media screen and (forced-colors: active) {
168
161
  .selected {
@@ -55,39 +55,7 @@
55
55
  }
56
56
 
57
57
  .percent {
58
- animation: grow
59
- linear(
60
- 0,
61
- 0.08 1.5%,
62
- 0.15 2.93%,
63
- 0.22 4.48%,
64
- 0.29 6.18%,
65
- 0.35 7.77%,
66
- 0.41 9.52%,
67
- 0.47 11.45%,
68
- 0.52 13.24%,
69
- 0.57 15.22%,
70
- 0.61 16.98%,
71
- 0.65 18.93%,
72
- 0.69 21.12%,
73
- 0.73 23.61%,
74
- 0.76 25.74%,
75
- 0.79 28.14%,
76
- 0.82 30.92%,
77
- 0.84 33.05%,
78
- 0.86 35.46%,
79
- 0.88 38.24%,
80
- 0.9 41.52%,
81
- 0.92 45.55%,
82
- 0.93 47.96%,
83
- 0.95 54.02%,
84
- 0.96 58.05%,
85
- 0.97 63.24%,
86
- 0.98 70.55%,
87
- 0.99 83.05%,
88
- 1
89
- )
90
- var(--speed) both;
58
+ animation: grow var(--m3-timing-function-zeno) var(--speed) both;
91
59
  }
92
60
 
93
61
  @keyframes grow {
@@ -116,7 +116,7 @@ opacity: ${Math.min(t * 3, 1)};`,
116
116
  }
117
117
  .m3-container {
118
118
  position: relative;
119
- height: calc(3.5rem + (var(--m3v-density) * 0.25rem));
119
+ height: --m3-density(3.5rem);
120
120
  min-width: 15rem;
121
121
  background-color: var(--m3c-surface-container-highest);
122
122
  border-radius: var(--m3-field-shape) var(--m3-field-shape) 0 0;
@@ -124,13 +124,7 @@ opacity: ${Math.min(t * 3, 1)};`,
124
124
  anchor-name: var(--anchor-name);
125
125
  }
126
126
  input {
127
-
128
- font-family: var(--m3-font);
129
- font-size: 1rem;
130
- line-height: 1.5;
131
- letter-spacing: 0;
132
- font-weight: 400;
133
-
127
+ @apply --m3-body-large;
134
128
  position: absolute;
135
129
  inset: 0;
136
130
  width: 100%;
@@ -152,13 +146,7 @@ opacity: ${Math.min(t * 3, 1)};`,
152
146
  color: var(--m3c-on-surface);
153
147
  }
154
148
  label {
155
-
156
- font-family: var(--m3-font);
157
- font-size: 0.75rem;
158
- line-height: 1.333;
159
- letter-spacing: 0.025rem;
160
- font-weight: 400;
161
-
149
+ @apply --m3-body-small;
162
150
  position: absolute;
163
151
  inset-inline-start: 1rem;
164
152
  top: 0.5rem;
@@ -185,15 +173,15 @@ opacity: ${Math.min(t * 3, 1)};`,
185
173
  }
186
174
 
187
175
  .m3-container.disabled {
188
- background-color: oklab(from var(--m3c-on-surface) l a b / 0.04);
189
- border-bottom-color: oklab(from var(--m3c-on-surface) l a b / 0.38);
176
+ background-color: --translucent(var(--m3c-on-surface), 0.04);
177
+ border-bottom-color: --translucent(var(--m3c-on-surface), 0.38);
190
178
  }
191
179
  input:disabled,
192
180
  input:disabled + label {
193
- color: oklab(from var(--m3c-on-surface) l a b / 0.38);
181
+ color: --translucent(var(--m3c-on-surface), 0.38);
194
182
  }
195
183
  button:disabled {
196
- color: oklab(from var(--m3c-on-surface-variant) l a b / 0.38);
184
+ color: --translucent(var(--m3c-on-surface-variant), 0.38);
197
185
  cursor: auto;
198
186
  }
199
187
 
@@ -122,18 +122,12 @@ opacity: ${Math.min(t * 3, 1)};`,
122
122
  .m3-container {
123
123
  display: inline-flex;
124
124
  position: relative;
125
- height: calc(3.5rem + (var(--m3v-density) * 0.25rem));
125
+ height: --m3-density(3.5rem);
126
126
  min-width: 15rem;
127
127
  anchor-name: var(--anchor-name);
128
128
  }
129
129
  input {
130
-
131
- font-family: var(--m3-font);
132
- font-size: 1rem;
133
- line-height: 1.5;
134
- letter-spacing: 0;
135
- font-weight: 400;
136
-
130
+ @apply --m3-body-large;
137
131
  position: absolute;
138
132
  inset: 0;
139
133
  width: 100%;
@@ -156,13 +150,7 @@ opacity: ${Math.min(t * 3, 1)};`,
156
150
  color: var(--m3c-on-surface);
157
151
  }
158
152
  label {
159
-
160
- font-family: var(--m3-font);
161
- font-size: 0.75rem;
162
- line-height: 1.333;
163
- letter-spacing: 0.025rem;
164
- font-weight: 400;
165
-
153
+ @apply --m3-body-small;
166
154
  position: absolute;
167
155
  inset-inline-start: 0.75rem;
168
156
  top: 0;
@@ -177,7 +165,7 @@ opacity: ${Math.min(t * 3, 1)};`,
177
165
  color: var(--error, var(--m3c-primary));
178
166
  }
179
167
  &:is(input:disabled ~ label) {
180
- color: oklab(from var(--m3c-on-surface) l a b / 0.38);
168
+ color: --translucent(var(--m3c-on-surface), 0.38);
181
169
  }
182
170
  pointer-events: none;
183
171
  transition: color 100ms;
@@ -197,7 +185,7 @@ opacity: ${Math.min(t * 3, 1)};`,
197
185
  border-width: 0.125rem;
198
186
  }
199
187
  &:is(input:disabled ~ .layer) {
200
- border-color: oklab(from var(--m3c-on-surface) l a b / 0.38);
188
+ border-color: --translucent(var(--m3c-on-surface), 0.38);
201
189
  }
202
190
  }
203
191
 
@@ -221,12 +209,12 @@ opacity: ${Math.min(t * 3, 1)};`,
221
209
 
222
210
  @media (hover: hover) {
223
211
  button:hover {
224
- background-color: oklab(from var(--m3c-on-surface-variant) l a b / 0.08);
212
+ background-color: --translucent(var(--m3c-on-surface-variant), 0.08);
225
213
  }
226
214
  }
227
215
  button:focus-visible,
228
216
  button:active {
229
- background-color: oklab(from var(--m3c-on-surface-variant) l a b / 0.12);
217
+ background-color: --translucent(var(--m3c-on-surface-variant), 0.12);
230
218
  }
231
219
 
232
220
  .error {
@@ -241,10 +229,10 @@ opacity: ${Math.min(t * 3, 1)};`,
241
229
  opacity: 0.38;
242
230
  }
243
231
  input:disabled {
244
- color: oklab(from var(--m3c-on-surface) l a b / 0.38);
232
+ color: --translucent(var(--m3c-on-surface), 0.38);
245
233
  }
246
234
  button:disabled {
247
- color: oklab(from var(--m3c-on-surface-variant) l a b / 0.38);
235
+ color: --translucent(var(--m3c-on-surface-variant), 0.38);
248
236
  cursor: auto;
249
237
  }
250
238