@threadlabs/looma 0.51.1 → 0.51.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.
- package/components/ui-button/ui-button.html +167 -12
- package/dist/index.js +1 -1
- package/docs/catalog.json +97 -2
- package/editor/components.css +153 -14
- package/editor/index.js +360 -208
- package/package.json +1 -1
- package/styles/ui-button.css +153 -14
- package/vanilla/UiButton.d.ts +2 -0
- package/vanilla/UiButton.js +206 -150
package/docs/catalog.json
CHANGED
|
@@ -533,7 +533,7 @@
|
|
|
533
533
|
],
|
|
534
534
|
"schemaVersion": 1,
|
|
535
535
|
"package": "@threadlabs/looma",
|
|
536
|
-
"version": "0.51.
|
|
536
|
+
"version": "0.51.2",
|
|
537
537
|
"groups": [
|
|
538
538
|
{
|
|
539
539
|
"id": "layout",
|
|
@@ -2256,6 +2256,12 @@
|
|
|
2256
2256
|
},
|
|
2257
2257
|
{
|
|
2258
2258
|
"name": "--ui-button-active-surface",
|
|
2259
|
+
"declarations": [
|
|
2260
|
+
"oklch(from var(--_tone) l c h / calc(18% * var(--ui-tonal-opacity, 1)))",
|
|
2261
|
+
"var(--ui-neutral-active)",
|
|
2262
|
+
"var(--_tone-active)",
|
|
2263
|
+
"var(--ui-neutral-active)"
|
|
2264
|
+
],
|
|
2259
2265
|
"fallbacks": [
|
|
2260
2266
|
"oklch(from var(--_tone) l c h / calc(18% * var(--ui-tonal-opacity, 1)))",
|
|
2261
2267
|
"var(--ui-neutral-active)"
|
|
@@ -2341,7 +2347,11 @@
|
|
|
2341
2347
|
"var(--ui-danger-hover-border, var(--ui-danger-hover))",
|
|
2342
2348
|
"var(--ui-success-hover-border, var(--ui-success-hover))",
|
|
2343
2349
|
"var(--ui-warning-hover-border, var(--ui-warning-hover))",
|
|
2344
|
-
"var(--ui-info-hover-border, var(--ui-info-hover))"
|
|
2350
|
+
"var(--ui-info-hover-border, var(--ui-info-hover))",
|
|
2351
|
+
"var(--_tone-outline-border)",
|
|
2352
|
+
"var(--ui-control-border-hover)",
|
|
2353
|
+
"var(--_tone-text)",
|
|
2354
|
+
"var(--ui-border-strong)"
|
|
2345
2355
|
],
|
|
2346
2356
|
"fallbacks": [
|
|
2347
2357
|
"var(--ui-border-strong)",
|
|
@@ -2351,6 +2361,10 @@
|
|
|
2351
2361
|
},
|
|
2352
2362
|
{
|
|
2353
2363
|
"name": "--ui-button-hover-surface",
|
|
2364
|
+
"declarations": [
|
|
2365
|
+
"var(--_tone-hover)",
|
|
2366
|
+
"var(--ui-neutral-hover)"
|
|
2367
|
+
],
|
|
2354
2368
|
"fallbacks": [
|
|
2355
2369
|
"transparent",
|
|
2356
2370
|
"oklch(from var(--_tone-text) l c h / calc(12% * var(--ui-tonal-opacity, 1)))",
|
|
@@ -2360,6 +2374,9 @@
|
|
|
2360
2374
|
},
|
|
2361
2375
|
{
|
|
2362
2376
|
"name": "--ui-button-link-hover-text",
|
|
2377
|
+
"declarations": [
|
|
2378
|
+
"var(--_hue-text)"
|
|
2379
|
+
],
|
|
2363
2380
|
"fallbacks": [
|
|
2364
2381
|
"var(--ui-text-primary)"
|
|
2365
2382
|
]
|
|
@@ -3213,6 +3230,45 @@
|
|
|
3213
3230
|
"name": "string"
|
|
3214
3231
|
}
|
|
3215
3232
|
},
|
|
3233
|
+
{
|
|
3234
|
+
"name": "interaction-tone",
|
|
3235
|
+
"property": "interactionTone",
|
|
3236
|
+
"description": "The action palette while hovered or pressed. inherit follows tone and preset. Choose a different tone for transient emphasis, such as a neutral choice that uses accent feedback. Hover and pressed keep their distinct shared treatments; disabled and loading actions keep their resting treatment.",
|
|
3237
|
+
"type": "keyword",
|
|
3238
|
+
"valueType": {
|
|
3239
|
+
"kind": "terminal",
|
|
3240
|
+
"name": "keyword"
|
|
3241
|
+
},
|
|
3242
|
+
"default": "inherit",
|
|
3243
|
+
"options": [
|
|
3244
|
+
"inherit",
|
|
3245
|
+
"accent",
|
|
3246
|
+
"accent-secondary",
|
|
3247
|
+
"accent-tertiary",
|
|
3248
|
+
"neutral",
|
|
3249
|
+
"danger",
|
|
3250
|
+
"success",
|
|
3251
|
+
"warning",
|
|
3252
|
+
"info"
|
|
3253
|
+
]
|
|
3254
|
+
},
|
|
3255
|
+
{
|
|
3256
|
+
"name": "interaction-variant",
|
|
3257
|
+
"property": "interactionVariant",
|
|
3258
|
+
"description": "The paint while hovered or pressed. inherit follows variant and preset. outline, solid and ghost change emphasis without changing the control's layout, size or content. The shared hover and pressed treatments remain distinct.",
|
|
3259
|
+
"type": "keyword",
|
|
3260
|
+
"valueType": {
|
|
3261
|
+
"kind": "terminal",
|
|
3262
|
+
"name": "keyword"
|
|
3263
|
+
},
|
|
3264
|
+
"default": "inherit",
|
|
3265
|
+
"options": [
|
|
3266
|
+
"inherit",
|
|
3267
|
+
"outline",
|
|
3268
|
+
"solid",
|
|
3269
|
+
"ghost"
|
|
3270
|
+
]
|
|
3271
|
+
},
|
|
3216
3272
|
{
|
|
3217
3273
|
"name": "loading",
|
|
3218
3274
|
"property": "loading",
|
|
@@ -3418,6 +3474,35 @@
|
|
|
3418
3474
|
"description": "The link's destination. Supplying href automatically renders a native link instead of a button, including an empty href for the current document. A disabled link drops its href and states aria-disabled=\"true\", so it cannot be followed.",
|
|
3419
3475
|
"type": "string"
|
|
3420
3476
|
},
|
|
3477
|
+
{
|
|
3478
|
+
"name": "interactionTone",
|
|
3479
|
+
"description": "The action palette while hovered or pressed. inherit follows tone and preset. Choose a different tone for transient emphasis, such as a neutral choice that uses accent feedback. Hover and pressed keep their distinct shared treatments; disabled and loading actions keep their resting treatment.",
|
|
3480
|
+
"type": "\"inherit\" | \"accent\" | \"accent-secondary\" | \"accent-tertiary\" | \"neutral\" | \"danger\" | \"success\" | \"warning\" | \"info\"",
|
|
3481
|
+
"default": "inherit",
|
|
3482
|
+
"options": [
|
|
3483
|
+
"inherit",
|
|
3484
|
+
"accent",
|
|
3485
|
+
"accent-secondary",
|
|
3486
|
+
"accent-tertiary",
|
|
3487
|
+
"neutral",
|
|
3488
|
+
"danger",
|
|
3489
|
+
"success",
|
|
3490
|
+
"warning",
|
|
3491
|
+
"info"
|
|
3492
|
+
]
|
|
3493
|
+
},
|
|
3494
|
+
{
|
|
3495
|
+
"name": "interactionVariant",
|
|
3496
|
+
"description": "The paint while hovered or pressed. inherit follows variant and preset. outline, solid and ghost change emphasis without changing the control's layout, size or content. The shared hover and pressed treatments remain distinct.",
|
|
3497
|
+
"type": "\"inherit\" | \"outline\" | \"solid\" | \"ghost\"",
|
|
3498
|
+
"default": "inherit",
|
|
3499
|
+
"options": [
|
|
3500
|
+
"inherit",
|
|
3501
|
+
"outline",
|
|
3502
|
+
"solid",
|
|
3503
|
+
"ghost"
|
|
3504
|
+
]
|
|
3505
|
+
},
|
|
3421
3506
|
{
|
|
3422
3507
|
"name": "loading",
|
|
3423
3508
|
"description": "Keeps the action focusable and its label visible while work is in progress. It shows a decorative spinner, states aria-disabled and aria-busy, and prevents activation or form submission until cleared.",
|
|
@@ -3705,6 +3790,16 @@
|
|
|
3705
3790
|
"resizable": false,
|
|
3706
3791
|
"bindings": "",
|
|
3707
3792
|
"frameworks": {}
|
|
3793
|
+
},
|
|
3794
|
+
{
|
|
3795
|
+
"id": "@threadlabs/looma/ui-button/13-interaction",
|
|
3796
|
+
"name": "13-interaction",
|
|
3797
|
+
"title": "Interaction emphasis",
|
|
3798
|
+
"description": "Keep a choice neutral at rest, then use accent on hover and press. Interaction tone and variant inherit the resting settings unless supplied; pressed feedback remains stronger than hover.",
|
|
3799
|
+
"markup": "<ui-stack gap=\"s\">\n <ui-button tone=\"neutral\" variant=\"outline\" interaction-tone=\"accent\" align=\"start\" stretch>\n Choose a project\n </ui-button>\n <ui-button tone=\"neutral\" variant=\"ghost\" interaction-tone=\"accent\" interaction-variant=\"outline\">\n Browse projects\n </ui-button>\n</ui-stack>",
|
|
3800
|
+
"resizable": false,
|
|
3801
|
+
"bindings": "",
|
|
3802
|
+
"frameworks": {}
|
|
3708
3803
|
}
|
|
3709
3804
|
]
|
|
3710
3805
|
},
|
package/editor/components.css
CHANGED
|
@@ -18,6 +18,11 @@
|
|
|
18
18
|
inset calc(-1 * var(--_ui-action-start)) -1px 0 light-dark(rgb(0 0 0 / 0.08), rgb(0 0 0 / 0.08))
|
|
19
19
|
);
|
|
20
20
|
--_ui-action-shadow: var(--_ui-action-edge), 0 1px 2px light-dark(rgb(0 0 0 / 0.10), rgb(0 0 0 / 0.20));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/* Explicit interaction palettes reuse the resting palette bindings, without changing geometry. */
|
|
24
|
+
:scope:where([data-component~="ui-button"]),
|
|
25
|
+
:scope:where([data-component~="ui-button"])[data-interaction-tone]:is(:hover, :active):not(:disabled, [aria-disabled="true"]) {
|
|
21
26
|
--_tone-border: var(--ui-accent-border, var(--ui-accent));
|
|
22
27
|
--_tone-hover-border: var(--ui-accent-hover-border, var(--ui-accent-hover));
|
|
23
28
|
--_tone-active-border: var(--ui-accent-active-border, var(--ui-accent-active));
|
|
@@ -39,7 +44,17 @@
|
|
|
39
44
|
--_tone-active: var(--_hue-active);
|
|
40
45
|
--_tone-text: var(--_hue-text);
|
|
41
46
|
--_on-tone: var(--_on-hue);
|
|
47
|
+
--_interaction-solid-hover: var(--_tone-hover);
|
|
48
|
+
--_interaction-solid-active: var(--_tone-active);
|
|
49
|
+
--_interaction-solid-text: var(--_on-tone);
|
|
50
|
+
--_interaction-solid-shadow: var(--ui-button-solid-shadow, var(--ui-action-shadow, var(--_ui-action-shadow))), var(--_tone-glow);
|
|
51
|
+
--_interaction-outline-border: var(--_tone-outline-border);
|
|
52
|
+
--_interaction-outline-wash: var(--_tone-wash-hover);
|
|
53
|
+
--_interaction-outline-active: oklch(from var(--_tone) l c h / calc(18% * var(--ui-tonal-opacity, 1)));
|
|
54
|
+
--_interaction-card-border: var(--_tone-text);
|
|
55
|
+
}
|
|
42
56
|
|
|
57
|
+
:scope:where([data-component~="ui-button"]) {
|
|
43
58
|
display: inline-flex !important;
|
|
44
59
|
align-items: center !important;
|
|
45
60
|
justify-content: center !important;
|
|
@@ -119,13 +134,18 @@
|
|
|
119
134
|
min-block-size: 1lh !important;
|
|
120
135
|
}
|
|
121
136
|
|
|
122
|
-
.
|
|
137
|
+
/* Projected marks may be images or composed elements, including block-level image resets. */
|
|
138
|
+
.label:has(> *) {
|
|
123
139
|
display: inline-flex !important;
|
|
124
140
|
align-items: center !important;
|
|
125
141
|
gap: var(--ui-space-2) !important;
|
|
126
142
|
text-box-trim: none;
|
|
127
143
|
}
|
|
128
144
|
|
|
145
|
+
:scope:where([data-component~="ui-button"])[data-ui-button-state~="align=start"] .label {
|
|
146
|
+
flex: 1;
|
|
147
|
+
}
|
|
148
|
+
|
|
129
149
|
.badge {
|
|
130
150
|
display: inline-flex !important;
|
|
131
151
|
align-items: center !important;
|
|
@@ -137,7 +157,7 @@
|
|
|
137
157
|
}
|
|
138
158
|
|
|
139
159
|
@supports (text-box-trim: trim-both) {
|
|
140
|
-
.label:not(:has(
|
|
160
|
+
.label:not(:has(> *)) {
|
|
141
161
|
text-box-trim: trim-both;
|
|
142
162
|
text-box-edge: cap alphabetic;
|
|
143
163
|
}
|
|
@@ -246,9 +266,9 @@
|
|
|
246
266
|
color: var(--ui-selection-text);
|
|
247
267
|
}
|
|
248
268
|
|
|
249
|
-
/* Pressed
|
|
269
|
+
/* Pressed outranks tone-specific outline paint: the highlight goes, and the shadow moves inside. */
|
|
250
270
|
:scope:where([data-component~="ui-button"]):active:not(:disabled, [aria-disabled="true"]),
|
|
251
|
-
:scope:where([data-component~="ui-button"])[data-appearance="outline"]:active:not(:disabled, [aria-disabled="true"]) {
|
|
271
|
+
:scope:where([data-component~="ui-button"])[data-appearance="outline"][data-tone]:active:not(:disabled, [aria-disabled="true"]) {
|
|
252
272
|
scale: var(--ui-press-scale, 1);
|
|
253
273
|
background-color: var(--ui-button-active-surface, oklch(from var(--_tone) l c h / calc(18% * var(--ui-tonal-opacity, 1))));
|
|
254
274
|
background-image: none;
|
|
@@ -281,7 +301,8 @@
|
|
|
281
301
|
|
|
282
302
|
/* Tone is the colour, variant is the volume. Every pairing works: a danger outline is a
|
|
283
303
|
destructive secondary action, not a special case. */
|
|
284
|
-
:scope:where([data-component~="ui-button"])[data-tone="accent-secondary"]
|
|
304
|
+
:scope:where([data-component~="ui-button"])[data-tone="accent-secondary"],
|
|
305
|
+
:scope:where([data-component~="ui-button"])[data-interaction-tone="accent-secondary"]:is(:hover, :active):not(:disabled, [aria-disabled="true"]) {
|
|
285
306
|
--_tone-border: var(--ui-accent-secondary-border, var(--ui-accent-secondary));
|
|
286
307
|
--_tone-hover-border: var(--ui-accent-secondary-hover-border, var(--ui-accent-secondary-hover));
|
|
287
308
|
--_tone-active-border: var(--ui-accent-secondary-active-border, var(--ui-accent-secondary-active));
|
|
@@ -299,7 +320,8 @@
|
|
|
299
320
|
--_on-hue: var(--ui-accent-secondary-on-strong);
|
|
300
321
|
}
|
|
301
322
|
|
|
302
|
-
:scope:where([data-component~="ui-button"])[data-tone="accent-tertiary"]
|
|
323
|
+
:scope:where([data-component~="ui-button"])[data-tone="accent-tertiary"],
|
|
324
|
+
:scope:where([data-component~="ui-button"])[data-interaction-tone="accent-tertiary"]:is(:hover, :active):not(:disabled, [aria-disabled="true"]) {
|
|
303
325
|
--_tone-border: var(--ui-accent-tertiary-border, var(--ui-accent-tertiary));
|
|
304
326
|
--_tone-hover-border: var(--ui-accent-tertiary-hover-border, var(--ui-accent-tertiary-hover));
|
|
305
327
|
--_tone-active-border: var(--ui-accent-tertiary-active-border, var(--ui-accent-tertiary-active));
|
|
@@ -317,7 +339,8 @@
|
|
|
317
339
|
--_on-hue: var(--ui-accent-tertiary-on-strong);
|
|
318
340
|
}
|
|
319
341
|
|
|
320
|
-
:scope:where([data-component~="ui-button"])[data-tone="neutral"]
|
|
342
|
+
:scope:where([data-component~="ui-button"])[data-tone="neutral"],
|
|
343
|
+
:scope:where([data-component~="ui-button"])[data-interaction-tone="neutral"]:is(:hover, :active):not(:disabled, [aria-disabled="true"]) {
|
|
321
344
|
--_tone-border: var(--ui-control-border, var(--ui-neutral-surface));
|
|
322
345
|
--_tone-hover-border: var(--ui-control-border-hover, var(--ui-neutral-hover));
|
|
323
346
|
--_tone-active-border: var(--ui-control-border-hover, var(--ui-neutral-active));
|
|
@@ -331,6 +354,14 @@
|
|
|
331
354
|
--_hue-active: var(--ui-text);
|
|
332
355
|
--_hue-text: var(--ui-text);
|
|
333
356
|
--_on-hue: var(--ui-surface);
|
|
357
|
+
--_interaction-solid-hover: var(--ui-neutral-hover);
|
|
358
|
+
--_interaction-solid-active: var(--ui-neutral-active);
|
|
359
|
+
--_interaction-solid-text: var(--ui-button-text, var(--ui-text));
|
|
360
|
+
--_interaction-solid-shadow: var(--ui-button-solid-shadow, var(--ui-button-shadow, var(--ui-neutral-shadow)));
|
|
361
|
+
--_interaction-outline-border: var(--ui-control-border-hover);
|
|
362
|
+
--_interaction-outline-wash: var(--ui-neutral-wash-hover);
|
|
363
|
+
--_interaction-outline-active: var(--ui-neutral-active);
|
|
364
|
+
--_interaction-card-border: var(--ui-border-strong);
|
|
334
365
|
}
|
|
335
366
|
|
|
336
367
|
:scope:where([data-component~="ui-button"])[data-tone="neutral"][data-appearance="solid"] {
|
|
@@ -365,7 +396,9 @@
|
|
|
365
396
|
background-color: var(--ui-button-active-surface, var(--ui-neutral-active));
|
|
366
397
|
}
|
|
367
398
|
|
|
368
|
-
:scope:where([data-component~="ui-button"])[data-tone="danger"],
|
|
399
|
+
:scope:where([data-component~="ui-button"])[data-tone="danger"],
|
|
400
|
+
:scope:where([data-component~="ui-button"])[data-appearance="danger"],
|
|
401
|
+
:scope:where([data-component~="ui-button"])[data-interaction-tone="danger"]:is(:hover, :active):not(:disabled, [aria-disabled="true"]) {
|
|
369
402
|
--_tone-border: var(--ui-danger-border, var(--ui-danger));
|
|
370
403
|
--_tone-hover-border: var(--ui-danger-hover-border, var(--ui-danger-hover));
|
|
371
404
|
--_tone-active-border: var(--ui-danger-active-border, var(--ui-danger-active));
|
|
@@ -383,7 +416,8 @@
|
|
|
383
416
|
--_on-hue: var(--ui-on-danger);
|
|
384
417
|
}
|
|
385
418
|
|
|
386
|
-
:scope:where([data-component~="ui-button"])[data-tone="success"]
|
|
419
|
+
:scope:where([data-component~="ui-button"])[data-tone="success"],
|
|
420
|
+
:scope:where([data-component~="ui-button"])[data-interaction-tone="success"]:is(:hover, :active):not(:disabled, [aria-disabled="true"]) {
|
|
387
421
|
--_tone-border: var(--ui-success-border, var(--ui-success));
|
|
388
422
|
--_tone-hover-border: var(--ui-success-hover-border, var(--ui-success-hover));
|
|
389
423
|
--_tone-active-border: var(--ui-success-active-border, var(--ui-success-active));
|
|
@@ -401,7 +435,8 @@
|
|
|
401
435
|
--_on-hue: var(--ui-success-on-strong);
|
|
402
436
|
}
|
|
403
437
|
|
|
404
|
-
:scope:where([data-component~="ui-button"])[data-tone="warning"]
|
|
438
|
+
:scope:where([data-component~="ui-button"])[data-tone="warning"],
|
|
439
|
+
:scope:where([data-component~="ui-button"])[data-interaction-tone="warning"]:is(:hover, :active):not(:disabled, [aria-disabled="true"]) {
|
|
405
440
|
--_tone-border: var(--ui-warning-border, var(--ui-warning));
|
|
406
441
|
--_tone-hover-border: var(--ui-warning-hover-border, var(--ui-warning-hover));
|
|
407
442
|
--_tone-active-border: var(--ui-warning-active-border, var(--ui-warning-active));
|
|
@@ -419,7 +454,8 @@
|
|
|
419
454
|
--_on-hue: var(--ui-warning-on-strong);
|
|
420
455
|
}
|
|
421
456
|
|
|
422
|
-
:scope:where([data-component~="ui-button"])[data-tone="info"]
|
|
457
|
+
:scope:where([data-component~="ui-button"])[data-tone="info"],
|
|
458
|
+
:scope:where([data-component~="ui-button"])[data-interaction-tone="info"]:is(:hover, :active):not(:disabled, [aria-disabled="true"]) {
|
|
423
459
|
--_tone-border: var(--ui-info-border, var(--ui-info));
|
|
424
460
|
--_tone-hover-border: var(--ui-info-hover-border, var(--ui-info-hover));
|
|
425
461
|
--_tone-active-border: var(--ui-info-active-border, var(--ui-info-active));
|
|
@@ -490,6 +526,93 @@
|
|
|
490
526
|
box-shadow: inset 0 0 0 1px var(--ui-selection-border);
|
|
491
527
|
}
|
|
492
528
|
|
|
529
|
+
/* Interaction settings choose paint only. Pressed keeps its stronger fill and inset shadow. */
|
|
530
|
+
:scope:where([data-component~="ui-button"])[data-tone][data-interaction-appearance="outline"]:hover:not(:disabled, [aria-disabled="true"]) {
|
|
531
|
+
--_interaction-shadow: var(--ui-button-shadow, var(--ui-neutral-shadow));
|
|
532
|
+
border-color: var(--ui-button-hover-border, var(--_interaction-outline-border));
|
|
533
|
+
background-color: var(--ui-button-hover-surface, transparent);
|
|
534
|
+
background-image: linear-gradient(var(--_interaction-outline-wash), var(--_interaction-outline-wash));
|
|
535
|
+
color: var(--ui-button-text, var(--_tone-text));
|
|
536
|
+
box-shadow: var(--_interaction-shadow);
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
:scope:where([data-component~="ui-button"])[data-tone][data-interaction-appearance="outline"]:active:not(:disabled, [aria-disabled="true"]) {
|
|
540
|
+
--_interaction-shadow: var(--ui-pressed);
|
|
541
|
+
border-color: var(--ui-button-hover-border, var(--_interaction-outline-border));
|
|
542
|
+
background-color: var(--ui-button-active-surface, var(--_interaction-outline-active));
|
|
543
|
+
background-image: none;
|
|
544
|
+
color: var(--ui-button-text, var(--_tone-text));
|
|
545
|
+
box-shadow: var(--_interaction-shadow);
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
:scope:where([data-component~="ui-button"])[data-tone]:is([data-interaction-appearance="solid"], [data-interaction-appearance="danger"]):hover:not(:disabled, [aria-disabled="true"]) {
|
|
549
|
+
--_interaction-shadow: var(--_interaction-solid-shadow);
|
|
550
|
+
border-color: var(--ui-button-hover-border, var(--_tone-hover-border));
|
|
551
|
+
background-color: var(--ui-button-hover-surface, var(--_interaction-solid-hover));
|
|
552
|
+
background-image: var(--_tone-hover-highlight);
|
|
553
|
+
color: var(--_interaction-solid-text);
|
|
554
|
+
box-shadow: var(--_interaction-shadow);
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
:scope:where([data-component~="ui-button"])[data-tone]:is([data-interaction-appearance="solid"], [data-interaction-appearance="danger"]):active:not(:disabled, [aria-disabled="true"]) {
|
|
558
|
+
--_interaction-shadow: var(--ui-pressed);
|
|
559
|
+
border-color: var(--_tone-active-border);
|
|
560
|
+
background-color: var(--ui-button-active-surface, var(--_interaction-solid-active));
|
|
561
|
+
background-image: none;
|
|
562
|
+
color: var(--_interaction-solid-text);
|
|
563
|
+
box-shadow: var(--_interaction-shadow);
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
:scope:where([data-component~="ui-button"])[data-tone][data-interaction-appearance="ghost"]:hover:not(:disabled, [aria-disabled="true"]) {
|
|
567
|
+
--_interaction-shadow: 0 0 transparent;
|
|
568
|
+
border-color: transparent;
|
|
569
|
+
background-color: var(--ui-button-ghost-hover-surface, var(--_tone-ghost-hover));
|
|
570
|
+
background-image: none;
|
|
571
|
+
color: var(--ui-button-ghost-text, var(--_tone-text));
|
|
572
|
+
box-shadow: none;
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
:scope:where([data-component~="ui-button"])[data-tone][data-interaction-appearance="ghost"]:active:not(:disabled, [aria-disabled="true"]) {
|
|
576
|
+
--_interaction-shadow: inset 0 0 0 1px oklch(from var(--_tone) l c h / 10%), inset 0 1px 2px oklch(from var(--_tone) l c h / 8%);
|
|
577
|
+
border-color: transparent;
|
|
578
|
+
background-color: var(--ui-button-ghost-active-surface, oklch(from var(--_tone) l c h / 18%));
|
|
579
|
+
background-image: none;
|
|
580
|
+
color: var(--ui-button-ghost-text, var(--_tone-text));
|
|
581
|
+
box-shadow: var(--_interaction-shadow);
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
:scope:where([data-component~="ui-button"])[data-tone][data-interaction-appearance="card"]:hover:not(:disabled, [aria-disabled="true"]) {
|
|
585
|
+
--_interaction-shadow: 0 0 transparent;
|
|
586
|
+
border-color: var(--ui-button-hover-border, var(--_interaction-card-border));
|
|
587
|
+
background-color: var(--ui-button-hover-surface, oklch(from var(--_tone-text) l c h / calc(12% * var(--ui-tonal-opacity, 1))));
|
|
588
|
+
background-image: none;
|
|
589
|
+
color: var(--ui-button-text, var(--_tone-text));
|
|
590
|
+
box-shadow: none;
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
:scope:where([data-component~="ui-button"])[data-tone][data-interaction-appearance="card"]:active:not(:disabled, [aria-disabled="true"]) {
|
|
594
|
+
--_interaction-shadow: var(--ui-pressed);
|
|
595
|
+
border-color: var(--ui-button-hover-border, var(--_interaction-card-border));
|
|
596
|
+
background-color: var(--ui-button-active-surface, oklch(from var(--_tone) l c h / calc(18% * var(--ui-tonal-opacity, 1))));
|
|
597
|
+
background-image: none;
|
|
598
|
+
color: var(--ui-button-text, var(--_tone-text));
|
|
599
|
+
box-shadow: var(--_interaction-shadow);
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
:scope:where([data-component~="ui-button"])[data-tone][data-interaction-appearance="link"]:is(:hover, :active):not(:disabled, [aria-disabled="true"]) {
|
|
603
|
+
color: var(--ui-button-link-hover-text, var(--_tone-text));
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
:scope:where([data-component~="ui-button"])[data-tone][data-interaction-appearance="link"]:active:not(:disabled, [aria-disabled="true"]) {
|
|
607
|
+
text-decoration-thickness: 0.125em;
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
:scope:where([data-component~="ui-button"])[data-tone][data-interaction-appearance]:is(:hover, :active):focus-visible:not(:disabled, [aria-disabled="true"]) {
|
|
611
|
+
box-shadow:
|
|
612
|
+
var(--_interaction-shadow, 0 0 transparent),
|
|
613
|
+
var(--ui-focus-halo);
|
|
614
|
+
}
|
|
615
|
+
|
|
493
616
|
/* A soft halo that transitions in with the other box-shadow changes, layered on the raised shadow. */
|
|
494
617
|
:scope:where([data-component~="ui-button"]):focus-visible,
|
|
495
618
|
:scope:where([data-component~="ui-button"])[data-appearance="ghost"][data-selected]:focus-visible {
|
|
@@ -505,6 +628,12 @@
|
|
|
505
628
|
var(--ui-focus-halo);
|
|
506
629
|
}
|
|
507
630
|
|
|
631
|
+
:scope:where([data-component~="ui-button"])[data-appearance="outline"]:not([data-interaction-appearance]):active:focus-visible:not(:disabled, [aria-disabled="true"]) {
|
|
632
|
+
box-shadow:
|
|
633
|
+
var(--ui-pressed),
|
|
634
|
+
var(--ui-focus-halo);
|
|
635
|
+
}
|
|
636
|
+
|
|
508
637
|
:scope:where([data-component~="ui-button"])[data-appearance="solid"]:focus-visible {
|
|
509
638
|
box-shadow:
|
|
510
639
|
var(--ui-button-solid-shadow, var(--ui-action-shadow, var(--_ui-action-shadow))),
|
|
@@ -582,11 +711,15 @@
|
|
|
582
711
|
transition: color var(--ui-motion-fast) var(--ui-motion-ease), text-decoration-color var(--ui-motion-fast) var(--ui-motion-ease);
|
|
583
712
|
}
|
|
584
713
|
|
|
585
|
-
:scope:where([data-component~="ui-button"])[data-appearance="link"] .label {
|
|
714
|
+
:scope:where([data-component~="ui-button"])[data-appearance="link"] .label:not(:has(> *)) {
|
|
586
715
|
display: inline !important;
|
|
587
716
|
text-box-trim: none;
|
|
588
717
|
}
|
|
589
718
|
|
|
719
|
+
:scope:where([data-component~="ui-button"])[data-appearance="link"] .label:has(> *) {
|
|
720
|
+
text-decoration: inherit;
|
|
721
|
+
}
|
|
722
|
+
|
|
590
723
|
:scope:where([data-component~="ui-button"])[data-appearance="link"]:hover:not(:disabled, [aria-disabled="true"]) {
|
|
591
724
|
color: var(--ui-button-link-hover-text, var(--ui-text-primary));
|
|
592
725
|
text-decoration-color: currentColor;
|
|
@@ -617,13 +750,17 @@
|
|
|
617
750
|
}
|
|
618
751
|
}
|
|
619
752
|
@scope ([data-component~="ui-button"]) to ([data-component]) {
|
|
620
|
-
/*
|
|
753
|
+
/* Explicit interaction palettes reuse the resting palette bindings, without changing geometry. */
|
|
754
|
+
|
|
755
|
+
/* An anchor keeps the boxed button look even when an app styles ordinary links. */
|
|
621
756
|
|
|
622
757
|
/* A count is an adornment, not another line of label text. Keep the standard control height
|
|
623
758
|
with enough inset for a 24px mark; large content can still grow the button naturally. */
|
|
624
759
|
|
|
625
760
|
/* Trim the text line itself: an anonymous flex item retains font-metric space in some fonts. */
|
|
626
761
|
|
|
762
|
+
/* Projected marks may be images or composed elements, including block-level image resets. */
|
|
763
|
+
|
|
627
764
|
@supports (text-box-trim: trim-both) {
|
|
628
765
|
}
|
|
629
766
|
|
|
@@ -635,7 +772,7 @@
|
|
|
635
772
|
/* A link is never :enabled, so interactive states test "not unavailable" instead: for a button that
|
|
636
773
|
is exactly :enabled, at the same specificity, and it also matches a link that can be followed. */
|
|
637
774
|
|
|
638
|
-
/* Pressed
|
|
775
|
+
/* Pressed outranks tone-specific outline paint: the highlight goes, and the shadow moves inside. */
|
|
639
776
|
|
|
640
777
|
/* Tone is the colour, variant is the volume. Every pairing works: a danger outline is a
|
|
641
778
|
destructive secondary action, not a special case. */
|
|
@@ -644,6 +781,8 @@
|
|
|
644
781
|
|
|
645
782
|
/* Shared translucent paint keeps text and icon action feedback coordinated. */
|
|
646
783
|
|
|
784
|
+
/* Interaction settings choose paint only. Pressed keeps its stronger fill and inset shadow. */
|
|
785
|
+
|
|
647
786
|
/* A soft halo that transitions in with the other box-shadow changes, layered on the raised shadow. */
|
|
648
787
|
|
|
649
788
|
/* A loading action stays visually active; only an explicitly disabled action takes the
|