shelving 1.295.2 → 1.295.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shelving",
3
- "version": "1.295.2",
3
+ "version": "1.295.3",
4
4
  "author": "Dave Houlbrooke <dave@shax.com>",
5
5
  "repository": {
6
6
  "type": "git",
@@ -22,13 +22,13 @@
22
22
  }
23
23
  }
24
24
 
25
- /* A new notice slides in from the right. */
26
- ::view-transition-new(.notice) {
25
+ /* A new notice slides in from the right. `:only-child` stops Safari from also starting the animation on the missing image, which stops it later on the real one (see `FadeTransition.css`). */
26
+ ::view-transition-new(.notice):only-child {
27
27
  animation: notice-from-right var(--notices-transition-duration) ease-out both;
28
28
  }
29
29
 
30
30
  /* A closed notice slides out to the right. */
31
- ::view-transition-old(.notice) {
31
+ ::view-transition-old(.notice):only-child {
32
32
  animation: notice-from-right var(--notices-transition-duration) ease-in reverse both;
33
33
  }
34
34
 
@@ -56,8 +56,8 @@
56
56
 
57
57
  /* Reduced motion: fade new and closed notices in place, and move the others at once. */
58
58
  @media (prefers-reduced-motion: reduce) {
59
- ::view-transition-new(.notice),
60
- ::view-transition-old(.notice) {
59
+ ::view-transition-new(.notice):only-child,
60
+ ::view-transition-old(.notice):only-child {
61
61
  animation-name: notice-fade;
62
62
  }
63
63
 
@@ -18,17 +18,26 @@
18
18
  }
19
19
  }
20
20
 
21
- ::view-transition-new(.fade) {
21
+ /*
22
+ * Enter and exit: an image with no partner fades in or out.
23
+ * - `:only-child` is necessary. Without it, Safari also starts the animation on the missing image (for example `fade-out` on the old image when the element enters). Then it does not start that animation again on the same image name, so the element does not fade out when it leaves.
24
+ */
25
+ ::view-transition-new(.fade):only-child {
22
26
  animation: fade-in var(--fade-transition-duration, var(--duration-fast)) ease-in-out both;
23
27
  }
24
28
 
25
- ::view-transition-old(.fade) {
29
+ ::view-transition-old(.fade):only-child {
26
30
  animation: fade-out var(--fade-transition-duration, var(--duration-fast)) ease-in-out both;
27
31
  }
28
32
 
29
- /* Reduced motion: keep the opacity-only crossfade — a fade moves nothing spatially, so it is reduced-motion-safe — but disable the group's default positional morph so content never slides between layouts. */
33
+ /* Update: the old and new images use the browser's own crossfade. Its images take their duration from the group. */
34
+ ::view-transition-group(.fade) {
35
+ animation-duration: var(--fade-transition-duration, var(--duration-fast));
36
+ }
37
+
38
+ /* Reduced motion: keep the opacity-only crossfade — a fade moves nothing spatially, so it is reduced-motion-safe — but disable the group's default positional morph so content never slides between layouts. Only the name is removed, so the images keep the group's duration. */
30
39
  @media (prefers-reduced-motion: reduce) {
31
40
  ::view-transition-group(.fade) {
32
- animation: none;
41
+ animation-name: none;
33
42
  }
34
43
  }
@@ -26,6 +26,6 @@ function Panel({ visible }: { visible: boolean }) {
26
26
 
27
27
  | Variable | Styles | Default |
28
28
  |---|---|---|
29
- | `--fade-transition-duration` | Duration of the fade-in and fade-out keyframes | `var(--duration-fast)` |
29
+ | `--fade-transition-duration` | Duration of the fade in, the fade out, and the crossfade when content changes in place (also the group's size and position morph) | `var(--duration-fast)` |
30
30
 
31
31
  **Global tokens it reads** — `--duration-fast`.