contain-css-svelte 1.3.0 → 1.4.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/Card.svelte +204 -288
- package/dist/controls/Button.svelte +27 -1
- package/dist/controls/ButtonLink.svelte +27 -1
- package/dist/controls/Checkbox.svelte +26 -0
- package/dist/controls/CircleButton.svelte +27 -1
- package/dist/controls/Input.svelte +27 -1
- package/dist/controls/RadioButton.svelte +26 -0
- package/dist/controls/Select.svelte +26 -0
- package/dist/controls/Slider.svelte +27 -1
- package/dist/controls/TabItem.svelte +27 -1
- package/dist/controls/Toggle.svelte +27 -1
- package/dist/dropdowns/DropdownMenu.svelte +27 -1
- package/dist/layout/Accordion.svelte +27 -1
- package/dist/layout/Bar.svelte +37 -1
- package/dist/layout/ColumnContainer.svelte +27 -1
- package/dist/layout/Columns.svelte +27 -1
- package/dist/layout/Container.svelte +205 -292
- package/dist/layout/DataList.svelte +27 -1
- package/dist/layout/DataListItem.svelte +205 -292
- package/dist/layout/Fieldset.svelte +27 -1
- package/dist/layout/Form.svelte +205 -292
- package/dist/layout/FormItem.svelte +27 -1
- package/dist/layout/GridLayout.svelte +26 -0
- package/dist/layout/Hero.svelte +205 -292
- package/dist/layout/Inline.svelte +33 -1
- package/dist/layout/MenuList.svelte +27 -1
- package/dist/layout/Page.svelte +27 -1
- package/dist/layout/RowContainer.svelte +27 -1
- package/dist/layout/Sidebar.svelte +266 -33
- package/dist/layout/Sidebar.svelte.d.ts +34 -0
- package/dist/layout/SidebarContainer.svelte +27 -1
- package/dist/layout/SplitPane.svelte +27 -1
- package/dist/layout/Stack.svelte +33 -1
- package/dist/layout/TabBar.svelte +27 -1
- package/dist/layout/Table.svelte +238 -294
- package/dist/layout/Tile.svelte +204 -291
- package/dist/misc/CodeInner.svelte +27 -1
- package/dist/misc/Progress.svelte +205 -292
- package/dist/misc/Tag.svelte +27 -1
- package/dist/overlays/Dialog.svelte +205 -292
- package/dist/overlays/Tooltip.svelte +255 -349
- package/dist/sass/_typography.scss +203 -191
- package/dist/typography/TextLayout.svelte +482 -292
- package/dist/vars/defaults.css +258 -0
- package/dist/vars/typography-context.css +271 -0
- package/package.json +1 -1
|
@@ -36,7 +36,33 @@ const el = $derived(elementProps(restProps, "button", [
|
|
|
36
36
|
{/if}
|
|
37
37
|
</button>
|
|
38
38
|
|
|
39
|
-
<style>/*
|
|
39
|
+
<style>/* Per-level heading (h1-h6) box/typography properties, resolved to PRIVATE,
|
|
40
|
+
inheriting custom properties (--_h1-color, --_h2-font-size, etc) rather than
|
|
41
|
+
assigned directly to a matched h1-h6 selector. Nothing in this file matches
|
|
42
|
+
an actual heading element anymore -- see typography-context.css (vars/), which
|
|
43
|
+
is the single, global, :where()-scoped rule that actually reads these vars
|
|
44
|
+
and applies them to real elements. That split is what lets a component
|
|
45
|
+
nested arbitrarily deep (through <article>, <Tile>, whatever) still get the
|
|
46
|
+
nearest ancestor's heading styling: these are ordinary inherited custom
|
|
47
|
+
properties, so DOM proximity decides which component's values apply, not
|
|
48
|
+
selector specificity or stylesheet order. See AGENTS-INTERNAL.md. */
|
|
49
|
+
/* All six heading levels' context vars in one call -- what every
|
|
50
|
+
"typography container" component (Container, Card, Tile, TextLayout, ...)
|
|
51
|
+
includes on itself once, alongside the shared --_heading-* vars below. */
|
|
52
|
+
/* Shared prose-measure group: p, blockquote, dl, ul, ol. li/dt/dd don't get
|
|
53
|
+
their own vars -- they're never wider than their ul/ol/dl parent's own
|
|
54
|
+
max-width box, so they're already bounded for free by ordinary block
|
|
55
|
+
layout, not by anything selector-based reaching them individually. */
|
|
56
|
+
/* p specifically also gets the fuller typography-props-bare treatment
|
|
57
|
+
(paragraph-prefixed), which -- same as in the original selector-based
|
|
58
|
+
version -- is declared/consumed AFTER the shared prose vars above, so it
|
|
59
|
+
wins for whichever properties both groups set. */
|
|
60
|
+
/* The first paragraph in a typography context (p:first-of-type, or a p right
|
|
61
|
+
after a heading) gets its own, slightly different treatment -- larger lede
|
|
62
|
+
text, no top margin. Structural matching (:first-of-type, `h1 + p`) still
|
|
63
|
+
has to happen where the real element is, in the global consumer rule; only
|
|
64
|
+
the VALUES move to context vars here. */
|
|
65
|
+
/* Logical, not top/bottom/left/right: margin-block/margin-inline already take
|
|
40
66
|
one value (both sides equal) or two (start end), so there is no separate
|
|
41
67
|
"which side" prop to remember and no 4-value shorthand order to get wrong.
|
|
42
68
|
Defaults to 0 on purpose -- unlike padding-props above, a margin that
|
|
@@ -38,7 +38,33 @@ const iconSlotted = $derived(Boolean(icon));
|
|
|
38
38
|
</span>
|
|
39
39
|
</a>
|
|
40
40
|
|
|
41
|
-
<style>/*
|
|
41
|
+
<style>/* Per-level heading (h1-h6) box/typography properties, resolved to PRIVATE,
|
|
42
|
+
inheriting custom properties (--_h1-color, --_h2-font-size, etc) rather than
|
|
43
|
+
assigned directly to a matched h1-h6 selector. Nothing in this file matches
|
|
44
|
+
an actual heading element anymore -- see typography-context.css (vars/), which
|
|
45
|
+
is the single, global, :where()-scoped rule that actually reads these vars
|
|
46
|
+
and applies them to real elements. That split is what lets a component
|
|
47
|
+
nested arbitrarily deep (through <article>, <Tile>, whatever) still get the
|
|
48
|
+
nearest ancestor's heading styling: these are ordinary inherited custom
|
|
49
|
+
properties, so DOM proximity decides which component's values apply, not
|
|
50
|
+
selector specificity or stylesheet order. See AGENTS-INTERNAL.md. */
|
|
51
|
+
/* All six heading levels' context vars in one call -- what every
|
|
52
|
+
"typography container" component (Container, Card, Tile, TextLayout, ...)
|
|
53
|
+
includes on itself once, alongside the shared --_heading-* vars below. */
|
|
54
|
+
/* Shared prose-measure group: p, blockquote, dl, ul, ol. li/dt/dd don't get
|
|
55
|
+
their own vars -- they're never wider than their ul/ol/dl parent's own
|
|
56
|
+
max-width box, so they're already bounded for free by ordinary block
|
|
57
|
+
layout, not by anything selector-based reaching them individually. */
|
|
58
|
+
/* p specifically also gets the fuller typography-props-bare treatment
|
|
59
|
+
(paragraph-prefixed), which -- same as in the original selector-based
|
|
60
|
+
version -- is declared/consumed AFTER the shared prose vars above, so it
|
|
61
|
+
wins for whichever properties both groups set. */
|
|
62
|
+
/* The first paragraph in a typography context (p:first-of-type, or a p right
|
|
63
|
+
after a heading) gets its own, slightly different treatment -- larger lede
|
|
64
|
+
text, no top margin. Structural matching (:first-of-type, `h1 + p`) still
|
|
65
|
+
has to happen where the real element is, in the global consumer rule; only
|
|
66
|
+
the VALUES move to context vars here. */
|
|
67
|
+
/* Logical, not top/bottom/left/right: margin-block/margin-inline already take
|
|
42
68
|
one value (both sides equal) or two (start end), so there is no separate
|
|
43
69
|
"which side" prop to remember and no 4-value shorthand order to get wrong.
|
|
44
70
|
Defaults to 0 on purpose -- unlike padding-props above, a margin that
|
|
@@ -64,6 +64,32 @@ let ref = $state(null);
|
|
|
64
64
|
</div>
|
|
65
65
|
|
|
66
66
|
<style>@charset "UTF-8";
|
|
67
|
+
/* Per-level heading (h1-h6) box/typography properties, resolved to PRIVATE,
|
|
68
|
+
inheriting custom properties (--_h1-color, --_h2-font-size, etc) rather than
|
|
69
|
+
assigned directly to a matched h1-h6 selector. Nothing in this file matches
|
|
70
|
+
an actual heading element anymore -- see typography-context.css (vars/), which
|
|
71
|
+
is the single, global, :where()-scoped rule that actually reads these vars
|
|
72
|
+
and applies them to real elements. That split is what lets a component
|
|
73
|
+
nested arbitrarily deep (through <article>, <Tile>, whatever) still get the
|
|
74
|
+
nearest ancestor's heading styling: these are ordinary inherited custom
|
|
75
|
+
properties, so DOM proximity decides which component's values apply, not
|
|
76
|
+
selector specificity or stylesheet order. See AGENTS-INTERNAL.md. */
|
|
77
|
+
/* All six heading levels' context vars in one call -- what every
|
|
78
|
+
"typography container" component (Container, Card, Tile, TextLayout, ...)
|
|
79
|
+
includes on itself once, alongside the shared --_heading-* vars below. */
|
|
80
|
+
/* Shared prose-measure group: p, blockquote, dl, ul, ol. li/dt/dd don't get
|
|
81
|
+
their own vars -- they're never wider than their ul/ol/dl parent's own
|
|
82
|
+
max-width box, so they're already bounded for free by ordinary block
|
|
83
|
+
layout, not by anything selector-based reaching them individually. */
|
|
84
|
+
/* p specifically also gets the fuller typography-props-bare treatment
|
|
85
|
+
(paragraph-prefixed), which -- same as in the original selector-based
|
|
86
|
+
version -- is declared/consumed AFTER the shared prose vars above, so it
|
|
87
|
+
wins for whichever properties both groups set. */
|
|
88
|
+
/* The first paragraph in a typography context (p:first-of-type, or a p right
|
|
89
|
+
after a heading) gets its own, slightly different treatment -- larger lede
|
|
90
|
+
text, no top margin. Structural matching (:first-of-type, `h1 + p`) still
|
|
91
|
+
has to happen where the real element is, in the global consumer rule; only
|
|
92
|
+
the VALUES move to context vars here. */
|
|
67
93
|
/* Logical, not top/bottom/left/right: margin-block/margin-inline already take
|
|
68
94
|
one value (both sides equal) or two (start end), so there is no separate
|
|
69
95
|
"which side" prop to remember and no 4-value shorthand order to get wrong.
|
|
@@ -29,7 +29,33 @@ const el = $derived(elementProps(restProps, "circle-button", [
|
|
|
29
29
|
{@render children?.()}
|
|
30
30
|
</button>
|
|
31
31
|
|
|
32
|
-
<style>/*
|
|
32
|
+
<style>/* Per-level heading (h1-h6) box/typography properties, resolved to PRIVATE,
|
|
33
|
+
inheriting custom properties (--_h1-color, --_h2-font-size, etc) rather than
|
|
34
|
+
assigned directly to a matched h1-h6 selector. Nothing in this file matches
|
|
35
|
+
an actual heading element anymore -- see typography-context.css (vars/), which
|
|
36
|
+
is the single, global, :where()-scoped rule that actually reads these vars
|
|
37
|
+
and applies them to real elements. That split is what lets a component
|
|
38
|
+
nested arbitrarily deep (through <article>, <Tile>, whatever) still get the
|
|
39
|
+
nearest ancestor's heading styling: these are ordinary inherited custom
|
|
40
|
+
properties, so DOM proximity decides which component's values apply, not
|
|
41
|
+
selector specificity or stylesheet order. See AGENTS-INTERNAL.md. */
|
|
42
|
+
/* All six heading levels' context vars in one call -- what every
|
|
43
|
+
"typography container" component (Container, Card, Tile, TextLayout, ...)
|
|
44
|
+
includes on itself once, alongside the shared --_heading-* vars below. */
|
|
45
|
+
/* Shared prose-measure group: p, blockquote, dl, ul, ol. li/dt/dd don't get
|
|
46
|
+
their own vars -- they're never wider than their ul/ol/dl parent's own
|
|
47
|
+
max-width box, so they're already bounded for free by ordinary block
|
|
48
|
+
layout, not by anything selector-based reaching them individually. */
|
|
49
|
+
/* p specifically also gets the fuller typography-props-bare treatment
|
|
50
|
+
(paragraph-prefixed), which -- same as in the original selector-based
|
|
51
|
+
version -- is declared/consumed AFTER the shared prose vars above, so it
|
|
52
|
+
wins for whichever properties both groups set. */
|
|
53
|
+
/* The first paragraph in a typography context (p:first-of-type, or a p right
|
|
54
|
+
after a heading) gets its own, slightly different treatment -- larger lede
|
|
55
|
+
text, no top margin. Structural matching (:first-of-type, `h1 + p`) still
|
|
56
|
+
has to happen where the real element is, in the global consumer rule; only
|
|
57
|
+
the VALUES move to context vars here. */
|
|
58
|
+
/* Logical, not top/bottom/left/right: margin-block/margin-inline already take
|
|
33
59
|
one value (both sides equal) or two (start end), so there is no separate
|
|
34
60
|
"which side" prop to remember and no 4-value shorthand order to get wrong.
|
|
35
61
|
Defaults to 0 on purpose -- unlike padding-props above, a margin that
|
|
@@ -15,7 +15,33 @@ const el = $derived(elementProps(restProps, "input", INPUT_VARS));
|
|
|
15
15
|
|
|
16
16
|
<input bind:value {placeholder} class={className} {...el} />
|
|
17
17
|
|
|
18
|
-
<style>/*
|
|
18
|
+
<style>/* Per-level heading (h1-h6) box/typography properties, resolved to PRIVATE,
|
|
19
|
+
inheriting custom properties (--_h1-color, --_h2-font-size, etc) rather than
|
|
20
|
+
assigned directly to a matched h1-h6 selector. Nothing in this file matches
|
|
21
|
+
an actual heading element anymore -- see typography-context.css (vars/), which
|
|
22
|
+
is the single, global, :where()-scoped rule that actually reads these vars
|
|
23
|
+
and applies them to real elements. That split is what lets a component
|
|
24
|
+
nested arbitrarily deep (through <article>, <Tile>, whatever) still get the
|
|
25
|
+
nearest ancestor's heading styling: these are ordinary inherited custom
|
|
26
|
+
properties, so DOM proximity decides which component's values apply, not
|
|
27
|
+
selector specificity or stylesheet order. See AGENTS-INTERNAL.md. */
|
|
28
|
+
/* All six heading levels' context vars in one call -- what every
|
|
29
|
+
"typography container" component (Container, Card, Tile, TextLayout, ...)
|
|
30
|
+
includes on itself once, alongside the shared --_heading-* vars below. */
|
|
31
|
+
/* Shared prose-measure group: p, blockquote, dl, ul, ol. li/dt/dd don't get
|
|
32
|
+
their own vars -- they're never wider than their ul/ol/dl parent's own
|
|
33
|
+
max-width box, so they're already bounded for free by ordinary block
|
|
34
|
+
layout, not by anything selector-based reaching them individually. */
|
|
35
|
+
/* p specifically also gets the fuller typography-props-bare treatment
|
|
36
|
+
(paragraph-prefixed), which -- same as in the original selector-based
|
|
37
|
+
version -- is declared/consumed AFTER the shared prose vars above, so it
|
|
38
|
+
wins for whichever properties both groups set. */
|
|
39
|
+
/* The first paragraph in a typography context (p:first-of-type, or a p right
|
|
40
|
+
after a heading) gets its own, slightly different treatment -- larger lede
|
|
41
|
+
text, no top margin. Structural matching (:first-of-type, `h1 + p`) still
|
|
42
|
+
has to happen where the real element is, in the global consumer rule; only
|
|
43
|
+
the VALUES move to context vars here. */
|
|
44
|
+
/* Logical, not top/bottom/left/right: margin-block/margin-inline already take
|
|
19
45
|
one value (both sides equal) or two (start end), so there is no separate
|
|
20
46
|
"which side" prop to remember and no 4-value shorthand order to get wrong.
|
|
21
47
|
Defaults to 0 on purpose -- unlike padding-props above, a margin that
|
|
@@ -42,6 +42,32 @@ function handleChange() {
|
|
|
42
42
|
</div>
|
|
43
43
|
|
|
44
44
|
<style>@charset "UTF-8";
|
|
45
|
+
/* Per-level heading (h1-h6) box/typography properties, resolved to PRIVATE,
|
|
46
|
+
inheriting custom properties (--_h1-color, --_h2-font-size, etc) rather than
|
|
47
|
+
assigned directly to a matched h1-h6 selector. Nothing in this file matches
|
|
48
|
+
an actual heading element anymore -- see typography-context.css (vars/), which
|
|
49
|
+
is the single, global, :where()-scoped rule that actually reads these vars
|
|
50
|
+
and applies them to real elements. That split is what lets a component
|
|
51
|
+
nested arbitrarily deep (through <article>, <Tile>, whatever) still get the
|
|
52
|
+
nearest ancestor's heading styling: these are ordinary inherited custom
|
|
53
|
+
properties, so DOM proximity decides which component's values apply, not
|
|
54
|
+
selector specificity or stylesheet order. See AGENTS-INTERNAL.md. */
|
|
55
|
+
/* All six heading levels' context vars in one call -- what every
|
|
56
|
+
"typography container" component (Container, Card, Tile, TextLayout, ...)
|
|
57
|
+
includes on itself once, alongside the shared --_heading-* vars below. */
|
|
58
|
+
/* Shared prose-measure group: p, blockquote, dl, ul, ol. li/dt/dd don't get
|
|
59
|
+
their own vars -- they're never wider than their ul/ol/dl parent's own
|
|
60
|
+
max-width box, so they're already bounded for free by ordinary block
|
|
61
|
+
layout, not by anything selector-based reaching them individually. */
|
|
62
|
+
/* p specifically also gets the fuller typography-props-bare treatment
|
|
63
|
+
(paragraph-prefixed), which -- same as in the original selector-based
|
|
64
|
+
version -- is declared/consumed AFTER the shared prose vars above, so it
|
|
65
|
+
wins for whichever properties both groups set. */
|
|
66
|
+
/* The first paragraph in a typography context (p:first-of-type, or a p right
|
|
67
|
+
after a heading) gets its own, slightly different treatment -- larger lede
|
|
68
|
+
text, no top margin. Structural matching (:first-of-type, `h1 + p`) still
|
|
69
|
+
has to happen where the real element is, in the global consumer rule; only
|
|
70
|
+
the VALUES move to context vars here. */
|
|
45
71
|
/* Logical, not top/bottom/left/right: margin-block/margin-inline already take
|
|
46
72
|
one value (both sides equal) or two (start end), so there is no separate
|
|
47
73
|
"which side" prop to remember and no 4-value shorthand order to get wrong.
|
|
@@ -141,6 +141,32 @@ $effect(() => {
|
|
|
141
141
|
</div>
|
|
142
142
|
|
|
143
143
|
<style>@charset "UTF-8";
|
|
144
|
+
/* Per-level heading (h1-h6) box/typography properties, resolved to PRIVATE,
|
|
145
|
+
inheriting custom properties (--_h1-color, --_h2-font-size, etc) rather than
|
|
146
|
+
assigned directly to a matched h1-h6 selector. Nothing in this file matches
|
|
147
|
+
an actual heading element anymore -- see typography-context.css (vars/), which
|
|
148
|
+
is the single, global, :where()-scoped rule that actually reads these vars
|
|
149
|
+
and applies them to real elements. That split is what lets a component
|
|
150
|
+
nested arbitrarily deep (through <article>, <Tile>, whatever) still get the
|
|
151
|
+
nearest ancestor's heading styling: these are ordinary inherited custom
|
|
152
|
+
properties, so DOM proximity decides which component's values apply, not
|
|
153
|
+
selector specificity or stylesheet order. See AGENTS-INTERNAL.md. */
|
|
154
|
+
/* All six heading levels' context vars in one call -- what every
|
|
155
|
+
"typography container" component (Container, Card, Tile, TextLayout, ...)
|
|
156
|
+
includes on itself once, alongside the shared --_heading-* vars below. */
|
|
157
|
+
/* Shared prose-measure group: p, blockquote, dl, ul, ol. li/dt/dd don't get
|
|
158
|
+
their own vars -- they're never wider than their ul/ol/dl parent's own
|
|
159
|
+
max-width box, so they're already bounded for free by ordinary block
|
|
160
|
+
layout, not by anything selector-based reaching them individually. */
|
|
161
|
+
/* p specifically also gets the fuller typography-props-bare treatment
|
|
162
|
+
(paragraph-prefixed), which -- same as in the original selector-based
|
|
163
|
+
version -- is declared/consumed AFTER the shared prose vars above, so it
|
|
164
|
+
wins for whichever properties both groups set. */
|
|
165
|
+
/* The first paragraph in a typography context (p:first-of-type, or a p right
|
|
166
|
+
after a heading) gets its own, slightly different treatment -- larger lede
|
|
167
|
+
text, no top margin. Structural matching (:first-of-type, `h1 + p`) still
|
|
168
|
+
has to happen where the real element is, in the global consumer rule; only
|
|
169
|
+
the VALUES move to context vars here. */
|
|
144
170
|
/* Logical, not top/bottom/left/right: margin-block/margin-inline already take
|
|
145
171
|
one value (both sides equal) or two (start end), so there is no separate
|
|
146
172
|
"which side" prop to remember and no 4-value shorthand order to get wrong.
|
|
@@ -17,7 +17,33 @@ const el = $derived(elementProps(restProps, "slider", ["bg", "fg", "padding", "w
|
|
|
17
17
|
{...el}
|
|
18
18
|
/>
|
|
19
19
|
|
|
20
|
-
<style>/*
|
|
20
|
+
<style>/* Per-level heading (h1-h6) box/typography properties, resolved to PRIVATE,
|
|
21
|
+
inheriting custom properties (--_h1-color, --_h2-font-size, etc) rather than
|
|
22
|
+
assigned directly to a matched h1-h6 selector. Nothing in this file matches
|
|
23
|
+
an actual heading element anymore -- see typography-context.css (vars/), which
|
|
24
|
+
is the single, global, :where()-scoped rule that actually reads these vars
|
|
25
|
+
and applies them to real elements. That split is what lets a component
|
|
26
|
+
nested arbitrarily deep (through <article>, <Tile>, whatever) still get the
|
|
27
|
+
nearest ancestor's heading styling: these are ordinary inherited custom
|
|
28
|
+
properties, so DOM proximity decides which component's values apply, not
|
|
29
|
+
selector specificity or stylesheet order. See AGENTS-INTERNAL.md. */
|
|
30
|
+
/* All six heading levels' context vars in one call -- what every
|
|
31
|
+
"typography container" component (Container, Card, Tile, TextLayout, ...)
|
|
32
|
+
includes on itself once, alongside the shared --_heading-* vars below. */
|
|
33
|
+
/* Shared prose-measure group: p, blockquote, dl, ul, ol. li/dt/dd don't get
|
|
34
|
+
their own vars -- they're never wider than their ul/ol/dl parent's own
|
|
35
|
+
max-width box, so they're already bounded for free by ordinary block
|
|
36
|
+
layout, not by anything selector-based reaching them individually. */
|
|
37
|
+
/* p specifically also gets the fuller typography-props-bare treatment
|
|
38
|
+
(paragraph-prefixed), which -- same as in the original selector-based
|
|
39
|
+
version -- is declared/consumed AFTER the shared prose vars above, so it
|
|
40
|
+
wins for whichever properties both groups set. */
|
|
41
|
+
/* The first paragraph in a typography context (p:first-of-type, or a p right
|
|
42
|
+
after a heading) gets its own, slightly different treatment -- larger lede
|
|
43
|
+
text, no top margin. Structural matching (:first-of-type, `h1 + p`) still
|
|
44
|
+
has to happen where the real element is, in the global consumer rule; only
|
|
45
|
+
the VALUES move to context vars here. */
|
|
46
|
+
/* Logical, not top/bottom/left/right: margin-block/margin-inline already take
|
|
21
47
|
one value (both sides equal) or two (start end), so there is no separate
|
|
22
48
|
"which side" prop to remember and no 4-value shorthand order to get wrong.
|
|
23
49
|
Defaults to 0 on purpose -- unlike padding-props above, a margin that
|
|
@@ -29,7 +29,33 @@ const el = $derived(elementProps(restProps, "tab", [
|
|
|
29
29
|
</Button>
|
|
30
30
|
</div>
|
|
31
31
|
|
|
32
|
-
<style>/*
|
|
32
|
+
<style>/* Per-level heading (h1-h6) box/typography properties, resolved to PRIVATE,
|
|
33
|
+
inheriting custom properties (--_h1-color, --_h2-font-size, etc) rather than
|
|
34
|
+
assigned directly to a matched h1-h6 selector. Nothing in this file matches
|
|
35
|
+
an actual heading element anymore -- see typography-context.css (vars/), which
|
|
36
|
+
is the single, global, :where()-scoped rule that actually reads these vars
|
|
37
|
+
and applies them to real elements. That split is what lets a component
|
|
38
|
+
nested arbitrarily deep (through <article>, <Tile>, whatever) still get the
|
|
39
|
+
nearest ancestor's heading styling: these are ordinary inherited custom
|
|
40
|
+
properties, so DOM proximity decides which component's values apply, not
|
|
41
|
+
selector specificity or stylesheet order. See AGENTS-INTERNAL.md. */
|
|
42
|
+
/* All six heading levels' context vars in one call -- what every
|
|
43
|
+
"typography container" component (Container, Card, Tile, TextLayout, ...)
|
|
44
|
+
includes on itself once, alongside the shared --_heading-* vars below. */
|
|
45
|
+
/* Shared prose-measure group: p, blockquote, dl, ul, ol. li/dt/dd don't get
|
|
46
|
+
their own vars -- they're never wider than their ul/ol/dl parent's own
|
|
47
|
+
max-width box, so they're already bounded for free by ordinary block
|
|
48
|
+
layout, not by anything selector-based reaching them individually. */
|
|
49
|
+
/* p specifically also gets the fuller typography-props-bare treatment
|
|
50
|
+
(paragraph-prefixed), which -- same as in the original selector-based
|
|
51
|
+
version -- is declared/consumed AFTER the shared prose vars above, so it
|
|
52
|
+
wins for whichever properties both groups set. */
|
|
53
|
+
/* The first paragraph in a typography context (p:first-of-type, or a p right
|
|
54
|
+
after a heading) gets its own, slightly different treatment -- larger lede
|
|
55
|
+
text, no top margin. Structural matching (:first-of-type, `h1 + p`) still
|
|
56
|
+
has to happen where the real element is, in the global consumer rule; only
|
|
57
|
+
the VALUES move to context vars here. */
|
|
58
|
+
/* Logical, not top/bottom/left/right: margin-block/margin-inline already take
|
|
33
59
|
one value (both sides equal) or two (start end), so there is no separate
|
|
34
60
|
"which side" prop to remember and no 4-value shorthand order to get wrong.
|
|
35
61
|
Defaults to 0 on purpose -- unlike padding-props above, a margin that
|
|
@@ -46,7 +46,33 @@ const effectiveOnLabel = $derived(onLabel || children);
|
|
|
46
46
|
{/if}
|
|
47
47
|
</label>
|
|
48
48
|
|
|
49
|
-
<style>/*
|
|
49
|
+
<style>/* Per-level heading (h1-h6) box/typography properties, resolved to PRIVATE,
|
|
50
|
+
inheriting custom properties (--_h1-color, --_h2-font-size, etc) rather than
|
|
51
|
+
assigned directly to a matched h1-h6 selector. Nothing in this file matches
|
|
52
|
+
an actual heading element anymore -- see typography-context.css (vars/), which
|
|
53
|
+
is the single, global, :where()-scoped rule that actually reads these vars
|
|
54
|
+
and applies them to real elements. That split is what lets a component
|
|
55
|
+
nested arbitrarily deep (through <article>, <Tile>, whatever) still get the
|
|
56
|
+
nearest ancestor's heading styling: these are ordinary inherited custom
|
|
57
|
+
properties, so DOM proximity decides which component's values apply, not
|
|
58
|
+
selector specificity or stylesheet order. See AGENTS-INTERNAL.md. */
|
|
59
|
+
/* All six heading levels' context vars in one call -- what every
|
|
60
|
+
"typography container" component (Container, Card, Tile, TextLayout, ...)
|
|
61
|
+
includes on itself once, alongside the shared --_heading-* vars below. */
|
|
62
|
+
/* Shared prose-measure group: p, blockquote, dl, ul, ol. li/dt/dd don't get
|
|
63
|
+
their own vars -- they're never wider than their ul/ol/dl parent's own
|
|
64
|
+
max-width box, so they're already bounded for free by ordinary block
|
|
65
|
+
layout, not by anything selector-based reaching them individually. */
|
|
66
|
+
/* p specifically also gets the fuller typography-props-bare treatment
|
|
67
|
+
(paragraph-prefixed), which -- same as in the original selector-based
|
|
68
|
+
version -- is declared/consumed AFTER the shared prose vars above, so it
|
|
69
|
+
wins for whichever properties both groups set. */
|
|
70
|
+
/* The first paragraph in a typography context (p:first-of-type, or a p right
|
|
71
|
+
after a heading) gets its own, slightly different treatment -- larger lede
|
|
72
|
+
text, no top margin. Structural matching (:first-of-type, `h1 + p`) still
|
|
73
|
+
has to happen where the real element is, in the global consumer rule; only
|
|
74
|
+
the VALUES move to context vars here. */
|
|
75
|
+
/* Logical, not top/bottom/left/right: margin-block/margin-inline already take
|
|
50
76
|
one value (both sides equal) or two (start end), so there is no separate
|
|
51
77
|
"which side" prop to remember and no 4-value shorthand order to get wrong.
|
|
52
78
|
Defaults to 0 on purpose -- unlike padding-props above, a margin that
|
|
@@ -287,7 +287,33 @@ let popoverDiv = $state();
|
|
|
287
287
|
</div>
|
|
288
288
|
</nav>
|
|
289
289
|
|
|
290
|
-
<style>/*
|
|
290
|
+
<style>/* Per-level heading (h1-h6) box/typography properties, resolved to PRIVATE,
|
|
291
|
+
inheriting custom properties (--_h1-color, --_h2-font-size, etc) rather than
|
|
292
|
+
assigned directly to a matched h1-h6 selector. Nothing in this file matches
|
|
293
|
+
an actual heading element anymore -- see typography-context.css (vars/), which
|
|
294
|
+
is the single, global, :where()-scoped rule that actually reads these vars
|
|
295
|
+
and applies them to real elements. That split is what lets a component
|
|
296
|
+
nested arbitrarily deep (through <article>, <Tile>, whatever) still get the
|
|
297
|
+
nearest ancestor's heading styling: these are ordinary inherited custom
|
|
298
|
+
properties, so DOM proximity decides which component's values apply, not
|
|
299
|
+
selector specificity or stylesheet order. See AGENTS-INTERNAL.md. */
|
|
300
|
+
/* All six heading levels' context vars in one call -- what every
|
|
301
|
+
"typography container" component (Container, Card, Tile, TextLayout, ...)
|
|
302
|
+
includes on itself once, alongside the shared --_heading-* vars below. */
|
|
303
|
+
/* Shared prose-measure group: p, blockquote, dl, ul, ol. li/dt/dd don't get
|
|
304
|
+
their own vars -- they're never wider than their ul/ol/dl parent's own
|
|
305
|
+
max-width box, so they're already bounded for free by ordinary block
|
|
306
|
+
layout, not by anything selector-based reaching them individually. */
|
|
307
|
+
/* p specifically also gets the fuller typography-props-bare treatment
|
|
308
|
+
(paragraph-prefixed), which -- same as in the original selector-based
|
|
309
|
+
version -- is declared/consumed AFTER the shared prose vars above, so it
|
|
310
|
+
wins for whichever properties both groups set. */
|
|
311
|
+
/* The first paragraph in a typography context (p:first-of-type, or a p right
|
|
312
|
+
after a heading) gets its own, slightly different treatment -- larger lede
|
|
313
|
+
text, no top margin. Structural matching (:first-of-type, `h1 + p`) still
|
|
314
|
+
has to happen where the real element is, in the global consumer rule; only
|
|
315
|
+
the VALUES move to context vars here. */
|
|
316
|
+
/* Logical, not top/bottom/left/right: margin-block/margin-inline already take
|
|
291
317
|
one value (both sides equal) or two (start end), so there is no separate
|
|
292
318
|
"which side" prop to remember and no 4-value shorthand order to get wrong.
|
|
293
319
|
Defaults to 0 on purpose -- unlike padding-props above, a margin that
|
|
@@ -53,7 +53,33 @@ function onAccordionClicked(e) {
|
|
|
53
53
|
{@render children?.()}
|
|
54
54
|
</div>
|
|
55
55
|
|
|
56
|
-
<style>/*
|
|
56
|
+
<style>/* Per-level heading (h1-h6) box/typography properties, resolved to PRIVATE,
|
|
57
|
+
inheriting custom properties (--_h1-color, --_h2-font-size, etc) rather than
|
|
58
|
+
assigned directly to a matched h1-h6 selector. Nothing in this file matches
|
|
59
|
+
an actual heading element anymore -- see typography-context.css (vars/), which
|
|
60
|
+
is the single, global, :where()-scoped rule that actually reads these vars
|
|
61
|
+
and applies them to real elements. That split is what lets a component
|
|
62
|
+
nested arbitrarily deep (through <article>, <Tile>, whatever) still get the
|
|
63
|
+
nearest ancestor's heading styling: these are ordinary inherited custom
|
|
64
|
+
properties, so DOM proximity decides which component's values apply, not
|
|
65
|
+
selector specificity or stylesheet order. See AGENTS-INTERNAL.md. */
|
|
66
|
+
/* All six heading levels' context vars in one call -- what every
|
|
67
|
+
"typography container" component (Container, Card, Tile, TextLayout, ...)
|
|
68
|
+
includes on itself once, alongside the shared --_heading-* vars below. */
|
|
69
|
+
/* Shared prose-measure group: p, blockquote, dl, ul, ol. li/dt/dd don't get
|
|
70
|
+
their own vars -- they're never wider than their ul/ol/dl parent's own
|
|
71
|
+
max-width box, so they're already bounded for free by ordinary block
|
|
72
|
+
layout, not by anything selector-based reaching them individually. */
|
|
73
|
+
/* p specifically also gets the fuller typography-props-bare treatment
|
|
74
|
+
(paragraph-prefixed), which -- same as in the original selector-based
|
|
75
|
+
version -- is declared/consumed AFTER the shared prose vars above, so it
|
|
76
|
+
wins for whichever properties both groups set. */
|
|
77
|
+
/* The first paragraph in a typography context (p:first-of-type, or a p right
|
|
78
|
+
after a heading) gets its own, slightly different treatment -- larger lede
|
|
79
|
+
text, no top margin. Structural matching (:first-of-type, `h1 + p`) still
|
|
80
|
+
has to happen where the real element is, in the global consumer rule; only
|
|
81
|
+
the VALUES move to context vars here. */
|
|
82
|
+
/* Logical, not top/bottom/left/right: margin-block/margin-inline already take
|
|
57
83
|
one value (both sides equal) or two (start end), so there is no separate
|
|
58
84
|
"which side" prop to remember and no 4-value shorthand order to get wrong.
|
|
59
85
|
Defaults to 0 on purpose -- unlike padding-props above, a margin that
|
package/dist/layout/Bar.svelte
CHANGED
|
@@ -48,7 +48,33 @@ const el = $derived(elementProps({ ...restProps, marginTop, marginBottom }, "bar
|
|
|
48
48
|
{@render children?.()}
|
|
49
49
|
</div>
|
|
50
50
|
|
|
51
|
-
<style>/*
|
|
51
|
+
<style>/* Per-level heading (h1-h6) box/typography properties, resolved to PRIVATE,
|
|
52
|
+
inheriting custom properties (--_h1-color, --_h2-font-size, etc) rather than
|
|
53
|
+
assigned directly to a matched h1-h6 selector. Nothing in this file matches
|
|
54
|
+
an actual heading element anymore -- see typography-context.css (vars/), which
|
|
55
|
+
is the single, global, :where()-scoped rule that actually reads these vars
|
|
56
|
+
and applies them to real elements. That split is what lets a component
|
|
57
|
+
nested arbitrarily deep (through <article>, <Tile>, whatever) still get the
|
|
58
|
+
nearest ancestor's heading styling: these are ordinary inherited custom
|
|
59
|
+
properties, so DOM proximity decides which component's values apply, not
|
|
60
|
+
selector specificity or stylesheet order. See AGENTS-INTERNAL.md. */
|
|
61
|
+
/* All six heading levels' context vars in one call -- what every
|
|
62
|
+
"typography container" component (Container, Card, Tile, TextLayout, ...)
|
|
63
|
+
includes on itself once, alongside the shared --_heading-* vars below. */
|
|
64
|
+
/* Shared prose-measure group: p, blockquote, dl, ul, ol. li/dt/dd don't get
|
|
65
|
+
their own vars -- they're never wider than their ul/ol/dl parent's own
|
|
66
|
+
max-width box, so they're already bounded for free by ordinary block
|
|
67
|
+
layout, not by anything selector-based reaching them individually. */
|
|
68
|
+
/* p specifically also gets the fuller typography-props-bare treatment
|
|
69
|
+
(paragraph-prefixed), which -- same as in the original selector-based
|
|
70
|
+
version -- is declared/consumed AFTER the shared prose vars above, so it
|
|
71
|
+
wins for whichever properties both groups set. */
|
|
72
|
+
/* The first paragraph in a typography context (p:first-of-type, or a p right
|
|
73
|
+
after a heading) gets its own, slightly different treatment -- larger lede
|
|
74
|
+
text, no top margin. Structural matching (:first-of-type, `h1 + p`) still
|
|
75
|
+
has to happen where the real element is, in the global consumer rule; only
|
|
76
|
+
the VALUES move to context vars here. */
|
|
77
|
+
/* Logical, not top/bottom/left/right: margin-block/margin-inline already take
|
|
52
78
|
one value (both sides equal) or two (start end), so there is no separate
|
|
53
79
|
"which side" prop to remember and no 4-value shorthand order to get wrong.
|
|
54
80
|
Defaults to 0 on purpose -- unlike padding-props above, a margin that
|
|
@@ -193,6 +219,16 @@ const el = $derived(elementProps({ ...restProps, marginTop, marginBottom }, "bar
|
|
|
193
219
|
overflow: var(--bar-overflow, visible);
|
|
194
220
|
/* Reset form label width in horizontal context */
|
|
195
221
|
--form-label-width: auto;
|
|
222
|
+
/* A Bar lays its content out in a flex row, so a heading dropped inside
|
|
223
|
+
it must not inherit an ancestor Container's (or any other typography
|
|
224
|
+
container's) prose-measure margins -- auto inline margins in a flex
|
|
225
|
+
row eat the row's free space and drag the heading toward the middle,
|
|
226
|
+
fighting `justify-content: space-between`. This is a plain custom
|
|
227
|
+
property override, not a selector reset: it wins for anything inside
|
|
228
|
+
`.bar` purely by being the nearest ancestor to declare it, regardless
|
|
229
|
+
of stylesheet order, so it doesn't need `!important` or a doubled
|
|
230
|
+
class the way an outside consumer's workaround for this used to. */
|
|
231
|
+
--_heading-margin-inline: var-with-fallbacks(--heading-margin-inline, bar, 0);
|
|
196
232
|
}
|
|
197
233
|
|
|
198
234
|
.bar :global(h1),
|
|
@@ -21,7 +21,33 @@ const el = $derived(elementProps(restProps, "column-container", COLUMN_CONTAINER
|
|
|
21
21
|
{@render children?.()}
|
|
22
22
|
</section>
|
|
23
23
|
|
|
24
|
-
<style>/*
|
|
24
|
+
<style>/* Per-level heading (h1-h6) box/typography properties, resolved to PRIVATE,
|
|
25
|
+
inheriting custom properties (--_h1-color, --_h2-font-size, etc) rather than
|
|
26
|
+
assigned directly to a matched h1-h6 selector. Nothing in this file matches
|
|
27
|
+
an actual heading element anymore -- see typography-context.css (vars/), which
|
|
28
|
+
is the single, global, :where()-scoped rule that actually reads these vars
|
|
29
|
+
and applies them to real elements. That split is what lets a component
|
|
30
|
+
nested arbitrarily deep (through <article>, <Tile>, whatever) still get the
|
|
31
|
+
nearest ancestor's heading styling: these are ordinary inherited custom
|
|
32
|
+
properties, so DOM proximity decides which component's values apply, not
|
|
33
|
+
selector specificity or stylesheet order. See AGENTS-INTERNAL.md. */
|
|
34
|
+
/* All six heading levels' context vars in one call -- what every
|
|
35
|
+
"typography container" component (Container, Card, Tile, TextLayout, ...)
|
|
36
|
+
includes on itself once, alongside the shared --_heading-* vars below. */
|
|
37
|
+
/* Shared prose-measure group: p, blockquote, dl, ul, ol. li/dt/dd don't get
|
|
38
|
+
their own vars -- they're never wider than their ul/ol/dl parent's own
|
|
39
|
+
max-width box, so they're already bounded for free by ordinary block
|
|
40
|
+
layout, not by anything selector-based reaching them individually. */
|
|
41
|
+
/* p specifically also gets the fuller typography-props-bare treatment
|
|
42
|
+
(paragraph-prefixed), which -- same as in the original selector-based
|
|
43
|
+
version -- is declared/consumed AFTER the shared prose vars above, so it
|
|
44
|
+
wins for whichever properties both groups set. */
|
|
45
|
+
/* The first paragraph in a typography context (p:first-of-type, or a p right
|
|
46
|
+
after a heading) gets its own, slightly different treatment -- larger lede
|
|
47
|
+
text, no top margin. Structural matching (:first-of-type, `h1 + p`) still
|
|
48
|
+
has to happen where the real element is, in the global consumer rule; only
|
|
49
|
+
the VALUES move to context vars here. */
|
|
50
|
+
/* Logical, not top/bottom/left/right: margin-block/margin-inline already take
|
|
25
51
|
one value (both sides equal) or two (start end), so there is no separate
|
|
26
52
|
"which side" prop to remember and no 4-value shorthand order to get wrong.
|
|
27
53
|
Defaults to 0 on purpose -- unlike padding-props above, a margin that
|
|
@@ -7,7 +7,33 @@ const el = $derived(elementProps(restProps, "columns", ["gap"]));
|
|
|
7
7
|
{@render children?.()}
|
|
8
8
|
</div>
|
|
9
9
|
|
|
10
|
-
<style>/*
|
|
10
|
+
<style>/* Per-level heading (h1-h6) box/typography properties, resolved to PRIVATE,
|
|
11
|
+
inheriting custom properties (--_h1-color, --_h2-font-size, etc) rather than
|
|
12
|
+
assigned directly to a matched h1-h6 selector. Nothing in this file matches
|
|
13
|
+
an actual heading element anymore -- see typography-context.css (vars/), which
|
|
14
|
+
is the single, global, :where()-scoped rule that actually reads these vars
|
|
15
|
+
and applies them to real elements. That split is what lets a component
|
|
16
|
+
nested arbitrarily deep (through <article>, <Tile>, whatever) still get the
|
|
17
|
+
nearest ancestor's heading styling: these are ordinary inherited custom
|
|
18
|
+
properties, so DOM proximity decides which component's values apply, not
|
|
19
|
+
selector specificity or stylesheet order. See AGENTS-INTERNAL.md. */
|
|
20
|
+
/* All six heading levels' context vars in one call -- what every
|
|
21
|
+
"typography container" component (Container, Card, Tile, TextLayout, ...)
|
|
22
|
+
includes on itself once, alongside the shared --_heading-* vars below. */
|
|
23
|
+
/* Shared prose-measure group: p, blockquote, dl, ul, ol. li/dt/dd don't get
|
|
24
|
+
their own vars -- they're never wider than their ul/ol/dl parent's own
|
|
25
|
+
max-width box, so they're already bounded for free by ordinary block
|
|
26
|
+
layout, not by anything selector-based reaching them individually. */
|
|
27
|
+
/* p specifically also gets the fuller typography-props-bare treatment
|
|
28
|
+
(paragraph-prefixed), which -- same as in the original selector-based
|
|
29
|
+
version -- is declared/consumed AFTER the shared prose vars above, so it
|
|
30
|
+
wins for whichever properties both groups set. */
|
|
31
|
+
/* The first paragraph in a typography context (p:first-of-type, or a p right
|
|
32
|
+
after a heading) gets its own, slightly different treatment -- larger lede
|
|
33
|
+
text, no top margin. Structural matching (:first-of-type, `h1 + p`) still
|
|
34
|
+
has to happen where the real element is, in the global consumer rule; only
|
|
35
|
+
the VALUES move to context vars here. */
|
|
36
|
+
/* Logical, not top/bottom/left/right: margin-block/margin-inline already take
|
|
11
37
|
one value (both sides equal) or two (start end), so there is no separate
|
|
12
38
|
"which side" prop to remember and no 4-value shorthand order to get wrong.
|
|
13
39
|
Defaults to 0 on purpose -- unlike padding-props above, a margin that
|