Expose the reduced-motion preference beside colorScheme
Maintainer thường phản hồi trong vòng 3 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- react-native, typescript
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
#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?
- Ngôn ngữ chính
- TypeScript
- Star
- 166
- Fork
- 45
- Merge trung bình
- 13 ngày 14 giờ
- Pull request đã merge (30 ngày)
- 1
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của nativewind/react-native-css
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 87/100
nativewind/react-native-css#506 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
nativewind/react-native-css#510 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 56/100
nativewind/react-native-css#509 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 62/100
nativewind/react-native-css#481 · 1 reaction ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 30/100
nativewind/react-native-css#473 ·
Maintainer thường phản hồi trong vòng 3 ngày
Tất cả issue của nativewind/react-native-css
Issue tương tự
-
Parallel reticle_verify opens per-flow leases without the source lease's ignoreHTTPSErrorsCó thể đã có người làm @as992949791 đã nhận hôm nay. Đang mởgood first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
reticlehq/reticle#2033 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area:quality p3-medium ready-for-agent type:docs
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
fderuiter/deruiter.dev#3589 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
manfredsteyer/angular-oauth2-oidc#1514 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
marmelab/react-admin#11431 ·
Maintainer thường phản hồi trong vòng 1 ngày