Expose the reduced-motion preference beside colorScheme
メンテナーはふだん 3 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- react-native, typescript
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
#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?
- 主要言語
- TypeScript
- スター
- 166
- フォーク
- 45
- 平均マージ
- 13日 14時間
- マージ済み PR(30日)
- 1
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
nativewind/react-native-css のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
nativewind/react-native-css#545 ·
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
nativewind/react-native-css#544 ·
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
nativewind/react-native-css#543 ·
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
nativewind/react-native-css#540 ·
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
nativewind/react-native-css#538 ·
メンテナーはふだん 3 日以内に返信
nativewind/react-native-css の issue をすべて見る
似ている issue
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 86/100
awslabs/visual-asset-management-system#937 ·
メンテナーはふだん 1 日以内に返信
-
t0ggles
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
nolimits4web/swiper#8255 · コメント 1 件 ·
メンテナーはふだん 15 日以内に返信
-
render: --variables-file (and --variables <path>) fails with "io.readFile is not a function" since 0.8.212対応中かも @miguel-heygen が今日担当しました。 オープンbug triage/needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
heygen-com/hyperframes#6830 ·
メンテナーはふだん 1 日以内に返信
-
bug launch local use
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
account: profile bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 5 日以内に返信