hydrateless 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.
- package/dist/alert.css +1 -1
- package/dist/avatar.css +1 -1
- package/dist/badge.css +1 -1
- package/dist/button.css +1 -1
- package/dist/card.css +1 -1
- package/dist/checkbox.css +1 -1
- package/dist/combobox.css +19 -1
- package/dist/command.css +1 -1
- package/dist/components.css +278 -59
- package/dist/disclosure.css +28 -3
- package/dist/dropdown.css +25 -10
- package/dist/field.css +1 -1
- package/dist/hydrateless.css +301 -65
- package/dist/hydrateless.min.css +1 -1
- package/dist/input.css +1 -1
- package/dist/kbd.css +1 -1
- package/dist/menu.css +35 -2
- package/dist/modal.css +1 -1
- package/dist/pagination.css +1 -1
- package/dist/popover.css +32 -4
- package/dist/progress.css +1 -1
- package/dist/radio.css +1 -1
- package/dist/segmented.css +1 -1
- package/dist/select.css +1 -1
- package/dist/separator.css +1 -1
- package/dist/skeleton.css +1 -1
- package/dist/slider.css +1 -1
- package/dist/spinner.css +1 -1
- package/dist/table.css +1 -1
- package/dist/tabs.css +83 -9
- package/dist/textarea.css +1 -1
- package/dist/tokens.css +2 -2
- package/dist/tooltip.css +34 -8
- package/package.json +2 -2
package/dist/hydrateless.css
CHANGED
|
@@ -200,7 +200,7 @@
|
|
|
200
200
|
--hl-font-semibold: 600;
|
|
201
201
|
--hl-font-bold: 700;
|
|
202
202
|
|
|
203
|
-
/* Elevation (shadows)
|
|
203
|
+
/* Elevation (shadows), tuned for light surfaces */
|
|
204
204
|
--hl-shadow-xs: 0 1px 2px 0 hsla(222, 47%, 11%, 0.05);
|
|
205
205
|
--hl-shadow-sm: 0 1px 3px 0 hsla(222, 47%, 11%, 0.1), 0 1px 2px -1px hsla(222, 47%, 11%, 0.1);
|
|
206
206
|
--hl-shadow-md:
|
|
@@ -245,7 +245,7 @@
|
|
|
245
245
|
/**
|
|
246
246
|
* Semantic tokens map the raw palette to roles (surface, text, border, intent
|
|
247
247
|
* colors). Components reference only these, so theming and dark mode are a
|
|
248
|
-
* matter of remapping a couple dozen variables
|
|
248
|
+
* matter of remapping a couple dozen variables, never touching component CSS.
|
|
249
249
|
*
|
|
250
250
|
* Light is the default in `:root`. Dark applies automatically via
|
|
251
251
|
* `prefers-color-scheme` (unless `[data-theme="light"]` opts out) and always
|
|
@@ -434,8 +434,15 @@
|
|
|
434
434
|
|
|
435
435
|
/* Disclosure & layout */
|
|
436
436
|
|
|
437
|
+
/**
|
|
438
|
+
* Disclosure: a styled native `<details>`. The class and the `data-hl-disclosure`
|
|
439
|
+
* attribute (which also opts into the state enhancer) are interchangeable, so
|
|
440
|
+
* plain HTML needs only one of them. Exclusive groups need no JavaScript:
|
|
441
|
+
* give related disclosures the same `name` attribute.
|
|
442
|
+
*/
|
|
443
|
+
|
|
437
444
|
@layer components {
|
|
438
|
-
details.hl-disclosure {
|
|
445
|
+
details.hl-disclosure, details[data-hl-disclosure] {
|
|
439
446
|
border: 1px solid hsl(214, 32%, 91%);
|
|
440
447
|
border: 1px solid var(--hl-border);
|
|
441
448
|
border-radius: 0.5rem;
|
|
@@ -444,7 +451,7 @@
|
|
|
444
451
|
background: var(--hl-surface);
|
|
445
452
|
}
|
|
446
453
|
|
|
447
|
-
details.hl-disclosure > summary {
|
|
454
|
+
details.hl-disclosure > summary, details[data-hl-disclosure] > summary {
|
|
448
455
|
list-style: none;
|
|
449
456
|
cursor: pointer;
|
|
450
457
|
padding: 0.75rem 1rem;
|
|
@@ -455,12 +462,22 @@
|
|
|
455
462
|
display: none;
|
|
456
463
|
}
|
|
457
464
|
|
|
465
|
+
details[data-hl-disclosure] > summary::-webkit-details-marker {
|
|
466
|
+
display: none;
|
|
467
|
+
}
|
|
468
|
+
|
|
458
469
|
details.hl-disclosure > summary:focus-visible {
|
|
459
470
|
outline: 2px solid hsl(217, 91%, 60%);
|
|
460
471
|
outline: var(--hl-focus-ring);
|
|
461
472
|
outline-offset: 2px;
|
|
462
473
|
}
|
|
463
474
|
|
|
475
|
+
details[data-hl-disclosure] > summary:focus-visible {
|
|
476
|
+
outline: 2px solid hsl(217, 91%, 60%);
|
|
477
|
+
outline: var(--hl-focus-ring);
|
|
478
|
+
outline-offset: 2px;
|
|
479
|
+
}
|
|
480
|
+
|
|
464
481
|
details.hl-disclosure > summary::after {
|
|
465
482
|
content: '\25B8';
|
|
466
483
|
float: right;
|
|
@@ -468,24 +485,47 @@
|
|
|
468
485
|
transition: transform var(--hl-duration-fast) var(--hl-ease-standard);
|
|
469
486
|
}
|
|
470
487
|
|
|
488
|
+
details[data-hl-disclosure] > summary::after {
|
|
489
|
+
content: '\25B8';
|
|
490
|
+
float: right;
|
|
491
|
+
transition: transform 120ms cubic-bezier(0.2, 0, 0, 1);
|
|
492
|
+
transition: transform var(--hl-duration-fast) var(--hl-ease-standard);
|
|
493
|
+
}
|
|
494
|
+
|
|
471
495
|
details.hl-disclosure[open] > summary::after {
|
|
472
496
|
transform: rotate(90deg);
|
|
473
497
|
}
|
|
474
498
|
|
|
475
|
-
details
|
|
499
|
+
details[data-hl-disclosure][open] > summary::after {
|
|
500
|
+
transform: rotate(90deg);
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
details.hl-disclosure > .hl-disclosure-panel, details[data-hl-disclosure] > .hl-disclosure-panel {
|
|
476
504
|
padding: 0.75rem 1rem 1rem;
|
|
477
505
|
padding: var(--hl-space-3) var(--hl-space-4) var(--hl-space-4);
|
|
478
506
|
}
|
|
479
507
|
}
|
|
480
508
|
|
|
509
|
+
/**
|
|
510
|
+
* Tabs. Two markups are supported and styled together:
|
|
511
|
+
*
|
|
512
|
+
* - CSS-only baseline: `.hl-tablist` of `<label class="hl-tab">` wrapping a
|
|
513
|
+
* radio, then a `.hl-tabpanels` of `.hl-tabpanel`s. `:has(input:checked)`
|
|
514
|
+
* switches panels with no JavaScript (up to 8 tabs).
|
|
515
|
+
* - Enhanced: the enhancer adds `role="tab"`/`tabpanel`, roving focus, and
|
|
516
|
+
* `aria-selected`, toggles `[hidden]` on panels, and marks the root
|
|
517
|
+
* `data-hl-ready`, at which point the no-JS rules below stand down.
|
|
518
|
+
*/
|
|
519
|
+
|
|
481
520
|
@layer components {
|
|
482
521
|
[data-hl-tabs] {
|
|
483
522
|
border: 1px solid hsl(214, 32%, 91%);
|
|
484
|
-
border:
|
|
523
|
+
border: var(--hl-border-width) solid var(--hl-border);
|
|
485
524
|
border-radius: 0.5rem;
|
|
486
525
|
border-radius: var(--hl-radius-lg);
|
|
487
526
|
}
|
|
488
527
|
|
|
528
|
+
.hl-tablist,
|
|
489
529
|
[data-hl-tabs] [role='tablist'] {
|
|
490
530
|
display: flex;
|
|
491
531
|
gap: 0.5rem;
|
|
@@ -493,13 +533,17 @@
|
|
|
493
533
|
padding: 0.5rem;
|
|
494
534
|
padding: var(--hl-space-2);
|
|
495
535
|
border-bottom: 1px solid hsl(214, 32%, 91%);
|
|
496
|
-
border-bottom:
|
|
536
|
+
border-bottom: var(--hl-border-width) solid var(--hl-border);
|
|
497
537
|
}
|
|
498
538
|
|
|
539
|
+
.hl-tab,
|
|
499
540
|
[data-hl-tabs] [role='tab'] {
|
|
541
|
+
position: relative;
|
|
500
542
|
-webkit-appearance: none;
|
|
501
543
|
-moz-appearance: none;
|
|
502
544
|
appearance: none;
|
|
545
|
+
display: inline-flex;
|
|
546
|
+
align-items: center;
|
|
503
547
|
background: transparent;
|
|
504
548
|
border: 0;
|
|
505
549
|
border-radius: 0.25rem;
|
|
@@ -507,36 +551,95 @@
|
|
|
507
551
|
padding: 0.5rem 0.75rem;
|
|
508
552
|
padding: var(--hl-space-2) var(--hl-space-3);
|
|
509
553
|
color: inherit;
|
|
554
|
+
font: inherit;
|
|
555
|
+
cursor: pointer;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
/* The baseline keeps selection in a visually hidden radio per tab label. */
|
|
559
|
+
.hl-tab > input[type='radio'] {
|
|
560
|
+
position: absolute;
|
|
561
|
+
top: 0;
|
|
562
|
+
right: 0;
|
|
563
|
+
bottom: 0;
|
|
564
|
+
left: 0;
|
|
565
|
+
margin: 0;
|
|
566
|
+
opacity: 0;
|
|
567
|
+
cursor: pointer;
|
|
510
568
|
}
|
|
511
569
|
|
|
570
|
+
.hl-tab:has(input:checked),
|
|
512
571
|
[data-hl-tabs] [role='tab'][aria-selected='true'] {
|
|
513
572
|
background: hsl(210, 40%, 96%);
|
|
514
573
|
background: var(--hl-surface-2);
|
|
515
574
|
}
|
|
516
575
|
|
|
517
|
-
|
|
518
|
-
[data-hl-tabs] [role='tab'][aria-disabled='true'] {
|
|
519
|
-
opacity: 0.5;
|
|
520
|
-
cursor: not-allowed;
|
|
521
|
-
}
|
|
522
|
-
|
|
576
|
+
.hl-tab:has(input:focus-visible),
|
|
523
577
|
[data-hl-tabs] [role='tab']:focus-visible {
|
|
524
578
|
outline: 2px solid hsl(217, 91%, 60%);
|
|
525
579
|
outline: var(--hl-focus-ring);
|
|
526
580
|
outline-offset: 2px;
|
|
527
581
|
}
|
|
528
582
|
|
|
583
|
+
.hl-tab:has(input:disabled),
|
|
584
|
+
[data-hl-tabs] [role='tab'][disabled],
|
|
585
|
+
[data-hl-tabs] [role='tab'][aria-disabled='true'] {
|
|
586
|
+
opacity: 0.5;
|
|
587
|
+
cursor: not-allowed;
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
.hl-tabpanel,
|
|
529
591
|
[data-hl-tabs] [role='tabpanel'] {
|
|
530
592
|
padding: 1rem;
|
|
531
593
|
padding: var(--hl-space-4);
|
|
532
594
|
}
|
|
533
595
|
|
|
596
|
+
.hl-tabpanel[hidden],
|
|
534
597
|
[role='tabpanel'][hidden] {
|
|
535
598
|
display: none;
|
|
536
599
|
}
|
|
537
600
|
|
|
538
|
-
/* No-JS
|
|
539
|
-
|
|
601
|
+
/* No-JS baseline: reveal the panel whose tab radio is checked, by position.
|
|
602
|
+
These stand down once the enhancer sets data-hl-ready and owns [hidden]. */
|
|
603
|
+
[data-hl-tabs]:not([data-hl-ready]) .hl-tabpanels > .hl-tabpanel {
|
|
604
|
+
display: none;
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
[data-hl-tabs]:not([data-hl-ready])
|
|
608
|
+
.hl-tablist:has(.hl-tab:nth-of-type(1) input:checked)
|
|
609
|
+
~ .hl-tabpanels
|
|
610
|
+
> .hl-tabpanel:nth-of-type(1),
|
|
611
|
+
[data-hl-tabs]:not([data-hl-ready])
|
|
612
|
+
.hl-tablist:has(.hl-tab:nth-of-type(2) input:checked)
|
|
613
|
+
~ .hl-tabpanels
|
|
614
|
+
> .hl-tabpanel:nth-of-type(2),
|
|
615
|
+
[data-hl-tabs]:not([data-hl-ready])
|
|
616
|
+
.hl-tablist:has(.hl-tab:nth-of-type(3) input:checked)
|
|
617
|
+
~ .hl-tabpanels
|
|
618
|
+
> .hl-tabpanel:nth-of-type(3),
|
|
619
|
+
[data-hl-tabs]:not([data-hl-ready])
|
|
620
|
+
.hl-tablist:has(.hl-tab:nth-of-type(4) input:checked)
|
|
621
|
+
~ .hl-tabpanels
|
|
622
|
+
> .hl-tabpanel:nth-of-type(4),
|
|
623
|
+
[data-hl-tabs]:not([data-hl-ready])
|
|
624
|
+
.hl-tablist:has(.hl-tab:nth-of-type(5) input:checked)
|
|
625
|
+
~ .hl-tabpanels
|
|
626
|
+
> .hl-tabpanel:nth-of-type(5),
|
|
627
|
+
[data-hl-tabs]:not([data-hl-ready])
|
|
628
|
+
.hl-tablist:has(.hl-tab:nth-of-type(6) input:checked)
|
|
629
|
+
~ .hl-tabpanels
|
|
630
|
+
> .hl-tabpanel:nth-of-type(6),
|
|
631
|
+
[data-hl-tabs]:not([data-hl-ready])
|
|
632
|
+
.hl-tablist:has(.hl-tab:nth-of-type(7) input:checked)
|
|
633
|
+
~ .hl-tabpanels
|
|
634
|
+
> .hl-tabpanel:nth-of-type(7),
|
|
635
|
+
[data-hl-tabs]:not([data-hl-ready])
|
|
636
|
+
.hl-tablist:has(.hl-tab:nth-of-type(8) input:checked)
|
|
637
|
+
~ .hl-tabpanels
|
|
638
|
+
> .hl-tabpanel:nth-of-type(8) {
|
|
639
|
+
display: block;
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
/* Role-only markup (no radios) before JS: degrade to showing the first panel. */
|
|
540
643
|
[data-hl-tabs]:not([data-hl-ready]) [role='tabpanel'] ~ [role='tabpanel'] {
|
|
541
644
|
display: none;
|
|
542
645
|
}
|
|
@@ -695,7 +798,7 @@
|
|
|
695
798
|
}
|
|
696
799
|
|
|
697
800
|
/**
|
|
698
|
-
* Pagination
|
|
801
|
+
* Pagination: `<nav class="hl-pagination" aria-label="Pagination">` wrapping a
|
|
699
802
|
* list of `.hl-pagination-item` links/buttons; mark the active page with
|
|
700
803
|
* `aria-current="page"` and use `.hl-pagination-ellipsis` for gaps.
|
|
701
804
|
*/
|
|
@@ -782,7 +885,7 @@
|
|
|
782
885
|
}
|
|
783
886
|
|
|
784
887
|
/**
|
|
785
|
-
* Separator
|
|
888
|
+
* Separator: `<hr class="hl-separator">` or
|
|
786
889
|
* `<div class="hl-separator" role="separator" aria-orientation="vertical">`.
|
|
787
890
|
*/
|
|
788
891
|
|
|
@@ -857,7 +960,7 @@
|
|
|
857
960
|
border-top: 1px solid var(--hl-border);
|
|
858
961
|
}
|
|
859
962
|
|
|
860
|
-
.hl-modal [
|
|
963
|
+
.hl-modal [command='close']:focus-visible {
|
|
861
964
|
outline: 2px solid hsl(217, 91%, 60%);
|
|
862
965
|
outline: var(--hl-focus-ring);
|
|
863
966
|
outline-offset: 2px;
|
|
@@ -953,11 +1056,22 @@
|
|
|
953
1056
|
}
|
|
954
1057
|
}
|
|
955
1058
|
|
|
1059
|
+
/**
|
|
1060
|
+
* Popover: a `[popover] [data-hl-popover]` surface opened by a
|
|
1061
|
+
* `<button popovertarget="…">` (or `command="toggle-popover"`). The browser
|
|
1062
|
+
* owns the top layer, light-dismiss, and Escape with no JavaScript; the
|
|
1063
|
+
* enhancer only mirrors `aria-expanded`, adds optional hover, and runs the JS
|
|
1064
|
+
* positioning fallback on engines without CSS anchor positioning.
|
|
1065
|
+
*/
|
|
1066
|
+
|
|
956
1067
|
@layer components {
|
|
957
|
-
[popover],
|
|
958
1068
|
[data-hl-popover] {
|
|
1069
|
+
margin: 0;
|
|
1070
|
+
width: -moz-max-content;
|
|
1071
|
+
width: max-content;
|
|
1072
|
+
max-width: min(92vw, 22rem);
|
|
959
1073
|
border: 1px solid hsl(214, 32%, 91%);
|
|
960
|
-
border:
|
|
1074
|
+
border: var(--hl-border-width) solid var(--hl-border);
|
|
961
1075
|
border-radius: 0.5rem;
|
|
962
1076
|
border-radius: var(--hl-radius-lg);
|
|
963
1077
|
padding: 0.75rem;
|
|
@@ -970,26 +1084,56 @@
|
|
|
970
1084
|
box-shadow: var(--hl-overlay-shadow);
|
|
971
1085
|
}
|
|
972
1086
|
|
|
1087
|
+
/* Until the `popover` attribute is present (author omitted it and JS hasn't
|
|
1088
|
+
upgraded the element yet), keep the surface out of the flow. */
|
|
973
1089
|
[data-hl-popover]:not([popover]) {
|
|
1090
|
+
display: none;
|
|
1091
|
+
}
|
|
1092
|
+
|
|
1093
|
+
/* Engines without the Popover API can't promote it to the top layer, so the
|
|
1094
|
+
JS fallback positions it; give it a stacking context to land above content. */
|
|
1095
|
+
[data-hl-popover]:not(:popover-open) {
|
|
974
1096
|
z-index: 1400;
|
|
975
1097
|
z-index: var(--hl-z-popover);
|
|
976
1098
|
}
|
|
977
1099
|
|
|
978
|
-
|
|
979
|
-
|
|
1100
|
+
/* Modern placement: anchor to the invoking control (the popover's implicit
|
|
1101
|
+
anchor) and flip when there isn't room. Older engines use the JS fallback,
|
|
1102
|
+
which writes inline position/inset and wins over these rules. */
|
|
1103
|
+
@supports (position-area: block-end) {
|
|
1104
|
+
[data-hl-popover] {
|
|
1105
|
+
position: fixed;
|
|
1106
|
+
inset-area: block-end;
|
|
1107
|
+
position-area: block-end;
|
|
1108
|
+
position-try-fallbacks: flip-block, flip-inline;
|
|
1109
|
+
margin-top: 0.25rem;
|
|
1110
|
+
margin-bottom: 0.25rem;
|
|
1111
|
+
margin-top: var(--hl-space-1);
|
|
1112
|
+
margin-bottom: var(--hl-space-1);
|
|
1113
|
+
}
|
|
980
1114
|
}
|
|
981
1115
|
}
|
|
982
1116
|
|
|
1117
|
+
/**
|
|
1118
|
+
* Tooltip: a `[role="tooltip"]` element described by a `[data-hl-tooltip]`
|
|
1119
|
+
* trigger. With no JavaScript it shows on the trigger's `:hover`/`:focus-visible`
|
|
1120
|
+
* (the tip must be the trigger's next sibling). When the enhancer runs it marks
|
|
1121
|
+
* the trigger `data-hl-tooltip-managed` and drives visibility through
|
|
1122
|
+
* `data-hl-tooltip-open` instead, adding show/hide delays, a grace period, and
|
|
1123
|
+
* Escape-to-dismiss.
|
|
1124
|
+
*/
|
|
1125
|
+
|
|
983
1126
|
@layer components {
|
|
984
1127
|
[role='tooltip'] {
|
|
1128
|
+
/* Fallback placement: the JS positioner writes inline position/inset on
|
|
1129
|
+
engines without CSS anchor positioning. */
|
|
985
1130
|
position: absolute;
|
|
986
1131
|
z-index: 1600;
|
|
987
1132
|
z-index: var(--hl-z-tooltip);
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
translate: 0 -0.25rem;
|
|
1133
|
+
width: -moz-max-content;
|
|
1134
|
+
width: max-content;
|
|
1135
|
+
max-width: 32ch;
|
|
1136
|
+
margin: 0;
|
|
993
1137
|
padding: 0.25rem 0.5rem;
|
|
994
1138
|
padding: var(--hl-space-1) var(--hl-space-2);
|
|
995
1139
|
border-radius: 0.25rem;
|
|
@@ -1000,29 +1144,53 @@
|
|
|
1000
1144
|
color: var(--hl-surface);
|
|
1001
1145
|
font-size: 0.875rem;
|
|
1002
1146
|
font-size: var(--hl-text-sm);
|
|
1003
|
-
max-width: 32ch;
|
|
1004
|
-
width: -moz-max-content;
|
|
1005
|
-
width: max-content;
|
|
1006
1147
|
}
|
|
1007
1148
|
|
|
1008
1149
|
[role='tooltip'][hidden] {
|
|
1009
1150
|
display: none;
|
|
1010
1151
|
}
|
|
1152
|
+
|
|
1153
|
+
/* No-JS baseline: reveal while the adjacent trigger is hovered or focused.
|
|
1154
|
+
Suppressed once the enhancer takes over (trigger gains -managed). */
|
|
1155
|
+
[data-hl-tooltip]:not([data-hl-tooltip-managed]):hover + [role='tooltip'],
|
|
1156
|
+
[data-hl-tooltip]:not([data-hl-tooltip-managed]):focus-visible + [role='tooltip'] {
|
|
1157
|
+
display: block;
|
|
1158
|
+
}
|
|
1159
|
+
|
|
1160
|
+
/* Modern placement: pin above the trigger via the anchor-name the enhancer
|
|
1161
|
+
sets, flipping below when there's no room. */
|
|
1162
|
+
@supports (anchor-name: --x) {
|
|
1163
|
+
[role='tooltip'] {
|
|
1164
|
+
position: fixed;
|
|
1165
|
+
inset-area: block-start;
|
|
1166
|
+
position-area: block-start;
|
|
1167
|
+
position-try-fallbacks: flip-block;
|
|
1168
|
+
margin-top: 0.25rem;
|
|
1169
|
+
margin-bottom: 0.25rem;
|
|
1170
|
+
margin-top: var(--hl-space-1);
|
|
1171
|
+
margin-bottom: var(--hl-space-1);
|
|
1172
|
+
}
|
|
1173
|
+
}
|
|
1011
1174
|
}
|
|
1012
1175
|
|
|
1176
|
+
/**
|
|
1177
|
+
* Dropdown menu button: `<div data-hl-dropdown>` wrapping a
|
|
1178
|
+
* `[data-hl-dropdown-trigger]` button and a `[data-hl-dropdown-menu]` list. The
|
|
1179
|
+
* enhancer turns the menu into a native `popover` the trigger controls through
|
|
1180
|
+
* `popovertarget`, so opening, Escape, and light-dismiss need no JavaScript;
|
|
1181
|
+
* the menu lives in the top layer and is placed with CSS anchor positioning.
|
|
1182
|
+
*/
|
|
1183
|
+
|
|
1013
1184
|
@layer components {
|
|
1014
1185
|
[data-hl-dropdown] {
|
|
1015
|
-
position: relative;
|
|
1016
1186
|
display: inline-block;
|
|
1017
1187
|
}
|
|
1018
1188
|
|
|
1019
1189
|
[data-hl-dropdown-menu] {
|
|
1020
|
-
|
|
1021
|
-
z-index: 1000;
|
|
1022
|
-
z-index: var(--hl-z-dropdown);
|
|
1190
|
+
margin: 0;
|
|
1023
1191
|
min-width: 10rem;
|
|
1024
1192
|
border: 1px solid hsl(214, 32%, 91%);
|
|
1025
|
-
border:
|
|
1193
|
+
border: var(--hl-border-width) solid var(--hl-border);
|
|
1026
1194
|
border-radius: 0.5rem;
|
|
1027
1195
|
border-radius: var(--hl-radius-lg);
|
|
1028
1196
|
background: hsl(0, 0%, 100%);
|
|
@@ -1032,19 +1200,30 @@
|
|
|
1032
1200
|
padding: 0.25rem;
|
|
1033
1201
|
padding: var(--hl-space-1);
|
|
1034
1202
|
list-style: none;
|
|
1035
|
-
margin: 0.25rem 0 0;
|
|
1036
|
-
margin: var(--hl-space-1) 0 0;
|
|
1037
1203
|
}
|
|
1038
1204
|
|
|
1039
|
-
|
|
1205
|
+
/* Before the menu is promoted to a popover (JS not yet loaded), hide it. */
|
|
1206
|
+
[data-hl-dropdown-menu]:not([popover]) {
|
|
1040
1207
|
display: none;
|
|
1041
1208
|
}
|
|
1042
1209
|
|
|
1043
|
-
[data-hl-dropdown-menu]
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1210
|
+
[data-hl-dropdown-menu]:not(:popover-open) {
|
|
1211
|
+
z-index: 1000;
|
|
1212
|
+
z-index: var(--hl-z-dropdown);
|
|
1213
|
+
}
|
|
1214
|
+
|
|
1215
|
+
/* Open below the trigger, start-aligned, flipping when cramped. */
|
|
1216
|
+
@supports (position-area: block-end) {
|
|
1217
|
+
[data-hl-dropdown-menu] {
|
|
1218
|
+
position: fixed;
|
|
1219
|
+
inset-area: block-end span-inline-end;
|
|
1220
|
+
position-area: block-end span-inline-end;
|
|
1221
|
+
position-try-fallbacks: flip-block, flip-inline;
|
|
1222
|
+
margin-top: 0.25rem;
|
|
1223
|
+
margin-bottom: 0.25rem;
|
|
1224
|
+
margin-top: var(--hl-space-1);
|
|
1225
|
+
margin-bottom: var(--hl-space-1);
|
|
1226
|
+
}
|
|
1048
1227
|
}
|
|
1049
1228
|
|
|
1050
1229
|
[data-hl-dropdown-menu] [role='menuitem'] {
|
|
@@ -1085,9 +1264,11 @@
|
|
|
1085
1264
|
}
|
|
1086
1265
|
|
|
1087
1266
|
/**
|
|
1088
|
-
* Menubar / navigation menu
|
|
1267
|
+
* Menubar / navigation menu: `<ul data-hl-menu role="menubar">` with optional
|
|
1089
1268
|
* single-level submenus (`<ul role="menu" data-hl-menu-submenu>`). The enhancer
|
|
1090
|
-
* handles roving focus, arrow navigation, and open/close
|
|
1269
|
+
* handles roving focus, arrow navigation, and open/close, promoting each
|
|
1270
|
+
* submenu to a native popover so it renders in the top layer, anchored to its
|
|
1271
|
+
* trigger with CSS anchor positioning.
|
|
1091
1272
|
*/
|
|
1092
1273
|
|
|
1093
1274
|
@layer components {
|
|
@@ -1195,6 +1376,41 @@
|
|
|
1195
1376
|
display: none;
|
|
1196
1377
|
}
|
|
1197
1378
|
|
|
1379
|
+
/* Enhanced path: the submenu is a native popover in the top layer, anchored
|
|
1380
|
+
to its trigger. The absolute-position rules above stay as the fallback for
|
|
1381
|
+
engines without the Popover API. */
|
|
1382
|
+
[data-hl-menu] [role='menu'][popover] {
|
|
1383
|
+
position: fixed;
|
|
1384
|
+
top: auto;
|
|
1385
|
+
right: auto;
|
|
1386
|
+
bottom: auto;
|
|
1387
|
+
left: auto;
|
|
1388
|
+
}
|
|
1389
|
+
|
|
1390
|
+
@supports (position-area: block-end) {
|
|
1391
|
+
[data-hl-menu] [role='menu'][popover] {
|
|
1392
|
+
inset-area: block-end span-inline-end;
|
|
1393
|
+
position-area: block-end span-inline-end;
|
|
1394
|
+
position-try-fallbacks: flip-block, flip-inline;
|
|
1395
|
+
margin-top: 0.25rem;
|
|
1396
|
+
margin-bottom: 0.25rem;
|
|
1397
|
+
margin-top: var(--hl-space-1);
|
|
1398
|
+
margin-bottom: var(--hl-space-1);
|
|
1399
|
+
}
|
|
1400
|
+
|
|
1401
|
+
[data-hl-menu][aria-orientation='vertical'] [role='menu'][popover] {
|
|
1402
|
+
inset-area: inline-end span-block-end;
|
|
1403
|
+
position-area: inline-end span-block-end;
|
|
1404
|
+
position-try-fallbacks: flip-inline, flip-block;
|
|
1405
|
+
margin-top: 0;
|
|
1406
|
+
margin-bottom: 0;
|
|
1407
|
+
margin-left: 0.25rem;
|
|
1408
|
+
margin-right: 0.25rem;
|
|
1409
|
+
margin-left: var(--hl-space-1);
|
|
1410
|
+
margin-right: var(--hl-space-1);
|
|
1411
|
+
}
|
|
1412
|
+
}
|
|
1413
|
+
|
|
1198
1414
|
[data-hl-menu] [role='separator'] {
|
|
1199
1415
|
height: 1px;
|
|
1200
1416
|
height: var(--hl-border-width);
|
|
@@ -1315,7 +1531,7 @@
|
|
|
1315
1531
|
}
|
|
1316
1532
|
|
|
1317
1533
|
/**
|
|
1318
|
-
* Command palette
|
|
1534
|
+
* Command palette: `<div data-hl-command>` containing a search input
|
|
1319
1535
|
* (`[data-hl-command-input]`), an empty state (`[data-hl-command-empty]`), and a
|
|
1320
1536
|
* `[data-hl-command-list] role="listbox"` of grouped `[role="option"]` items.
|
|
1321
1537
|
* Often placed inside a `<dialog class="hl-modal">`.
|
|
@@ -1447,7 +1663,7 @@
|
|
|
1447
1663
|
/* Forms */
|
|
1448
1664
|
|
|
1449
1665
|
/**
|
|
1450
|
-
* Button
|
|
1666
|
+
* Button: `<button class="hl-button">` (works on `<a>`/`<input>` too).
|
|
1451
1667
|
*
|
|
1452
1668
|
* Color is driven by a small set of local custom properties so the
|
|
1453
1669
|
* intent × variant matrix stays DRY: `data-hl-intent` swaps the accent set,
|
|
@@ -1728,7 +1944,7 @@
|
|
|
1728
1944
|
}
|
|
1729
1945
|
|
|
1730
1946
|
/**
|
|
1731
|
-
* Text input
|
|
1947
|
+
* Text input: `<input class="hl-input">`.
|
|
1732
1948
|
* data-hl-size: sm | md (default) | lg
|
|
1733
1949
|
* data-hl-invalid: error styling (pair with aria-invalid)
|
|
1734
1950
|
*/
|
|
@@ -1852,7 +2068,7 @@
|
|
|
1852
2068
|
}
|
|
1853
2069
|
|
|
1854
2070
|
/**
|
|
1855
|
-
* Multi-line text input
|
|
2071
|
+
* Multi-line text input: `<textarea class="hl-textarea">`.
|
|
1856
2072
|
* data-hl-invalid: error styling (pair with aria-invalid)
|
|
1857
2073
|
*/
|
|
1858
2074
|
|
|
@@ -1941,7 +2157,7 @@
|
|
|
1941
2157
|
}
|
|
1942
2158
|
|
|
1943
2159
|
/**
|
|
1944
|
-
* Native select
|
|
2160
|
+
* Native select: `<span class="hl-select-wrapper"><select class="hl-select">`.
|
|
1945
2161
|
* The wrapper draws a custom caret while the native control keeps full
|
|
1946
2162
|
* keyboard/mobile behavior.
|
|
1947
2163
|
* data-hl-size: sm | md (default) | lg
|
|
@@ -2056,7 +2272,7 @@
|
|
|
2056
2272
|
}
|
|
2057
2273
|
|
|
2058
2274
|
/**
|
|
2059
|
-
* Checkbox
|
|
2275
|
+
* Checkbox: `<label class="hl-checkbox"><input type="checkbox"><span>…</span></label>`.
|
|
2060
2276
|
* The native input is restyled (appearance:none) with a CSS checkmark, keeping
|
|
2061
2277
|
* full keyboard + form semantics.
|
|
2062
2278
|
*/
|
|
@@ -2151,7 +2367,7 @@
|
|
|
2151
2367
|
}
|
|
2152
2368
|
|
|
2153
2369
|
/**
|
|
2154
|
-
* Radio
|
|
2370
|
+
* Radio: `<label class="hl-radio"><input type="radio"><span>…</span></label>`,
|
|
2155
2371
|
* grouped in `<div class="hl-radio-group" role="radiogroup">`.
|
|
2156
2372
|
*/
|
|
2157
2373
|
|
|
@@ -2310,7 +2526,7 @@
|
|
|
2310
2526
|
}
|
|
2311
2527
|
|
|
2312
2528
|
/**
|
|
2313
|
-
* Field
|
|
2529
|
+
* Field, accessible form-control layout: `.hl-field` stacks a `.hl-label`,
|
|
2314
2530
|
* the control, `.hl-help`, and `.hl-error`. `.hl-fieldset` + `.hl-legend`
|
|
2315
2531
|
* group related fields.
|
|
2316
2532
|
*/
|
|
@@ -2392,7 +2608,7 @@
|
|
|
2392
2608
|
}
|
|
2393
2609
|
|
|
2394
2610
|
/**
|
|
2395
|
-
* Combobox
|
|
2611
|
+
* Combobox: `<div data-hl-combobox>` wrapping an `<input>` and a
|
|
2396
2612
|
* `<ul role="listbox">` of `<li role="option">`. The enhancer toggles the
|
|
2397
2613
|
* listbox and manages `aria-activedescendant`.
|
|
2398
2614
|
*/
|
|
@@ -2427,6 +2643,26 @@
|
|
|
2427
2643
|
box-shadow: var(--hl-overlay-shadow);
|
|
2428
2644
|
}
|
|
2429
2645
|
|
|
2646
|
+
/* Modern engines pin the listbox to the input via the anchor-name the
|
|
2647
|
+
enhancer sets, so it escapes overflow-clipping ancestors. */
|
|
2648
|
+
@supports (anchor-name: --x) {
|
|
2649
|
+
[data-hl-combobox] [role='listbox'] {
|
|
2650
|
+
position: fixed;
|
|
2651
|
+
top: auto;
|
|
2652
|
+
right: auto;
|
|
2653
|
+
bottom: auto;
|
|
2654
|
+
left: auto;
|
|
2655
|
+
width: anchor-size(width);
|
|
2656
|
+
inset-area: block-end;
|
|
2657
|
+
position-area: block-end;
|
|
2658
|
+
position-try-fallbacks: flip-block;
|
|
2659
|
+
margin-top: 0.25rem;
|
|
2660
|
+
margin-bottom: 0.25rem;
|
|
2661
|
+
margin-top: var(--hl-space-1);
|
|
2662
|
+
margin-bottom: var(--hl-space-1);
|
|
2663
|
+
}
|
|
2664
|
+
}
|
|
2665
|
+
|
|
2430
2666
|
[data-hl-combobox] [role='listbox'][hidden] {
|
|
2431
2667
|
display: none;
|
|
2432
2668
|
}
|
|
@@ -2466,7 +2702,7 @@
|
|
|
2466
2702
|
}
|
|
2467
2703
|
|
|
2468
2704
|
/**
|
|
2469
|
-
* Segmented control
|
|
2705
|
+
* Segmented control: `<div class="hl-segmented" role="radiogroup">` of
|
|
2470
2706
|
* `<label class="hl-segmented-item"><input type="radio">…</label>` segments.
|
|
2471
2707
|
* Radio inputs give free keyboard navigation; the checked segment is raised.
|
|
2472
2708
|
* A button variant using `aria-pressed="true"` is also supported.
|
|
@@ -2575,7 +2811,7 @@
|
|
|
2575
2811
|
}
|
|
2576
2812
|
|
|
2577
2813
|
/**
|
|
2578
|
-
* Slider
|
|
2814
|
+
* Slider: native `<input type="range" class="hl-slider">`. Restyled track and
|
|
2579
2815
|
* thumb across WebKit/Blink and Firefox while keeping native keyboard support.
|
|
2580
2816
|
*/
|
|
2581
2817
|
|
|
@@ -2691,7 +2927,7 @@
|
|
|
2691
2927
|
/* Feedback & data display */
|
|
2692
2928
|
|
|
2693
2929
|
/**
|
|
2694
|
-
* Alert
|
|
2930
|
+
* Alert: `<div class="hl-alert" role="alert" data-hl-intent="…">` with an
|
|
2695
2931
|
* optional icon, `.hl-alert-title`, and body content.
|
|
2696
2932
|
* data-hl-intent: info (default) | success | warning | danger | neutral
|
|
2697
2933
|
*/
|
|
@@ -2778,7 +3014,7 @@
|
|
|
2778
3014
|
}
|
|
2779
3015
|
|
|
2780
3016
|
/**
|
|
2781
|
-
* Badge
|
|
3017
|
+
* Badge: `<span class="hl-badge" data-hl-intent="…" data-hl-variant="…">`.
|
|
2782
3018
|
* data-hl-intent: neutral (default) | primary | danger | success | warning | info
|
|
2783
3019
|
* data-hl-variant: soft (default) | solid | outline
|
|
2784
3020
|
* data-hl-size: sm | md (default)
|
|
@@ -2874,7 +3110,7 @@
|
|
|
2874
3110
|
}
|
|
2875
3111
|
|
|
2876
3112
|
/**
|
|
2877
|
-
* Card
|
|
3113
|
+
* Card: `<div class="hl-card">` with optional `.hl-card-header`,
|
|
2878
3114
|
* `.hl-card-body`, `.hl-card-footer`, `.hl-card-title`, `.hl-card-description`.
|
|
2879
3115
|
* data-hl-interactive: hover/active elevation for clickable cards
|
|
2880
3116
|
*/
|
|
@@ -2971,7 +3207,7 @@
|
|
|
2971
3207
|
}
|
|
2972
3208
|
|
|
2973
3209
|
/**
|
|
2974
|
-
* Avatar
|
|
3210
|
+
* Avatar: `<span class="hl-avatar">` containing an `<img>` or fallback
|
|
2975
3211
|
* initials/icon. Stack with `<div class="hl-avatar-group">`.
|
|
2976
3212
|
* data-hl-size: xs | sm | md (default) | lg | xl
|
|
2977
3213
|
* data-hl-shape: square
|
|
@@ -3053,7 +3289,7 @@
|
|
|
3053
3289
|
}
|
|
3054
3290
|
|
|
3055
3291
|
/**
|
|
3056
|
-
* Progress
|
|
3292
|
+
* Progress: native `<progress class="hl-progress" value max>`. Omit `value`
|
|
3057
3293
|
* for an indeterminate bar.
|
|
3058
3294
|
* data-hl-intent: primary (default) | success | warning | danger | info
|
|
3059
3295
|
* data-hl-size: sm | md (default) | lg
|
|
@@ -3159,7 +3395,7 @@
|
|
|
3159
3395
|
}
|
|
3160
3396
|
|
|
3161
3397
|
/**
|
|
3162
|
-
* Spinner
|
|
3398
|
+
* Spinner: `<span class="hl-spinner" role="status" aria-label="Loading">`.
|
|
3163
3399
|
* Inherits `currentColor`, so set `color` to theme it.
|
|
3164
3400
|
* data-hl-size: sm | md (default) | lg | xl
|
|
3165
3401
|
*/
|
|
@@ -3216,7 +3452,7 @@
|
|
|
3216
3452
|
}
|
|
3217
3453
|
|
|
3218
3454
|
/**
|
|
3219
|
-
* Skeleton
|
|
3455
|
+
* Skeleton: `<span class="hl-skeleton" data-hl-variant="…" aria-hidden="true">`
|
|
3220
3456
|
* placeholder shown while content loads.
|
|
3221
3457
|
* data-hl-variant: rect (default) | text | circle
|
|
3222
3458
|
*/
|
|
@@ -3278,7 +3514,7 @@
|
|
|
3278
3514
|
}
|
|
3279
3515
|
|
|
3280
3516
|
/**
|
|
3281
|
-
* Keyboard key
|
|
3517
|
+
* Keyboard key: `<kbd class="hl-kbd">⌘</kbd>`. Combine inline, e.g.
|
|
3282
3518
|
* `<kbd class="hl-kbd">⌘</kbd><kbd class="hl-kbd">K</kbd>`.
|
|
3283
3519
|
*/
|
|
3284
3520
|
|
|
@@ -3308,7 +3544,7 @@
|
|
|
3308
3544
|
}
|
|
3309
3545
|
|
|
3310
3546
|
/**
|
|
3311
|
-
* Table
|
|
3547
|
+
* Table: `<table class="hl-table">`. Semantic table styling with optional
|
|
3312
3548
|
* zebra striping and hover.
|
|
3313
3549
|
* data-hl-striped: zebra rows
|
|
3314
3550
|
* data-hl-hover: highlight row on hover
|