Expose the reduced-motion preference beside colorScheme
Mantenedores costumam responder em até 3 dias
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Facilidade para iniciantes
- 25/100
- Tipo de issue
- Funcionalidade
- Clareza
- Razoavelmente clara
- Status de atividade
- Ativa
- Stack de tecnologia
- react-native, typescript
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
#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?
- Linguagem predominante
- TypeScript
- Estrelas
- 166
- Forks
- 45
- Merge médio
- 13d 14h
- PRs com merge (30d)
- 1
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de nativewind/react-native-css
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
nativewind/react-native-css#545 ·
Mantenedores costumam responder em até 3 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
nativewind/react-native-css#544 ·
Mantenedores costumam responder em até 3 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
nativewind/react-native-css#543 ·
Mantenedores costumam responder em até 3 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
nativewind/react-native-css#540 ·
Mantenedores costumam responder em até 3 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
nativewind/react-native-css#538 ·
Mantenedores costumam responder em até 3 dias
Todas as issues de nativewind/react-native-css
Issues semelhantes
-
b:minor bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
software-mansion/argent#1698 ·
Mantenedores costumam responder em até 1 dia
-
e2e-failure ready-to-code
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
redhat-developer/rhdh-plugin-export-overlays#4624 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
better-auth/better-auth#12132 · 1 reação ·
Mantenedores costumam responder em até 1 dia
-
automation missing-model model-sync provider:tinfoil
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
anomalyco/models.dev#12053 ·
Mantenedores costumam responder em até 1 dia
-
o8 next debug build aborts on Glass to Dark appearance switch (nil identifier messaged before check)Abertabug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
hurttlocker/o8#5112 ·