shelving 1.322.2 → 1.322.3

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.
@@ -21461,7 +21461,7 @@ A boxed surface that groups a self-contained piece of content. Rendered as an `<
21461
21461
  **Things to know:**
21462
21462
 
21463
21463
  - Set `href` or `onClick` to make the whole card navigable — a stretched, visually-hidden overlay `<a>` / `<button>` covers the card while the children render normally inside. Real interactive elements inside the card (inline links, buttons) stay clickable and keyboard-focusable.
21464
- - The overlay sits at `z-index: 1`, and the links and buttons inside the card at `z-index: 2`. To put your own absolute layer over the card's content, put it after the content, with no `z-index` and no lasting `transform`. The links and buttons inside it are then lifted above the overlay too. A `transform` makes the layer a stacking context below the overlay. A high `z-index` works, but iOS WebKit can drop that layer for one frame when a page view transition starts.
21464
+ - The overlay comes first in the card and has no `z-index`. Links and buttons inside the card are `position: relative`, so they paint above it and stay clickable. To put your own absolute layer over the card's content, put it after the content, with no `z-index` and no lasting `transform`. A `transform` makes the layer a stacking context, and a `z-index` can make iOS WebKit drop the layer for one frame when a page view transition starts. Only a keyboard-focused overlay gets a `z-index`, so its focus ring shows above the content.
21465
21465
  - `color=` and `status=` move the tint anchor for the card's scope, so the surface, text, and hover shade all re-derive together — and nested components (`<Tag>`, `<Preformatted>`, `<Button>`) inherit the same tint.
21466
21466
  - A card styles only the box. Lay out its contents with the usual block components (`<Subheading>`, `<Paragraph>`, `<Row>`, …).
21467
21467
  - Cards have no drop shadow by default — set `shadow="small"`, `shadow="normal"` or `shadow="large"` to raise a given card.
package/docs/ui/Card.md CHANGED
@@ -15,7 +15,7 @@ A boxed surface that groups a self-contained piece of content. Rendered as an `<
15
15
  **Things to know:**
16
16
 
17
17
  - Set `href` or `onClick` to make the whole card navigable — a stretched, visually-hidden overlay `<a>` / `<button>` covers the card while the children render normally inside. Real interactive elements inside the card (inline links, buttons) stay clickable and keyboard-focusable.
18
- - The overlay sits at `z-index: 1`, and the links and buttons inside the card at `z-index: 2`. To put your own absolute layer over the card's content, put it after the content, with no `z-index` and no lasting `transform`. The links and buttons inside it are then lifted above the overlay too. A `transform` makes the layer a stacking context below the overlay. A high `z-index` works, but iOS WebKit can drop that layer for one frame when a page view transition starts.
18
+ - The overlay comes first in the card and has no `z-index`. Links and buttons inside the card are `position: relative`, so they paint above it and stay clickable. To put your own absolute layer over the card's content, put it after the content, with no `z-index` and no lasting `transform`. A `transform` makes the layer a stacking context, and a `z-index` can make iOS WebKit drop the layer for one frame when a page view transition starts. Only a keyboard-focused overlay gets a `z-index`, so its focus ring shows above the content.
19
19
  - `color=` and `status=` move the tint anchor for the card's scope, so the surface, text, and hover shade all re-derive together — and nested components (`<Tag>`, `<Preformatted>`, `<Button>`) inherit the same tint.
20
20
  - A card styles only the box. Lay out its contents with the usual block components (`<Subheading>`, `<Paragraph>`, `<Row>`, …).
21
21
  - Cards have no drop shadow by default — set `shadow="small"`, `shadow="normal"` or `shadow="large"` to raise a given card.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shelving",
3
- "version": "1.322.2",
3
+ "version": "1.322.3",
4
4
  "author": "Dave Houlbrooke <dave@shax.com>",
5
5
  "repository": {
6
6
  "type": "git",
package/ui/block/Card.md CHANGED
@@ -5,7 +5,7 @@ A boxed surface that groups a self-contained piece of content. Rendered as an `<
5
5
  **Things to know:**
6
6
 
7
7
  - Set `href` or `onClick` to make the whole card navigable — a stretched, visually-hidden overlay `<a>` / `<button>` covers the card while the children render normally inside. Real interactive elements inside the card (inline links, buttons) stay clickable and keyboard-focusable.
8
- - The overlay sits at `z-index: 1`, and the links and buttons inside the card at `z-index: 2`. To put your own absolute layer over the card's content, put it after the content, with no `z-index` and no lasting `transform`. The links and buttons inside it are then lifted above the overlay too. A `transform` makes the layer a stacking context below the overlay. A high `z-index` works, but iOS WebKit can drop that layer for one frame when a page view transition starts.
8
+ - The overlay comes first in the card and has no `z-index`. Links and buttons inside the card are `position: relative`, so they paint above it and stay clickable. To put your own absolute layer over the card's content, put it after the content, with no `z-index` and no lasting `transform`. A `transform` makes the layer a stacking context, and a `z-index` can make iOS WebKit drop the layer for one frame when a page view transition starts. Only a keyboard-focused overlay gets a `z-index`, so its focus ring shows above the content.
9
9
  - `color=` and `status=` move the tint anchor for the card's scope, so the surface, text, and hover shade all re-derive together — and nested components (`<Tag>`, `<Preformatted>`, `<Button>`) inherit the same tint.
10
10
  - A card styles only the box. Lay out its contents with the usual block components (`<Subheading>`, `<Paragraph>`, `<Row>`, …).
11
11
  - Cards have no drop shadow by default — set `shadow="small"`, `shadow="normal"` or `shadow="large"` to raise a given card.
@@ -8,11 +8,11 @@
8
8
 
9
9
  @layer defaults {
10
10
  .card {
11
- /* Children — lift above the overlay so they remain clickable. */
11
+ /* Children — positioned, and after the overlay, so they paint above it and stay clickable.
12
+ * No z-index: iOS WebKit can drop a z-indexed layer for one frame when a page view transition starts. */
12
13
  a:any-link,
13
14
  button:enabled {
14
15
  position: relative;
15
- z-index: 2;
16
16
  }
17
17
  }
18
18
  }
@@ -44,9 +44,10 @@
44
44
  /* Under `.card` so it beats the `.prose a` link rule, and the hidden link text stays hidden inside `<Prose>`. */
45
45
  .card > .overlay {
46
46
  /* Box */
47
+
48
+ /* First in the card, positioned, with no z-index: it paints above the card's text, and below its positioned links and buttons. */
47
49
  position: absolute;
48
50
  inset: 0;
49
- z-index: 1;
50
51
  border: 0;
51
52
  border-radius: inherit;
52
53
 
@@ -54,7 +55,7 @@
54
55
  background: transparent;
55
56
  cursor: pointer;
56
57
 
57
- /* Focus ring — drawn on the overlay so it paints above positioned children (e.g. `.panel`). The offset pushes it out over the card border, so it sits fully inside the card edge. */
58
+ /* Focus ring — drawn on the overlay. The offset pushes it out over the card border, so it sits fully inside the card edge. */
58
59
  outline: var(--card-focus-border, var(--stroke-focus) solid var(--color-focus));
59
60
  outline-offset: calc(var(--card-stroke, 0px) - var(--stroke-focus));
60
61
 
@@ -70,9 +71,13 @@
70
71
 
71
72
  @layer overrides {
72
73
  .card > .overlay {
73
- /* Show the focus ring only while the overlay is keyboard-focused. */
74
+ /* Show the focus ring only while the overlay is keyboard-focused. Then lift it, so the ring paints above positioned children (e.g. `.panel`). */
74
75
  &:not(:focus-visible) {
75
76
  outline-color: transparent;
76
77
  }
78
+
79
+ &:focus-visible {
80
+ z-index: 3;
81
+ }
77
82
  }
78
83
  }