Expose the reduced-motion preference beside colorScheme
I maintainer di solito rispondono entro 3 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- react-native, typescript
Direzione di ricerca
Read the reduced-motion implementation proposed in #388 and compare it with the existing colorScheme API and devicePreference() behavior. Check the React Native and web paths, including matchMedia and the jest helper, then determine whether the public setter or a jest-only setter is desired. Done means the API shape and override behavior are agreed before implementation.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
#388 makes native evaluate prefers-reduced-motion, reading the device's setting from AccessibilityInfo. A consumer then needs two things:
- An app with its own "Reduce motion" setting has to override the device's preference, and keep its choice when the device's setting changes.
- A test suite has to put a test in reduce mode:
react-native-css/jestresets the preference before each test, and nothing public sets it.
#388 adds reducedMotion to the API, beside colorScheme:
import { reducedMotion } from "react-native-css";
reducedMotion.get(); // "reduce", "no-preference", or undefined until the device answers
reducedMotion.set("reduce"); // overrides the device, through any change of its setting
reducedMotion.set(null); // follows the device again
The override holds until it is cleared, as Appearance.setColorScheme(), iOS's overrideUserInterfaceStyle and Android's setDefaultNightMode() hold theirs, and as Media Queries 5 §13 shapes the web's navigator.preferences.reducedMotion.requestOverride() and clearOverride(). Internally it is one devicePreference() that keeps the device's answer apart from the app's override, which a later preference the platform reports but does not let an app set, such as contrast or reduced transparency, can share. On main, colorScheme.set() writes a value the next change of the device's scheme replaces; #415 keeps the scheme's override in Appearance, which holds it on the platform itself.
On web the browser evaluates @media in the stylesheet itself, so get() reads matchMedia and set() changes only what get() returns, not the CSS or matchMedia(). navigator.preferences would carry the override into the CSS, but no browser ships it yet (csswg-drafts#14493); once one does, the web set() can call it.
Is this the shape you would want, or would you rather keep the setter in the jest helper only?
- Lingua principale
- TypeScript
- Stelle
- 166
- Fork
- 45
- Merge medio
- 13g 14h
- PR unite (30g)
- 1
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di nativewind/react-native-css
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
nativewind/react-native-css#545 ·
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
nativewind/react-native-css#544 ·
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
nativewind/react-native-css#543 ·
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
nativewind/react-native-css#540 ·
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
nativewind/react-native-css#538 ·
I maintainer di solito rispondono entro 3 giorni
Tutte le issue di nativewind/react-native-css
Issue simili
-
b:minor bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
software-mansion/argent#1698 ·
I maintainer di solito rispondono entro 1 giorno
-
e2e-failure ready-to-code
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
redhat-developer/rhdh-plugin-export-overlays#4624 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
better-auth/better-auth#12132 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
automation missing-model model-sync provider:tinfoil
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
anomalyco/models.dev#12053 ·
I maintainer di solito rispondono entro 1 giorno
-
o8 next debug build aborts on Glass to Dark appearance switch (nil identifier messaged before check)Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
hurttlocker/o8#5112 ·