use-wc 1.0.0-pre.73 → 1.0.0-pre.74
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/design-system.css +334 -136
- package/dist/tokens.css +2 -2
- package/dist/use-wc.d.mts +66 -67
- package/dist/use-wc.mjs +109 -99
- package/package.json +9 -8
package/dist/design-system.css
CHANGED
|
@@ -201,7 +201,7 @@
|
|
|
201
201
|
}
|
|
202
202
|
|
|
203
203
|
@layer use-theme.selector {
|
|
204
|
-
input:is([type="checkbox"], [type="radio"]) {
|
|
204
|
+
input:is([type="checkbox"], [type="radio"]):not([role="switch"]) {
|
|
205
205
|
all: unset;
|
|
206
206
|
appearance: none;
|
|
207
207
|
box-sizing: border-box;
|
|
@@ -2045,25 +2045,35 @@
|
|
|
2045
2045
|
to reorder markup.
|
|
2046
2046
|
|
|
2047
2047
|
A variant's own density sets *only* two axes on itself — `--usewc-layout-region-padding` (the
|
|
2048
|
-
inline inset) and `--usewc-layout-region-gap` (everything block
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
`
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
the
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2048
|
+
inline inset) and `--usewc-layout-region-gap` (everything block) — plus `-avatar-size` and
|
|
2049
|
+
`--usewc-layout-footer-justify`. For `.entry`, `.message` and `.media`, `-gap` is both a
|
|
2050
|
+
region's own block padding and the room it leaves around its neighbours, reused rather than
|
|
2051
|
+
duplicated so the two always agree. For `.page`/`.card`, `-gap` is instead the host's own
|
|
2052
|
+
`padding-block` and container `gap` directly — same value, same "how far apart do things
|
|
2053
|
+
stack" meaning, just spent at the host level since a region there carries no padding of its
|
|
2054
|
+
own. Each variant's own region rules read these — grouped by actual shape (`.page`/`.card`,
|
|
2055
|
+
`.entry`/`.message`, `.media` on its own) rather than shared across all five, since a shape
|
|
2056
|
+
that stacks in one column, one that's a two-column grid, and one that's a table already end up
|
|
2057
|
+
with different results even reading the same tokens. The arrangement itself (flex vs. grid vs.
|
|
2058
|
+
table, where the avatar sits, which edge a footer aligns to) stays with each variant or, where
|
|
2059
|
+
a property can't say it, a structural override. A `use-layout.page` is a `use-layout`, so the
|
|
2060
|
+
base pin/grow rules above already cover it too.
|
|
2061
|
+
|
|
2062
|
+
`.entry`, `.message` and `.media` set no container-level stacking gap: each region already pads
|
|
2063
|
+
its own block edges by the density's own gap, so that alone puts one gap's worth of room
|
|
2064
|
+
between two regions — a container `gap` on top would double-count it. `.page` and `.card` work
|
|
2065
|
+
the other way around instead: the host owns the entire inset itself — one `padding` for the
|
|
2066
|
+
true edges, one `gap` for the room between children — and a region carries no padding of its
|
|
2067
|
+
own at all, so there's nothing left to double-count.
|
|
2068
|
+
|
|
2069
|
+
The default, unclassed `use-layout` and `.page`/`.card` also take `.divided`, which rules every
|
|
2070
|
+
region off from the one before it — opt-in, not a default. Since those three already space
|
|
2071
|
+
their children with a real `gap`, `.divided` draws directly into it: `row-rule` (CSS Gap
|
|
2072
|
+
Decorations) natively decorates the gap on browsers that support it; everywhere else, each
|
|
2073
|
+
region gets its own padding back (the `gap` turns off) and a plain `border-block-start` does
|
|
2074
|
+
the dividing instead. `.entry`, `.message` and `.media` don't take `.divided` — they arrange
|
|
2075
|
+
their regions structurally instead of stacking them in one column, so a rule between them
|
|
2076
|
+
isn't a single boundary to draw.
|
|
2067
2077
|
|
|
2068
2078
|
`.entry` also takes `.compact`, which steps its own density down for a tighter repetition of
|
|
2069
2079
|
the same shape — a nav item rather than a list row. Each variant that supports it declares its
|
|
@@ -2094,6 +2104,7 @@
|
|
|
2094
2104
|
use-layout {
|
|
2095
2105
|
display: flex;
|
|
2096
2106
|
flex-direction: column;
|
|
2107
|
+
gap: var(--usewc-layout-region-gap, normal);
|
|
2097
2108
|
}
|
|
2098
2109
|
|
|
2099
2110
|
use-layout[inline] {
|
|
@@ -2144,30 +2155,6 @@
|
|
|
2144
2155
|
justify-content: space-around;
|
|
2145
2156
|
}
|
|
2146
2157
|
|
|
2147
|
-
use-layout[gap="xsmall"] {
|
|
2148
|
-
gap: var(--usewc-layout-flex-gap-xsmall);
|
|
2149
|
-
}
|
|
2150
|
-
|
|
2151
|
-
use-layout[gap="small"] {
|
|
2152
|
-
gap: var(--usewc-layout-flex-gap-small);
|
|
2153
|
-
}
|
|
2154
|
-
|
|
2155
|
-
use-layout[gap="medium"] {
|
|
2156
|
-
gap: var(--usewc-layout-flex-gap-medium);
|
|
2157
|
-
}
|
|
2158
|
-
|
|
2159
|
-
use-layout[gap="large"] {
|
|
2160
|
-
gap: var(--usewc-layout-flex-gap-large);
|
|
2161
|
-
}
|
|
2162
|
-
|
|
2163
|
-
use-layout[gap="xlarge"] {
|
|
2164
|
-
gap: var(--usewc-layout-flex-gap-xlarge);
|
|
2165
|
-
}
|
|
2166
|
-
|
|
2167
|
-
use-layout[gap="super"] {
|
|
2168
|
-
gap: var(--usewc-layout-flex-gap-super);
|
|
2169
|
-
}
|
|
2170
|
-
|
|
2171
2158
|
/* `padding`/`padding-block`/`padding-inline` step through their own named scale
|
|
2172
2159
|
(`--usewc-layout-flex-padding-*`), aliased in semantic.css to the same values as `gap`'s — the
|
|
2173
2160
|
same "how far apart do things sit" size either way, just read through a padding-named token
|
|
@@ -2332,82 +2319,119 @@
|
|
|
2332
2319
|
--usewc-layout-footer-justify: flex-start;
|
|
2333
2320
|
}
|
|
2334
2321
|
|
|
2335
|
-
/*
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
same padding as its neighbours so the rule between it and the next region doesn't run flush
|
|
2345
|
-
against the image. */
|
|
2346
|
-
use-layout:is(.page, .card).divided {
|
|
2347
|
-
& > * {
|
|
2348
|
-
padding-block: var(--usewc-layout-region-gap);
|
|
2349
|
-
}
|
|
2322
|
+
/* `gap`'s named scale lands in the same `--usewc-layout-region-gap` a variant's own density
|
|
2323
|
+
sets above, rather than a separate variable — one property, one source of truth, so an
|
|
2324
|
+
author's explicit `gap` on a variant reliably overrides its default instead of silently
|
|
2325
|
+
losing a specificity tie. Coming after "Variant density" in source is what makes that
|
|
2326
|
+
override direction work: same specificity as a variant class, later wins. The base
|
|
2327
|
+
`use-layout` rule reads whichever one landed here into the real `gap` property. */
|
|
2328
|
+
use-layout[gap="xsmall"] {
|
|
2329
|
+
--usewc-layout-region-gap: var(--usewc-layout-flex-gap-xsmall);
|
|
2330
|
+
}
|
|
2350
2331
|
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
}
|
|
2332
|
+
use-layout[gap="small"] {
|
|
2333
|
+
--usewc-layout-region-gap: var(--usewc-layout-flex-gap-small);
|
|
2354
2334
|
}
|
|
2355
2335
|
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
worth of breathing room apart without a container gap doubling it. That padding is no longer
|
|
2360
|
-
tag-gated — anything dropped directly into `.page`/`.card`, not only `header`/`main`/`footer`,
|
|
2361
|
-
gets the same inset, which is what lets any content live there. `figure` is excluded, since it
|
|
2362
|
-
bleeds to the container's own edge instead (see below).
|
|
2336
|
+
use-layout[gap="medium"] {
|
|
2337
|
+
--usewc-layout-region-gap: var(--usewc-layout-flex-gap-medium);
|
|
2338
|
+
}
|
|
2363
2339
|
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
isn't doubled with the host's. Both rules skip `:where()` so they reliably out-rank the
|
|
2367
|
-
per-tag padding on `header`/`footer`/`use-layout[fill]` above regardless of source order — the
|
|
2368
|
-
same trick `.flush` already relies on below. */
|
|
2369
|
-
:where(use-layout:is(.page, .card)) > :not(figure) {
|
|
2370
|
-
padding-inline: var(--usewc-layout-region-padding);
|
|
2371
|
-
padding-block: var(--usewc-layout-region-gap);
|
|
2340
|
+
use-layout[gap="large"] {
|
|
2341
|
+
--usewc-layout-region-gap: var(--usewc-layout-flex-gap-large);
|
|
2372
2342
|
}
|
|
2373
2343
|
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
not only `main`/`use-layout[fill]`, so a plain `<div>` or `<ul>` dropped in directly gets the
|
|
2377
|
-
same treatment — its own first/last child sheds the block margin that would otherwise stack
|
|
2378
|
-
on top of the region's padding. */
|
|
2379
|
-
:where(use-layout:is(.page, .card)) > :not(figure) > :first-child {
|
|
2380
|
-
margin-block-start: 0;
|
|
2344
|
+
use-layout[gap="xlarge"] {
|
|
2345
|
+
--usewc-layout-region-gap: var(--usewc-layout-flex-gap-xlarge);
|
|
2381
2346
|
}
|
|
2382
2347
|
|
|
2383
|
-
|
|
2384
|
-
|
|
2348
|
+
use-layout[gap="super"] {
|
|
2349
|
+
--usewc-layout-region-gap: var(--usewc-layout-flex-gap-super);
|
|
2385
2350
|
}
|
|
2386
2351
|
|
|
2352
|
+
/* `.page` and `.card` own their entire inset on the host itself — one `padding` for the true
|
|
2353
|
+
edges, the base rule's own `gap` (above) for the room between children — rather than each
|
|
2354
|
+
child padding its own block edges and the first/last shedding the half that would double up
|
|
2355
|
+
with the host's. A region carries no padding of its own any more (below), so nothing here is
|
|
2356
|
+
tag-gated: whatever lands directly in `.page`/`.card`, not only `header`/`main`/`footer`,
|
|
2357
|
+
gets the same inset for free by virtue of sitting inside the host's own box. */
|
|
2387
2358
|
use-layout:is(.page, .card) {
|
|
2388
|
-
padding
|
|
2359
|
+
padding: var(--usewc-layout-region-gap) var(--usewc-layout-region-padding);
|
|
2389
2360
|
}
|
|
2390
2361
|
|
|
2391
|
-
|
|
2392
|
-
|
|
2362
|
+
/* Zeroes what the generic region rules above put on `header`/`main`/`footer`/`use-layout[fill]`,
|
|
2363
|
+
and reaches a plain, unnamed child the same way — the host's own padding and gap already do
|
|
2364
|
+
that job now. `figure` is excluded: it never had padding to zero, since it bleeds past the
|
|
2365
|
+
host's inset instead (below) rather than sitting inside it. */
|
|
2366
|
+
use-layout:is(.page, .card) > :not(figure) {
|
|
2367
|
+
padding: 0;
|
|
2393
2368
|
}
|
|
2394
2369
|
|
|
2395
|
-
|
|
2396
|
-
|
|
2370
|
+
/* A `<figure>` bleeds past the host's own inset on every edge it touches — the full inline
|
|
2371
|
+
width always, since nothing else pads it back in from the sides now that the host carries
|
|
2372
|
+
inline padding too; the block edges only when it's first or last, the same way it always has.
|
|
2373
|
+
`.divided` (below) is excluded: a divided figure sits inset like any other region instead of
|
|
2374
|
+
bleeding past the rule that would otherwise land on it. `.flush` already zeroes the host's
|
|
2375
|
+
own padding, so there is nothing left to pull out of either way.
|
|
2376
|
+
|
|
2377
|
+
Skips `:where()`, unlike the rules around it: the generic region block further down sets a
|
|
2378
|
+
flat `margin: 0` on every variant's `figure` at the same specificity a `:where()`-wrapped
|
|
2379
|
+
selector would carry, and being later in source it would otherwise win. Out-specifying it on
|
|
2380
|
+
purpose is the same trick `.flush` already relies on above. */
|
|
2381
|
+
use-layout:is(.page, .card):not(.divided):not(.flush) > figure {
|
|
2382
|
+
margin-inline: calc(var(--usewc-layout-region-padding) * -1);
|
|
2397
2383
|
}
|
|
2398
2384
|
|
|
2399
|
-
|
|
2400
|
-
with a matching negative margin, the same way it always has. `.divided` opts every region,
|
|
2401
|
-
figure included, into the same padding as its neighbours instead (above), so it's excluded
|
|
2402
|
-
here; `.flush` already zeroes the host's own padding, so there is nothing left to pull out of. */
|
|
2403
|
-
:where(use-layout:is(.page, .card):not(.divided):not(.flush)) > figure:first-child {
|
|
2385
|
+
use-layout:is(.page, .card):not(.divided):not(.flush) > figure:first-child {
|
|
2404
2386
|
margin-block-start: calc(var(--usewc-layout-region-gap) * -1);
|
|
2405
2387
|
}
|
|
2406
2388
|
|
|
2407
|
-
|
|
2389
|
+
use-layout:is(.page, .card):not(.divided):not(.flush) > figure:last-child {
|
|
2408
2390
|
margin-block-end: calc(var(--usewc-layout-region-gap) * -1);
|
|
2409
2391
|
}
|
|
2410
2392
|
|
|
2393
|
+
/* `.divided` rules a region off from the one before it by position, not by tag — so a
|
|
2394
|
+
`<figure>`, an author's own `<section>`, or any other stand-in divides exactly like
|
|
2395
|
+
`header`/`main`/`footer` do, with nothing to name per tag. It only makes sense on the plain
|
|
2396
|
+
stacking shapes — the default, unclassed `use-layout` and `.page`/`.card` — where "the next
|
|
2397
|
+
region" is unambiguous; `.entry`, `.message` and `.media` arrange their regions structurally
|
|
2398
|
+
instead, so a rule between them isn't a single boundary to draw.
|
|
2399
|
+
|
|
2400
|
+
The rule is drawn *in* the gap on browsers that support `row-rule` (CSS Gap Decorations), so
|
|
2401
|
+
`.divided` needs no model of its own there: it's the same host `padding`/`gap` as undivided
|
|
2402
|
+
(the base rule's own `gap` reads `--usewc-layout-region-gap` regardless of whether it came
|
|
2403
|
+
from the `gap` attribute or a variant's own density), just with `row-rule` decorating it.
|
|
2404
|
+
|
|
2405
|
+
Everywhere else, a generated pseudo-element standing in for the gap doesn't hold up: a
|
|
2406
|
+
`use-layout[fill]` region (the scrolling body of a page, say) has its own `overflow: auto`,
|
|
2407
|
+
which scrolls and clips any pseudo generated *on* it right along with the rest of its
|
|
2408
|
+
content — there's no positioning trick that both lives inside that region and stays put
|
|
2409
|
+
against its own scrolling. So the fallback reaches for the one thing that's neither a
|
|
2410
|
+
scrollable descendant nor a flex item of the region it's drawn on: a real
|
|
2411
|
+
`border-block-start`, on the region's own box rather than a pseudo tucked inside it. That
|
|
2412
|
+
needs a region to have padding again to keep the rule off its content, which means turning
|
|
2413
|
+
the container `gap` back off — the same shape `.divided` had before this file started
|
|
2414
|
+
spending it at the host level. */
|
|
2415
|
+
@supports (row-rule-style: solid) {
|
|
2416
|
+
use-layout.divided:not(.entry):not(.message):not(.media) {
|
|
2417
|
+
row-rule: var(--usewc-layout-region-rule);
|
|
2418
|
+
}
|
|
2419
|
+
}
|
|
2420
|
+
|
|
2421
|
+
@supports not (row-rule-style: solid) {
|
|
2422
|
+
use-layout.divided:not(.entry):not(.message):not(.media) {
|
|
2423
|
+
gap: 0;
|
|
2424
|
+
|
|
2425
|
+
& > * {
|
|
2426
|
+
padding-block: var(--usewc-layout-region-gap, 0px);
|
|
2427
|
+
}
|
|
2428
|
+
|
|
2429
|
+
& > :not(:first-child) {
|
|
2430
|
+
border-block-start: var(--usewc-layout-region-rule);
|
|
2431
|
+
}
|
|
2432
|
+
}
|
|
2433
|
+
}
|
|
2434
|
+
|
|
2411
2435
|
/* `.flush` zeroes a use-layout's own outer inset. Inline padding is one token consumed
|
|
2412
2436
|
everywhere it's set (every region, and the container itself for `.entry`/`.message`/`.media`),
|
|
2413
2437
|
so overriding it here reaches all of them at once regardless of variant. Block padding comes
|
|
@@ -2432,39 +2456,13 @@
|
|
|
2432
2456
|
padding-block-end: 0;
|
|
2433
2457
|
}
|
|
2434
2458
|
|
|
2435
|
-
/* ──
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
:where(use-layout:is(.page, .
|
|
2459
|
+
/* ── Regions: .page / .card ─────────────────────────────────────────────────────────────────
|
|
2460
|
+
Header/footer content is a flex row of its own — an avatar or icon-like figure squared to
|
|
2461
|
+
the variant's avatar size, an `hgroup` growing to fill the rest, a trailing action or two —
|
|
2462
|
+
independent of the outer inset, which the host itself owns (above). Neither gets its own
|
|
2463
|
+
padding here: that's the whole point of the host owning it instead. */
|
|
2464
|
+
:where(use-layout:is(.page, .card)) {
|
|
2441
2465
|
min-block-size: 0;
|
|
2442
|
-
gap: var(--usewc-layout-region-row-gap);
|
|
2443
|
-
|
|
2444
|
-
& > use-layout[fill] {
|
|
2445
|
-
padding-inline: var(--usewc-layout-region-padding);
|
|
2446
|
-
padding-block: var(--usewc-layout-region-gap);
|
|
2447
|
-
}
|
|
2448
|
-
|
|
2449
|
-
& > main {
|
|
2450
|
-
padding-inline: var(--usewc-layout-region-padding);
|
|
2451
|
-
padding-block: var(--usewc-layout-region-gap);
|
|
2452
|
-
}
|
|
2453
|
-
|
|
2454
|
-
/* The region owns its outer spacing, so the first and last things in it shed the block
|
|
2455
|
-
margins they'd otherwise stack on top of the padding — a leading `<p>`, `<ul>`, `<ol>` or
|
|
2456
|
-
heading would otherwise push itself away from an edge that's already spaced. Matched by
|
|
2457
|
-
position rather than by tag so it holds for whatever flow content lands there. Tag-gated to
|
|
2458
|
-
`main`/`use-layout[fill]` here since `.entry`/`.message`/`.media` don't accept arbitrary
|
|
2459
|
-
content as a region the way `.page`/`.card` do — those two get the same treatment
|
|
2460
|
-
generalized to any non-`figure` child, above, alongside the padding it's paired with. */
|
|
2461
|
-
& > :is(main, use-layout[fill]) > :first-child {
|
|
2462
|
-
margin-block-start: 0;
|
|
2463
|
-
}
|
|
2464
|
-
|
|
2465
|
-
& > :is(main, use-layout[fill]) > :last-child {
|
|
2466
|
-
margin-block-end: 0;
|
|
2467
|
-
}
|
|
2468
2466
|
|
|
2469
2467
|
& > figure {
|
|
2470
2468
|
margin: 0;
|
|
@@ -2482,8 +2480,6 @@
|
|
|
2482
2480
|
align-items: center;
|
|
2483
2481
|
justify-content: flex-start;
|
|
2484
2482
|
gap: var(--usewc-layout-region-gap);
|
|
2485
|
-
padding-inline: var(--usewc-layout-region-padding);
|
|
2486
|
-
padding-block: var(--usewc-layout-region-gap);
|
|
2487
2483
|
}
|
|
2488
2484
|
|
|
2489
2485
|
& > footer {
|
|
@@ -2491,15 +2487,12 @@
|
|
|
2491
2487
|
align-items: center;
|
|
2492
2488
|
justify-content: var(--usewc-layout-footer-justify, flex-end);
|
|
2493
2489
|
gap: var(--usewc-layout-region-gap);
|
|
2494
|
-
padding-inline: var(--usewc-layout-region-padding);
|
|
2495
|
-
padding-block: var(--usewc-layout-region-gap);
|
|
2496
2490
|
}
|
|
2497
2491
|
|
|
2498
2492
|
/* A header's leading likeness is a `use-avatar` or a `<figure>` — no `img.avatar`
|
|
2499
2493
|
convention, since a bare `<img>` in a header is as likely to be a logo as a face, and a
|
|
2500
2494
|
class would have to be remembered where the element already says it. Both are squared to
|
|
2501
|
-
the variant's avatar size; a `<figure>` centres whatever it holds
|
|
2502
|
-
message rail does. */
|
|
2495
|
+
the variant's avatar size; a `<figure>` centres whatever it holds. */
|
|
2503
2496
|
& > header > :is(use-avatar, figure) {
|
|
2504
2497
|
flex: none;
|
|
2505
2498
|
inline-size: var(--usewc-layout-region-avatar-size);
|
|
@@ -2578,6 +2571,212 @@
|
|
|
2578
2571
|
}
|
|
2579
2572
|
}
|
|
2580
2573
|
|
|
2574
|
+
/* ── Regions: .entry / .message ─────────────────────────────────────────────────────────────
|
|
2575
|
+
Same header/footer/hgroup treatment as `.page`/`.card`, minus the two things their own
|
|
2576
|
+
shape already covers elsewhere: `header`/`main`/`footer` take no padding of their own here
|
|
2577
|
+
either (the structural rules below own the inset), and `main`/`use-layout[fill]`'s own
|
|
2578
|
+
first/last child still sheds the block margin that would otherwise stack on top of it. */
|
|
2579
|
+
:where(use-layout:is(.entry, .message)) {
|
|
2580
|
+
min-block-size: 0;
|
|
2581
|
+
gap: var(--usewc-layout-region-row-gap);
|
|
2582
|
+
|
|
2583
|
+
& > :is(main, use-layout[fill]) > :first-child {
|
|
2584
|
+
margin-block-start: 0;
|
|
2585
|
+
}
|
|
2586
|
+
|
|
2587
|
+
& > :is(main, use-layout[fill]) > :last-child {
|
|
2588
|
+
margin-block-end: 0;
|
|
2589
|
+
}
|
|
2590
|
+
|
|
2591
|
+
& > figure {
|
|
2592
|
+
margin: 0;
|
|
2593
|
+
}
|
|
2594
|
+
|
|
2595
|
+
& > figure > img {
|
|
2596
|
+
display: block;
|
|
2597
|
+
inline-size: 100%;
|
|
2598
|
+
block-size: auto;
|
|
2599
|
+
object-fit: cover;
|
|
2600
|
+
}
|
|
2601
|
+
|
|
2602
|
+
& > header {
|
|
2603
|
+
display: flex;
|
|
2604
|
+
align-items: center;
|
|
2605
|
+
justify-content: flex-start;
|
|
2606
|
+
gap: var(--usewc-layout-region-gap);
|
|
2607
|
+
}
|
|
2608
|
+
|
|
2609
|
+
& > footer {
|
|
2610
|
+
display: flex;
|
|
2611
|
+
align-items: center;
|
|
2612
|
+
justify-content: var(--usewc-layout-footer-justify, flex-end);
|
|
2613
|
+
gap: var(--usewc-layout-region-gap);
|
|
2614
|
+
}
|
|
2615
|
+
|
|
2616
|
+
& > header > :is(use-avatar, figure) {
|
|
2617
|
+
flex: none;
|
|
2618
|
+
inline-size: var(--usewc-layout-region-avatar-size);
|
|
2619
|
+
block-size: var(--usewc-layout-region-avatar-size);
|
|
2620
|
+
border-radius: var(--usewc-effect-surface-avatar-border-radius);
|
|
2621
|
+
overflow: hidden;
|
|
2622
|
+
}
|
|
2623
|
+
|
|
2624
|
+
& > header > figure {
|
|
2625
|
+
display: flex;
|
|
2626
|
+
align-items: center;
|
|
2627
|
+
justify-content: center;
|
|
2628
|
+
margin-inline: 0;
|
|
2629
|
+
font-size: calc(var(--usewc-layout-region-avatar-size) * 0.4);
|
|
2630
|
+
line-height: 1;
|
|
2631
|
+
}
|
|
2632
|
+
|
|
2633
|
+
& > header > figure > img {
|
|
2634
|
+
inline-size: 100%;
|
|
2635
|
+
block-size: 100%;
|
|
2636
|
+
object-fit: cover;
|
|
2637
|
+
}
|
|
2638
|
+
|
|
2639
|
+
& > :is(header, footer) hgroup {
|
|
2640
|
+
display: flex;
|
|
2641
|
+
flex-direction: column;
|
|
2642
|
+
gap: var(--usewc-layout-region-title-gap);
|
|
2643
|
+
min-inline-size: 0;
|
|
2644
|
+
}
|
|
2645
|
+
|
|
2646
|
+
& > header > hgroup {
|
|
2647
|
+
flex: 1;
|
|
2648
|
+
}
|
|
2649
|
+
|
|
2650
|
+
& > :is(header, footer) hgroup > * {
|
|
2651
|
+
line-height: max(var(--usewc-layout-region-title-line-height), 1.25em);
|
|
2652
|
+
}
|
|
2653
|
+
|
|
2654
|
+
& > :is(header, footer) hgroup > * + * {
|
|
2655
|
+
font-size: var(--usewc-font-region-subtitle-size);
|
|
2656
|
+
line-height: var(--usewc-layout-region-subtitle-line-height);
|
|
2657
|
+
color: var(--usewc-color-document-text-muted);
|
|
2658
|
+
}
|
|
2659
|
+
|
|
2660
|
+
& > :is(header, footer) > *,
|
|
2661
|
+
& > :is(header, footer) hgroup > *,
|
|
2662
|
+
& > :is(header, footer) :is(h1, h2, h3, h4, h5, h6) {
|
|
2663
|
+
margin-block: 0;
|
|
2664
|
+
}
|
|
2665
|
+
|
|
2666
|
+
& > :is(header, footer) > section {
|
|
2667
|
+
display: flex;
|
|
2668
|
+
align-items: center;
|
|
2669
|
+
gap: var(--usewc-layout-region-gap);
|
|
2670
|
+
}
|
|
2671
|
+
|
|
2672
|
+
& > :is(header, footer):has(> section ~ section) {
|
|
2673
|
+
justify-content: space-between;
|
|
2674
|
+
}
|
|
2675
|
+
}
|
|
2676
|
+
|
|
2677
|
+
/* ── Regions: .media ────────────────────────────────────────────────────────────────────────
|
|
2678
|
+
Same header/footer/hgroup treatment again, adapted to the one thing `.media` does
|
|
2679
|
+
differently: any non-rail child is a region, not just `header`/`main`/`footer` (its own
|
|
2680
|
+
structural rule below reads by position, not by tag), so nothing here needs its own padding
|
|
2681
|
+
either — that's already zeroed generically there. */
|
|
2682
|
+
:where(use-layout.media) {
|
|
2683
|
+
min-block-size: 0;
|
|
2684
|
+
gap: var(--usewc-layout-region-row-gap);
|
|
2685
|
+
|
|
2686
|
+
& > :is(main, use-layout[fill]) > :first-child {
|
|
2687
|
+
margin-block-start: 0;
|
|
2688
|
+
}
|
|
2689
|
+
|
|
2690
|
+
& > :is(main, use-layout[fill]) > :last-child {
|
|
2691
|
+
margin-block-end: 0;
|
|
2692
|
+
}
|
|
2693
|
+
|
|
2694
|
+
& > figure {
|
|
2695
|
+
margin: 0;
|
|
2696
|
+
}
|
|
2697
|
+
|
|
2698
|
+
& > figure > img {
|
|
2699
|
+
display: block;
|
|
2700
|
+
inline-size: 100%;
|
|
2701
|
+
block-size: auto;
|
|
2702
|
+
object-fit: cover;
|
|
2703
|
+
}
|
|
2704
|
+
|
|
2705
|
+
& > header {
|
|
2706
|
+
display: flex;
|
|
2707
|
+
align-items: center;
|
|
2708
|
+
justify-content: flex-start;
|
|
2709
|
+
gap: var(--usewc-layout-region-gap);
|
|
2710
|
+
}
|
|
2711
|
+
|
|
2712
|
+
& > footer {
|
|
2713
|
+
display: flex;
|
|
2714
|
+
align-items: center;
|
|
2715
|
+
justify-content: var(--usewc-layout-footer-justify, flex-end);
|
|
2716
|
+
gap: var(--usewc-layout-region-gap);
|
|
2717
|
+
}
|
|
2718
|
+
|
|
2719
|
+
& > header > :is(use-avatar, figure) {
|
|
2720
|
+
flex: none;
|
|
2721
|
+
inline-size: var(--usewc-layout-region-avatar-size);
|
|
2722
|
+
block-size: var(--usewc-layout-region-avatar-size);
|
|
2723
|
+
border-radius: var(--usewc-effect-surface-avatar-border-radius);
|
|
2724
|
+
overflow: hidden;
|
|
2725
|
+
}
|
|
2726
|
+
|
|
2727
|
+
& > header > figure {
|
|
2728
|
+
display: flex;
|
|
2729
|
+
align-items: center;
|
|
2730
|
+
justify-content: center;
|
|
2731
|
+
margin-inline: 0;
|
|
2732
|
+
font-size: calc(var(--usewc-layout-region-avatar-size) * 0.4);
|
|
2733
|
+
line-height: 1;
|
|
2734
|
+
}
|
|
2735
|
+
|
|
2736
|
+
& > header > figure > img {
|
|
2737
|
+
inline-size: 100%;
|
|
2738
|
+
block-size: 100%;
|
|
2739
|
+
object-fit: cover;
|
|
2740
|
+
}
|
|
2741
|
+
|
|
2742
|
+
& > :is(header, footer) hgroup {
|
|
2743
|
+
display: flex;
|
|
2744
|
+
flex-direction: column;
|
|
2745
|
+
gap: var(--usewc-layout-region-title-gap);
|
|
2746
|
+
min-inline-size: 0;
|
|
2747
|
+
}
|
|
2748
|
+
|
|
2749
|
+
& > header > hgroup {
|
|
2750
|
+
flex: 1;
|
|
2751
|
+
}
|
|
2752
|
+
|
|
2753
|
+
& > :is(header, footer) hgroup > * {
|
|
2754
|
+
line-height: max(var(--usewc-layout-region-title-line-height), 1.25em);
|
|
2755
|
+
}
|
|
2756
|
+
|
|
2757
|
+
& > :is(header, footer) hgroup > * + * {
|
|
2758
|
+
font-size: var(--usewc-font-region-subtitle-size);
|
|
2759
|
+
line-height: var(--usewc-layout-region-subtitle-line-height);
|
|
2760
|
+
color: var(--usewc-color-document-text-muted);
|
|
2761
|
+
}
|
|
2762
|
+
|
|
2763
|
+
& > :is(header, footer) > *,
|
|
2764
|
+
& > :is(header, footer) hgroup > *,
|
|
2765
|
+
& > :is(header, footer) :is(h1, h2, h3, h4, h5, h6) {
|
|
2766
|
+
margin-block: 0;
|
|
2767
|
+
}
|
|
2768
|
+
|
|
2769
|
+
& > :is(header, footer) > section {
|
|
2770
|
+
display: flex;
|
|
2771
|
+
align-items: center;
|
|
2772
|
+
gap: var(--usewc-layout-region-gap);
|
|
2773
|
+
}
|
|
2774
|
+
|
|
2775
|
+
& > :is(header, footer):has(> section ~ section) {
|
|
2776
|
+
justify-content: space-between;
|
|
2777
|
+
}
|
|
2778
|
+
}
|
|
2779
|
+
|
|
2581
2780
|
/* ── Structural overrides ───────────────────────────────────────────────────────────────────
|
|
2582
2781
|
The arrangements a density property can't express. Same `:where()` weight as the generic
|
|
2583
2782
|
rules, winning on source order. */
|
|
@@ -2608,7 +2807,6 @@
|
|
|
2608
2807
|
|
|
2609
2808
|
:where(use-layout:is(.entry, .message)) > :is(header, main, footer) {
|
|
2610
2809
|
grid-column: 2;
|
|
2611
|
-
padding: 0;
|
|
2612
2810
|
}
|
|
2613
2811
|
|
|
2614
2812
|
:where(use-layout.message) > footer {
|
package/dist/tokens.css
CHANGED
|
@@ -757,8 +757,8 @@
|
|
|
757
757
|
--usewc-layout-page-gap: var(--usewc-space-12);
|
|
758
758
|
--usewc-layout-page-avatar-size: var(--usewc-layout-region-title-block-size);
|
|
759
759
|
|
|
760
|
-
--usewc-layout-card-padding: var(--usewc-space-
|
|
761
|
-
--usewc-layout-card-gap: var(--usewc-space-
|
|
760
|
+
--usewc-layout-card-padding: var(--usewc-space-16);
|
|
761
|
+
--usewc-layout-card-gap: var(--usewc-space-10);
|
|
762
762
|
--usewc-layout-card-avatar-size: var(--usewc-layout-region-title-block-size);
|
|
763
763
|
|
|
764
764
|
/* Avatar sizes match a base button's 36px height, so a likeness and the controls beside it in
|