@zazz-ui/core 0.10.0 → 0.11.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/CHANGELOG.md +55 -0
- package/README.md +2 -2
- package/dist/sri.json +27 -27
- package/dist/zazz.css +1 -1
- package/editor/zazz.css-data.json +9 -1
- package/editor/zazz.language-data.json +53 -19
- package/editor/zazz.lint-data.json +915 -896
- package/package.json +1 -1
- package/src/base/_defaults.css +2 -2
- package/src/base/_variables.css +28 -3
- package/src/base/kit-styling.d.ts.map +1 -1
- package/src/base/kit-styling.js +145 -143
- package/src/base/kit-styling.ts +145 -143
- package/src/primitives/accordion/accordion.css +3 -0
- package/src/primitives/alert-dialog/alert-dialog.html +14 -14
- package/src/primitives/badge/badge.css +14 -0
- package/src/primitives/button/button.css +31 -3
- package/src/primitives/checkbox/checkbox.css +9 -0
- package/src/primitives/combobox/combobox.css +17 -1
- package/src/primitives/command/command-dialog.html +109 -107
- package/src/primitives/command/command.css +16 -8
- package/src/primitives/dialog/dialog.css +92 -40
- package/src/primitives/input/input.css +2 -1
- package/src/primitives/input-group/input-group.css +7 -3
- package/src/primitives/lightbox/lightbox.css +4 -4
- package/src/primitives/mobile-menu/mobile-menu.css +17 -16
- package/src/primitives/mobile-menu/mobile-menu.html +4 -4
- package/src/primitives/navigation-menu/navigation-menu.css +3 -3
- package/src/primitives/otp/otp.css +3 -2
- package/src/primitives/password-group/password-group.css +7 -3
- package/src/primitives/popover/popover.css +23 -10
- package/src/primitives/radio/radio.css +12 -2
- package/src/primitives/scroll-fade/scroll-fade.css +1 -1
- package/src/primitives/select/select.css +26 -13
- package/src/primitives/slider/slider.css +3 -0
- package/src/primitives/switch/switch.css +11 -0
- package/src/primitives/tabs/tabs.css +2 -1
- package/src/primitives/toggle/toggle.css +27 -3
- package/src/primitives/tooltip/tooltip.css +40 -25
|
@@ -7,6 +7,9 @@
|
|
|
7
7
|
* select.css (--ui-option-*, --ui-select-picker-icon-*),
|
|
8
8
|
* menu.css (--ui-menu-shadow)
|
|
9
9
|
* @uses [popover="manual"]: panel opened/closed by combobox.ts
|
|
10
|
+
* @uses --_touch-min (touch screens): the control grows to the touch floor; tag-remove
|
|
11
|
+
* keeps its box and extends an invisible ::after hit area (the trigger needs none:
|
|
12
|
+
* the whole control is one hit target)
|
|
10
13
|
* @uses anchor-name, anchor-scope, position-anchor: tether panel to the control
|
|
11
14
|
* @uses anchor-size(width): match panel width to the control (Baseline 2026)
|
|
12
15
|
* @uses :has(): chevron rotation, group + empty-state visibility
|
|
@@ -104,7 +107,10 @@
|
|
|
104
107
|
block-size: calc(var(--_h-len) + var(--_h-num) * var(--spacing));
|
|
105
108
|
--_min-h-len: var(--_min-h-resolved, var(--ui-combobox-control-min-h));
|
|
106
109
|
--_min-h-num: var(--_min-h-resolved, var(--ui-combobox-control-min-h));
|
|
107
|
-
min-block-size:
|
|
110
|
+
min-block-size: max(
|
|
111
|
+
calc(var(--_min-h-len) + var(--_min-h-num) * var(--spacing)),
|
|
112
|
+
var(--_touch-min)
|
|
113
|
+
);
|
|
108
114
|
--_py-len: var(--_py-resolved, var(--ui-combobox-control-py));
|
|
109
115
|
--_py-num: var(--_py-resolved, var(--ui-combobox-control-py));
|
|
110
116
|
padding-block: calc(var(--_py-len) + var(--_py-num) * var(--spacing));
|
|
@@ -320,6 +326,7 @@
|
|
|
320
326
|
}
|
|
321
327
|
|
|
322
328
|
:where(ui-combobox, [data-ui~="combobox"]) [data-combobox-slot~="tag-remove"] {
|
|
329
|
+
position: relative;
|
|
323
330
|
display: grid;
|
|
324
331
|
place-items: center;
|
|
325
332
|
flex-shrink: 0;
|
|
@@ -332,6 +339,15 @@
|
|
|
332
339
|
transition: var(--default-transition);
|
|
333
340
|
}
|
|
334
341
|
|
|
342
|
+
/* touch: the remove glyph is ~12px; ::after extends its hit area to the touch floor
|
|
343
|
+
block-wise and to 24px (WCAG 2.5.8) inline, so the tag's own text stays tappable */
|
|
344
|
+
:where(ui-combobox, [data-ui~="combobox"]) [data-combobox-slot~="tag-remove"]::after {
|
|
345
|
+
content: "";
|
|
346
|
+
position: absolute;
|
|
347
|
+
inset-block: min(0px, calc((100% - var(--_touch-min)) / 2));
|
|
348
|
+
inset-inline: min(0px, calc((100% - min(24px, var(--_touch-min))) / 2));
|
|
349
|
+
}
|
|
350
|
+
|
|
335
351
|
:where(ui-combobox, [data-ui~="combobox"]) [data-combobox-slot~="tag-remove"]::before {
|
|
336
352
|
content: "";
|
|
337
353
|
inline-size: 100%;
|
|
@@ -21,117 +21,119 @@
|
|
|
21
21
|
<ui-kbd-group><kbd>⌘</kbd><kbd>⇧</kbd><kbd>K</kbd></ui-kbd-group>
|
|
22
22
|
</button>
|
|
23
23
|
<dialog id="command-example-dialog-1" data-ui="dialog" data-command-slot="panel" closedby="any">
|
|
24
|
-
<
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
data-button-variant="ghost"
|
|
39
|
-
data-button-size="icon"
|
|
40
|
-
type="button"
|
|
41
|
-
command="close"
|
|
42
|
-
commandfor="command-example-dialog-1"
|
|
43
|
-
aria-label="Close"
|
|
44
|
-
>
|
|
45
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256">
|
|
46
|
-
<rect width="256" height="256" fill="none" />
|
|
47
|
-
<line
|
|
48
|
-
x1="200"
|
|
49
|
-
y1="56"
|
|
50
|
-
x2="56"
|
|
51
|
-
y2="200"
|
|
52
|
-
fill="none"
|
|
53
|
-
stroke="currentColor"
|
|
54
|
-
stroke-linecap="round"
|
|
55
|
-
stroke-linejoin="round"
|
|
56
|
-
stroke-width="16"
|
|
57
|
-
/>
|
|
58
|
-
<line
|
|
59
|
-
x1="200"
|
|
60
|
-
y1="200"
|
|
61
|
-
x2="56"
|
|
62
|
-
y2="56"
|
|
63
|
-
fill="none"
|
|
64
|
-
stroke="currentColor"
|
|
65
|
-
stroke-linecap="round"
|
|
66
|
-
stroke-linejoin="round"
|
|
67
|
-
stroke-width="16"
|
|
68
|
-
/>
|
|
69
|
-
</svg>
|
|
70
|
-
</button>
|
|
71
|
-
</header>
|
|
72
|
-
<div role="listbox" data-command-slot="list" aria-label="Commands">
|
|
73
|
-
<div role="group" data-command-slot="group" aria-labelledby="command-example-dialog-1-nav">
|
|
74
|
-
<span
|
|
75
|
-
data-command-slot="group-label"
|
|
76
|
-
id="command-example-dialog-1-nav"
|
|
77
|
-
style="
|
|
78
|
-
--display: inline-flex;
|
|
79
|
-
--font-size: var(--font-size-eyebrow);
|
|
80
|
-
--font-weight: strong;
|
|
81
|
-
--font-weight: var(--font-weight-eyebrow);
|
|
82
|
-
--leading: var(--leading-eyebrow);
|
|
83
|
-
--tracking: var(--tracking-eyebrow);
|
|
84
|
-
--text-transform: uppercase;
|
|
85
|
-
--text: var(--color-muted-foreground);
|
|
86
|
-
"
|
|
87
|
-
>Navigation</span
|
|
88
|
-
>
|
|
89
|
-
<a
|
|
90
|
-
role="option"
|
|
91
|
-
data-command-slot="item"
|
|
92
|
-
data-ui="button"
|
|
93
|
-
data-button-variant="ghost"
|
|
94
|
-
href="#home"
|
|
95
|
-
tabindex="-1"
|
|
96
|
-
style="--justify: start"
|
|
97
|
-
>
|
|
98
|
-
Go home
|
|
99
|
-
</a>
|
|
100
|
-
<a
|
|
101
|
-
role="option"
|
|
102
|
-
data-command-slot="item"
|
|
24
|
+
<div data-dialog-slot="content">
|
|
25
|
+
<header data-command-slot="header" data-dialog-slot="header">
|
|
26
|
+
<input
|
|
27
|
+
data-command-slot="input"
|
|
28
|
+
name="search"
|
|
29
|
+
type="text"
|
|
30
|
+
placeholder="Type a command or search..."
|
|
31
|
+
role="combobox"
|
|
32
|
+
aria-expanded="false"
|
|
33
|
+
aria-autocomplete="list"
|
|
34
|
+
autocomplete="off"
|
|
35
|
+
aria-label="Search commands"
|
|
36
|
+
/>
|
|
37
|
+
<button
|
|
103
38
|
data-ui="button"
|
|
104
39
|
data-button-variant="ghost"
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
40
|
+
data-button-size="icon"
|
|
41
|
+
type="button"
|
|
42
|
+
command="close"
|
|
43
|
+
commandfor="command-example-dialog-1"
|
|
44
|
+
aria-label="Close"
|
|
109
45
|
>
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
46
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256">
|
|
47
|
+
<rect width="256" height="256" fill="none" />
|
|
48
|
+
<line
|
|
49
|
+
x1="200"
|
|
50
|
+
y1="56"
|
|
51
|
+
x2="56"
|
|
52
|
+
y2="200"
|
|
53
|
+
fill="none"
|
|
54
|
+
stroke="currentColor"
|
|
55
|
+
stroke-linecap="round"
|
|
56
|
+
stroke-linejoin="round"
|
|
57
|
+
stroke-width="16"
|
|
58
|
+
/>
|
|
59
|
+
<line
|
|
60
|
+
x1="200"
|
|
61
|
+
y1="200"
|
|
62
|
+
x2="56"
|
|
63
|
+
y2="56"
|
|
64
|
+
fill="none"
|
|
65
|
+
stroke="currentColor"
|
|
66
|
+
stroke-linecap="round"
|
|
67
|
+
stroke-linejoin="round"
|
|
68
|
+
stroke-width="16"
|
|
69
|
+
/>
|
|
70
|
+
</svg>
|
|
71
|
+
</button>
|
|
72
|
+
</header>
|
|
73
|
+
<div role="listbox" data-command-slot="list" data-dialog-slot="body" aria-label="Commands">
|
|
74
|
+
<div role="group" data-command-slot="group" aria-labelledby="command-example-dialog-1-nav">
|
|
75
|
+
<span
|
|
76
|
+
data-command-slot="group-label"
|
|
77
|
+
id="command-example-dialog-1-nav"
|
|
78
|
+
style="
|
|
79
|
+
--display: inline-flex;
|
|
80
|
+
--font-size: var(--font-size-eyebrow);
|
|
81
|
+
--font-weight: strong;
|
|
82
|
+
--font-weight: var(--font-weight-eyebrow);
|
|
83
|
+
--leading: var(--leading-eyebrow);
|
|
84
|
+
--tracking: var(--tracking-eyebrow);
|
|
85
|
+
--text-transform: uppercase;
|
|
86
|
+
--text: var(--color-muted-foreground);
|
|
87
|
+
"
|
|
88
|
+
>Navigation</span
|
|
89
|
+
>
|
|
90
|
+
<a
|
|
91
|
+
role="option"
|
|
92
|
+
data-command-slot="item"
|
|
93
|
+
data-ui="button"
|
|
94
|
+
data-button-variant="ghost"
|
|
95
|
+
href="#home"
|
|
96
|
+
tabindex="-1"
|
|
97
|
+
style="--justify: start"
|
|
98
|
+
>
|
|
99
|
+
Go home
|
|
100
|
+
</a>
|
|
101
|
+
<a
|
|
102
|
+
role="option"
|
|
103
|
+
data-command-slot="item"
|
|
104
|
+
data-ui="button"
|
|
105
|
+
data-button-variant="ghost"
|
|
106
|
+
href="#projects"
|
|
107
|
+
tabindex="-1"
|
|
108
|
+
data-command-keywords="work portfolio"
|
|
109
|
+
style="--justify: start"
|
|
110
|
+
>
|
|
111
|
+
Go to projects
|
|
112
|
+
</a>
|
|
113
|
+
<a
|
|
114
|
+
role="option"
|
|
115
|
+
data-command-slot="item"
|
|
116
|
+
data-ui="button"
|
|
117
|
+
data-button-variant="ghost"
|
|
118
|
+
href="#team"
|
|
119
|
+
tabindex="-1"
|
|
120
|
+
data-command-keywords="people members"
|
|
121
|
+
style="--justify: start"
|
|
122
|
+
>
|
|
123
|
+
Go to team
|
|
124
|
+
</a>
|
|
125
|
+
</div>
|
|
124
126
|
</div>
|
|
127
|
+
<p data-command-slot="empty" style="--text: var(--color-muted-foreground)">
|
|
128
|
+
No commands found.
|
|
129
|
+
</p>
|
|
130
|
+
<footer data-command-slot="footer" data-dialog-slot="footer">
|
|
131
|
+
<span
|
|
132
|
+
><ui-kbd-group><kbd>↑</kbd><kbd>↓</kbd></ui-kbd-group> navigate</span
|
|
133
|
+
>
|
|
134
|
+
<span><kbd>↵</kbd> select</span>
|
|
135
|
+
<span><kbd>esc</kbd> close</span>
|
|
136
|
+
</footer>
|
|
125
137
|
</div>
|
|
126
|
-
<p data-command-slot="empty" style="--text: var(--color-muted-foreground)">
|
|
127
|
-
No commands found.
|
|
128
|
-
</p>
|
|
129
|
-
<footer data-command-slot="footer">
|
|
130
|
-
<span
|
|
131
|
-
><ui-kbd-group><kbd>↑</kbd><kbd>↓</kbd></ui-kbd-group> navigate</span
|
|
132
|
-
>
|
|
133
|
-
<span><kbd>↵</kbd> select</span>
|
|
134
|
-
<span><kbd>esc</kbd> close</span>
|
|
135
|
-
</footer>
|
|
136
138
|
</dialog>
|
|
137
139
|
</ui-command>
|
|
@@ -5,7 +5,9 @@
|
|
|
5
5
|
* @requires _layers.css, _variables.css, popover.css, button.css, fields.css,
|
|
6
6
|
* dialog.css, menu.css, select.css (--ui-option-*), kbd.css (--ui-kbd-group-*)
|
|
7
7
|
* @uses popovertarget + [popover="auto"]: dropdown surface, native light dismiss
|
|
8
|
-
* @uses <dialog data-ui="dialog"> + command="show-modal": focused surface
|
|
8
|
+
* @uses <dialog data-ui="dialog"> + command="show-modal": focused surface; its parts carry
|
|
9
|
+
* data-dialog-slot="content | header | body | footer" beside the command slots, so
|
|
10
|
+
* dialog.css owns layout, scrolling, and the phone's full-height model
|
|
9
11
|
* @uses anchor-name, anchor-scope, position-anchor: tether the popover form
|
|
10
12
|
* @uses :has(): group + empty-state visibility without JavaScript
|
|
11
13
|
* @tokens --ui-command-* (@layer variables); items alias --ui-option-*
|
|
@@ -44,24 +46,23 @@
|
|
|
44
46
|
}
|
|
45
47
|
|
|
46
48
|
:where(ui-command, [data-ui~="command"]) [data-command-slot~="panel"] {
|
|
47
|
-
/* flex-direction stays ungated so the close fade (display held by the
|
|
48
|
-
allow-discrete transition) keeps the column layout to the last frame */
|
|
49
|
-
flex-direction: column;
|
|
50
49
|
--_min-w-len: var(--_min-w-resolved, var(--ui-command-min-w));
|
|
51
50
|
--_min-w-num: var(--_min-w-resolved, var(--ui-command-min-w));
|
|
52
51
|
min-inline-size: calc(var(--_min-w-len) + var(--_min-w-num) * var(--spacing));
|
|
53
52
|
box-shadow: var(--ui-command-shadow);
|
|
54
53
|
}
|
|
55
54
|
|
|
56
|
-
/*
|
|
57
|
-
display: none on
|
|
58
|
-
|
|
59
|
-
|
|
55
|
+
/* Popover form only: the dialog form keeps dialog.css's grid. Display is gated on
|
|
56
|
+
the open state (unconditional, it would defeat the UA's display: none on a
|
|
57
|
+
closed popover); flex-direction stays ungated so the close fade (display held
|
|
58
|
+
by the allow-discrete transition) keeps the column layout to the last frame */
|
|
59
|
+
:where(ui-command, [data-ui~="command"]) [data-command-slot~="panel"]:where(:popover-open) {
|
|
60
60
|
display: flex;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
:where(ui-command, [data-ui~="command"]) [data-command-slot~="panel"]:where([popover]) {
|
|
64
64
|
position-anchor: --ui-command-trigger;
|
|
65
|
+
flex-direction: column;
|
|
65
66
|
padding: 0;
|
|
66
67
|
}
|
|
67
68
|
|
|
@@ -76,7 +77,9 @@
|
|
|
76
77
|
/* Search input: borderless over a hairline; the panel is the surface */
|
|
77
78
|
:where(ui-command, [data-ui~="command"]) [data-command-slot~="header"] {
|
|
78
79
|
display: flex;
|
|
80
|
+
flex-direction: row;
|
|
79
81
|
align-items: center;
|
|
82
|
+
padding: 0; /* the input carries the padding, not the dialog's header */
|
|
80
83
|
border-block-end: var(--ui-command-input-border);
|
|
81
84
|
}
|
|
82
85
|
|
|
@@ -101,6 +104,9 @@
|
|
|
101
104
|
outline: none;
|
|
102
105
|
}
|
|
103
106
|
|
|
107
|
+
/* The scroller in both forms. In the dialog form it is also the dialog's body slot,
|
|
108
|
+
so it inherits the scroll-fade mask, and below the sm band the dialog's
|
|
109
|
+
full-height rule lifts the cap. */
|
|
104
110
|
:where(ui-command, [data-ui~="command"]) [data-command-slot~="list"] {
|
|
105
111
|
display: flex;
|
|
106
112
|
flex-direction: column;
|
|
@@ -110,6 +116,7 @@
|
|
|
110
116
|
margin: 0;
|
|
111
117
|
overflow-y: auto;
|
|
112
118
|
overflow-x: clip;
|
|
119
|
+
overscroll-behavior: contain;
|
|
113
120
|
list-style: none;
|
|
114
121
|
}
|
|
115
122
|
|
|
@@ -145,6 +152,7 @@
|
|
|
145
152
|
|
|
146
153
|
:where(ui-command, [data-ui~="command"]) [data-command-slot~="footer"] {
|
|
147
154
|
display: flex;
|
|
155
|
+
justify-content: flex-start; /* hints read left to right; the dialog's footer ends */
|
|
148
156
|
align-items: center;
|
|
149
157
|
gap: calc(var(--spacing) * 2);
|
|
150
158
|
padding: var(--ui-command-footer-p);
|
|
@@ -15,10 +15,12 @@
|
|
|
15
15
|
* is read raw and takes a length or keyword; a --h utility or tier takes a scale
|
|
16
16
|
* number or a length; a keyword tier needs a base --h, or it renders as auto)
|
|
17
17
|
* @presets data-dialog-size="sm | md | lg | xl | 2xl | full | bleed" (the layout bands; sm when absent)
|
|
18
|
-
* @uses @media (width < 40rem) + @container style(--ui-dialog-mobile-size)
|
|
19
|
-
* band every dialog takes the hook's size (layout-bleed
|
|
20
|
-
*
|
|
21
|
-
*
|
|
18
|
+
* @uses @media (width < 40rem) and (not (hover: hover)) + @container style(--ui-dialog-mobile-size)
|
|
19
|
+
* — below the sm band on a touch screen every dialog takes the hook's size (layout-bleed
|
|
20
|
+
* by default) over its preset; a narrow window with a mouse keeps the preset; style
|
|
21
|
+
* queries are Firefox 151+, Chrome 111+, Safari 18+, an older engine keeps the preset
|
|
22
|
+
* @uses env(safe-area-inset-bottom) — the full-height content slot clears the home indicator
|
|
23
|
+
* @consumedby alert-dialog.css, command.css, lightbox.css, mobile-menu.css
|
|
22
24
|
*/
|
|
23
25
|
|
|
24
26
|
@layer variables {
|
|
@@ -26,11 +28,13 @@
|
|
|
26
28
|
--ui-dialog-backdrop-color: var(--color-shade-900);
|
|
27
29
|
--ui-dialog-transition-duration: var(--default-transition-duration);
|
|
28
30
|
--ui-dialog-transition-timing-function: var(--default-transition-timing-function);
|
|
29
|
-
--ui-dialog-backdrop-transition-duration: calc(var(--ui-dialog-transition-duration)
|
|
30
|
-
--ui-dialog-backdrop-transition-timing-function:
|
|
31
|
+
--ui-dialog-backdrop-transition-duration: calc(var(--ui-dialog-transition-duration) / 2);
|
|
32
|
+
--ui-dialog-backdrop-transition-timing-function: var(--bezier-easing);
|
|
31
33
|
--ui-dialog-backdrop-filter: none;
|
|
32
34
|
--ui-dialog-shadow: var(--shadow-lg);
|
|
33
|
-
--ui-dialog-border: 1px
|
|
35
|
+
--ui-dialog-border-width: 1px;
|
|
36
|
+
--ui-dialog-border-style: solid;
|
|
37
|
+
--ui-dialog-border-color: var(--color-border);
|
|
34
38
|
/* the sm band, the default size */
|
|
35
39
|
--ui-dialog-w: min(var(--layout-sm), 100% - var(--gutters) * 2);
|
|
36
40
|
/* below the sm band, the size every dialog takes: layout-bleed (edge to edge, no page
|
|
@@ -67,15 +71,17 @@
|
|
|
67
71
|
|
|
68
72
|
/* Spring-eased open/close */
|
|
69
73
|
:where(dialog) {
|
|
74
|
+
isolation: isolate;
|
|
70
75
|
margin: auto;
|
|
71
76
|
max-inline-size: calc(100% - var(--space-md));
|
|
72
77
|
max-block-size: calc(100% - var(--space-md));
|
|
73
|
-
border: var(--ui-dialog-border)
|
|
78
|
+
border: var(--ui-dialog-border-width) var(--ui-dialog-border-style)
|
|
79
|
+
var(--ui-dialog-border-color);
|
|
74
80
|
contain: layout style;
|
|
75
81
|
opacity: var(--ui-dialog-opacity--start);
|
|
76
82
|
box-shadow: var(--ui-dialog-shadow);
|
|
77
83
|
overscroll-behavior: contain;
|
|
78
|
-
overflow:
|
|
84
|
+
overflow: hidden;
|
|
79
85
|
transform: translate3d(var(--ui-dialog-translate--start)) scale(var(--ui-dialog-scale--start));
|
|
80
86
|
transition:
|
|
81
87
|
opacity var(--ui-dialog-transition-duration) var(--ui-dialog-transition-timing-function),
|
|
@@ -102,16 +108,17 @@
|
|
|
102
108
|
}
|
|
103
109
|
}
|
|
104
110
|
|
|
105
|
-
/* Backdrop fades via a discrete transition
|
|
111
|
+
/* Backdrop fades via a discrete transition. Twice the viewport tall: with the
|
|
112
|
+
software keyboard up, iOS shows the page below the rect fixed boxes fill, and a
|
|
113
|
+
fixed box past the viewport edge creates no scroll. */
|
|
106
114
|
:where(dialog)::backdrop {
|
|
107
115
|
position: fixed;
|
|
108
116
|
inline-size: 100%;
|
|
109
117
|
block-size: 100%;
|
|
110
118
|
inset: 0;
|
|
111
|
-
z-index: 1000;
|
|
112
119
|
opacity: 0;
|
|
113
120
|
overscroll-behavior: contain;
|
|
114
|
-
overflow:
|
|
121
|
+
overflow: clip;
|
|
115
122
|
background-color: var(--ui-dialog-backdrop-color);
|
|
116
123
|
backdrop-filter: var(--ui-dialog-backdrop-filter);
|
|
117
124
|
transition: opacity var(--ui-dialog-backdrop-transition-duration)
|
|
@@ -195,6 +202,8 @@
|
|
|
195
202
|
container-name: dialog;
|
|
196
203
|
font-size: var(--font-size-md);
|
|
197
204
|
isolation: isolate;
|
|
205
|
+
overflow: auto;
|
|
206
|
+
overscroll-behavior: contain;
|
|
198
207
|
}
|
|
199
208
|
|
|
200
209
|
/* A one-row grid, so the content slot is capped by the dialog's height rather than
|
|
@@ -231,9 +240,8 @@
|
|
|
231
240
|
grid-template-rows: auto minmax(0, 1fr) auto;
|
|
232
241
|
position: relative;
|
|
233
242
|
min-block-size: 0;
|
|
234
|
-
/* a centred grid item sizes to its content; the cap is what hands the body its scroll */
|
|
235
243
|
max-block-size: 100%;
|
|
236
|
-
|
|
244
|
+
overscroll-behavior: contain;
|
|
237
245
|
}
|
|
238
246
|
|
|
239
247
|
:where([data-ui~="dialog"]) [data-dialog-slot~="header"] {
|
|
@@ -244,32 +252,46 @@
|
|
|
244
252
|
padding-block-start: var(--space-sm);
|
|
245
253
|
}
|
|
246
254
|
|
|
247
|
-
:where([data-ui~="dialog"]) [data-dialog-slot~="header"]::after {
|
|
248
|
-
content: "";
|
|
249
|
-
display: block;
|
|
250
|
-
position: absolute;
|
|
251
|
-
inset-block-start: 100%;
|
|
252
|
-
inline-size: 100%;
|
|
253
|
-
block-size: var(--space-md);
|
|
254
|
-
background: linear-gradient(to top, transparent, var(--ui-dialog-bg));
|
|
255
|
-
}
|
|
256
|
-
|
|
257
255
|
:where([data-ui~="dialog"]) [data-dialog-slot~="body"] {
|
|
256
|
+
--_scroll-fade-gradient: linear-gradient(
|
|
257
|
+
to bottom,
|
|
258
|
+
transparent 0,
|
|
259
|
+
#000 var(--_scroll-fade-start),
|
|
260
|
+
#000 calc(100% - var(--_scroll-fade-end)),
|
|
261
|
+
transparent 100%
|
|
262
|
+
);
|
|
263
|
+
|
|
258
264
|
grid-row: 2;
|
|
259
265
|
display: grid;
|
|
260
266
|
padding-inline: var(--space-sm);
|
|
261
267
|
padding-block: var(--space-md);
|
|
262
|
-
min-block-size:
|
|
263
|
-
|
|
264
|
-
|
|
268
|
+
min-block-size: fit-content;
|
|
269
|
+
max-block-size: 100%;
|
|
270
|
+
overscroll-behavior: contain;
|
|
265
271
|
overflow-y: auto;
|
|
266
|
-
|
|
272
|
+
|
|
273
|
+
-webkit-mask-image: var(--ui-scroll-fade-mask, var(--_scroll-fade-gradient));
|
|
274
|
+
mask-image: var(--ui-scroll-fade-mask, var(--_scroll-fade-gradient));
|
|
275
|
+
-webkit-mask-composite: source-in;
|
|
276
|
+
mask-composite: intersect;
|
|
277
|
+
-webkit-mask-repeat: no-repeat;
|
|
278
|
+
mask-repeat: no-repeat;
|
|
279
|
+
|
|
280
|
+
@supports (animation-timeline: scroll()) {
|
|
281
|
+
animation:
|
|
282
|
+
ui-scroll-fade-reveal-start 1ms ease-in-out,
|
|
283
|
+
ui-scroll-fade-reveal-end 1ms ease-in-out;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
@supports not (animation-timeline: scroll()) {
|
|
287
|
+
--_scroll-fade-start: var(--ui-scroll-fade-size);
|
|
288
|
+
--_scroll-fade-end: var(--ui-scroll-fade-size);
|
|
289
|
+
}
|
|
267
290
|
}
|
|
268
291
|
|
|
269
292
|
:where([data-ui~="dialog"]) [data-dialog-slot~="footer"] {
|
|
270
293
|
grid-row: 3;
|
|
271
294
|
block-size: fit-content;
|
|
272
|
-
position: sticky;
|
|
273
295
|
inset-block-end: 0;
|
|
274
296
|
display: flex;
|
|
275
297
|
justify-content: flex-end;
|
|
@@ -308,12 +330,12 @@
|
|
|
308
330
|
}
|
|
309
331
|
|
|
310
332
|
:where([data-ui~="dialog"][data-dialog-size="bleed"]) {
|
|
311
|
-
--_dialog-w:
|
|
312
|
-
--_dialog-h:
|
|
333
|
+
--_dialog-w: 100dvi;
|
|
334
|
+
--_dialog-h: 100dvb;
|
|
313
335
|
--_dialog-radius: 0;
|
|
314
336
|
--_dialog-shadow: none;
|
|
315
|
-
max-inline-size:
|
|
316
|
-
max-block-size:
|
|
337
|
+
max-inline-size: 100dvi;
|
|
338
|
+
max-block-size: 100dvb;
|
|
317
339
|
}
|
|
318
340
|
|
|
319
341
|
/* Below the sm band the viewport is a phone, and every dialog takes --ui-dialog-mobile-size
|
|
@@ -322,21 +344,51 @@
|
|
|
322
344
|
for the site, or on one dialog's parent for that dialog alone. A viewport query, not a
|
|
323
345
|
container one, because a top-layer dialog is sized by the viewport. Style queries are
|
|
324
346
|
Firefox 151+; an older engine keeps the preset. */
|
|
325
|
-
@media (width < 40rem) {
|
|
347
|
+
@media (width < 40rem) and (not (hover: hover)) {
|
|
326
348
|
@container style(--ui-dialog-mobile-size: layout-bleed) {
|
|
349
|
+
/* Not :where(): the viewport decides the height here, over a consumer's own cap
|
|
350
|
+
on the same element (command's list max-block-size loads later at equal
|
|
351
|
+
specificity). Utilities still win through the layer order. */
|
|
352
|
+
[data-ui~="dialog"] [data-dialog-slot~="content"] {
|
|
353
|
+
place-content: start stretch;
|
|
354
|
+
block-size: 100%;
|
|
355
|
+
padding-block-end: env(safe-area-inset-bottom, 0px);
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
[data-ui~="dialog"] [data-dialog-slot~="body"] {
|
|
359
|
+
block-size: 100%;
|
|
360
|
+
max-block-size: 100%;
|
|
361
|
+
margin-block-end: auto;
|
|
362
|
+
}
|
|
363
|
+
|
|
327
364
|
:where([data-ui~="dialog"]) {
|
|
328
|
-
--
|
|
329
|
-
|
|
365
|
+
--ui-dialog-border-color: transparent;
|
|
366
|
+
|
|
367
|
+
--_dialog-w: 100dvi;
|
|
368
|
+
--_dialog-h: 100dvb;
|
|
330
369
|
--_dialog-radius: 0;
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
max-
|
|
370
|
+
|
|
371
|
+
margin: 0;
|
|
372
|
+
max-inline-size: 100dvi;
|
|
373
|
+
max-block-size: 100dvb;
|
|
374
|
+
overflow: scroll;
|
|
375
|
+
overscroll-behavior: contain;
|
|
376
|
+
container: none;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
:where(dialog)::backdrop {
|
|
380
|
+
inline-size: 100dvi;
|
|
381
|
+
block-size: 100dvb;
|
|
382
|
+
inset: 0;
|
|
383
|
+
opacity: 0;
|
|
384
|
+
overscroll-behavior: contain;
|
|
385
|
+
overflow: clip;
|
|
334
386
|
}
|
|
335
387
|
}
|
|
336
388
|
|
|
337
389
|
@container style(--ui-dialog-mobile-size: layout-full) {
|
|
338
390
|
:where([data-ui~="dialog"]) {
|
|
339
|
-
--_dialog-w: calc(
|
|
391
|
+
--_dialog-w: calc(100dvi - var(--gutters) * 2);
|
|
340
392
|
}
|
|
341
393
|
}
|
|
342
394
|
}
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* inputs (webkit.org/b/301648)
|
|
10
10
|
* @uses corner-shape — superellipse corners; unsupported browsers keep plain
|
|
11
11
|
* rounded corners
|
|
12
|
+
* @uses --_touch-min (touch screens) — the field grows to the touch floor
|
|
12
13
|
* @tokens --ui-input-* (@layer variables; surface colors and height read the
|
|
13
14
|
* --ui-field-* family directly)
|
|
14
15
|
*/
|
|
@@ -55,7 +56,7 @@
|
|
|
55
56
|
min-inline-size: calc(var(--_min-w-len) + var(--_min-w-num) * var(--spacing));
|
|
56
57
|
--_h-len: var(--_h-resolved, var(--ui-field-h));
|
|
57
58
|
--_h-num: var(--_h-resolved, var(--ui-field-h));
|
|
58
|
-
block-size: calc(var(--_h-len) + var(--_h-num) * var(--spacing));
|
|
59
|
+
block-size: max(calc(var(--_h-len) + var(--_h-num) * var(--spacing)), var(--_touch-min));
|
|
59
60
|
--_pl-len: var(--_pl-resolved, var(--ui-input-pl));
|
|
60
61
|
--_pl-num: var(--_pl-resolved, var(--ui-input-pl));
|
|
61
62
|
padding-inline-start: calc(var(--_pl-len) + var(--_pl-num) * var(--spacing));
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* @requires _layers.css, _variables.css, fields.css, input.css,
|
|
6
6
|
* textarea.css, button.css
|
|
7
7
|
* @uses :focus-within — lifts shell ring/border as one field
|
|
8
|
+
* @uses --_touch-min (touch screens) — the shell and its addons grow to the touch floor
|
|
8
9
|
* @uses :has() — restore padding when addons absent; invalid text color
|
|
9
10
|
* @uses data-input-group-align on the addon slot — inline-start/end, block-start/end
|
|
10
11
|
* @uses corner-shape — superellipse corners; unsupported browsers keep plain
|
|
@@ -65,7 +66,10 @@
|
|
|
65
66
|
inline-size: calc(var(--_w-len) + var(--_w-num) * var(--spacing));
|
|
66
67
|
--_min-h-len: var(--_min-h-resolved, var(--ui-input-group-min-h));
|
|
67
68
|
--_min-h-num: var(--_min-h-resolved, var(--ui-input-group-min-h));
|
|
68
|
-
min-block-size:
|
|
69
|
+
min-block-size: max(
|
|
70
|
+
calc(var(--_min-h-len) + var(--_min-h-num) * var(--spacing)),
|
|
71
|
+
var(--_touch-min)
|
|
72
|
+
);
|
|
69
73
|
--_p-len: var(--_p-resolved, var(--ui-input-group-p));
|
|
70
74
|
--_p-num: var(--_p-resolved, var(--ui-input-group-p));
|
|
71
75
|
padding: calc(var(--_p-len) + var(--_p-num) * var(--spacing));
|
|
@@ -182,8 +186,8 @@
|
|
|
182
186
|
gap: var(--spacing);
|
|
183
187
|
color: var(--color-muted-foreground);
|
|
184
188
|
white-space: nowrap;
|
|
185
|
-
block-size: var(--ui-field-h);
|
|
186
|
-
min-inline-size: var(--ui-field-h);
|
|
189
|
+
block-size: max(var(--ui-field-h), var(--_touch-min));
|
|
190
|
+
min-inline-size: max(var(--ui-field-h), var(--_touch-min));
|
|
187
191
|
padding-inline: var(--ui-field-addon-p);
|
|
188
192
|
}
|
|
189
193
|
|
|
@@ -333,7 +333,7 @@
|
|
|
333
333
|
:where(ui-lightbox, [data-ui~="lightbox"]) [data-lightbox-slot~="dialog"] {
|
|
334
334
|
--ui-lightbox-thumb-radius: var(--radius-sm);
|
|
335
335
|
--ui-dialog-bg: transparent;
|
|
336
|
-
--ui-dialog-border:
|
|
336
|
+
--ui-dialog-border-width: 0;
|
|
337
337
|
|
|
338
338
|
overflow: clip;
|
|
339
339
|
pointer-events: none;
|
|
@@ -352,8 +352,8 @@
|
|
|
352
352
|
[data-lightbox-slot~="dialog"]
|
|
353
353
|
[data-dialog-slot~="content"] {
|
|
354
354
|
grid-template-rows: 1fr;
|
|
355
|
-
max-block-size:
|
|
356
|
-
block-size:
|
|
355
|
+
max-block-size: 100%;
|
|
356
|
+
block-size: 100%;
|
|
357
357
|
overflow: clip;
|
|
358
358
|
}
|
|
359
359
|
|
|
@@ -363,7 +363,7 @@
|
|
|
363
363
|
display: grid;
|
|
364
364
|
grid-template-rows: 1fr auto;
|
|
365
365
|
block-size: 100%;
|
|
366
|
-
max-block-size:
|
|
366
|
+
max-block-size: 100%;
|
|
367
367
|
}
|
|
368
368
|
|
|
369
369
|
:where(ui-lightbox, [data-ui~="lightbox"])
|