@adrienlcp/styles 0.3.0 → 0.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/README.md +1 -1
- package/package.json +1 -1
- package/src/reduced-motion.css +7 -0
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@ pnpm add @adrienlcp/styles
|
|
|
14
14
|
| File | Does |
|
|
15
15
|
| --- | --- |
|
|
16
16
|
| `reset.css` | Box sizing, zeroed margins and paddings, inherited fonts on controls, bare buttons and lists, balanced headings, pretty paragraphs, and `interpolate-size: allow-keywords` so a transition reaches `height: auto` (Chromium; elsewhere the size snaps as before). Inside `@layer reset` |
|
|
17
|
-
| `reduced-motion.css` | Collapses `--transition-fast`, `--transition-base` and `--transition-slow` to `0ms` under `prefers-reduced-motion: reduce
|
|
17
|
+
| `reduced-motion.css` | Collapses `--transition-fast`, `--transition-base` and `--transition-slow` to `0ms` under `prefers-reduced-motion: reduce`, and stills view transitions, which React's `<ViewTransition>` starts whatever the preference. Unlayered, so it beats the tokens wherever they are defined |
|
|
18
18
|
|
|
19
19
|
Import them once — from JavaScript, or from the global stylesheet in Sass:
|
|
20
20
|
|
package/package.json
CHANGED
package/src/reduced-motion.css
CHANGED
|
@@ -5,4 +5,11 @@
|
|
|
5
5
|
--transition-base: 0ms;
|
|
6
6
|
--transition-slow: 0ms;
|
|
7
7
|
}
|
|
8
|
+
|
|
9
|
+
/* React's <ViewTransition> starts one whatever the preference: it still swaps, without moving. */
|
|
10
|
+
::view-transition-group(*),
|
|
11
|
+
::view-transition-old(*),
|
|
12
|
+
::view-transition-new(*) {
|
|
13
|
+
animation: none;
|
|
14
|
+
}
|
|
8
15
|
}
|