[Feature Request]: Add support for prefers-color-scheme
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
- #4129 @TrevorBurnham による — マージされずにクローズ
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 25/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- css
- 領域
- frontend
調査の方向性
Start with the existing dark-mode classes on and the visual-modes documentation linked in the issue; the issue does not name source files or tests. Check how those classes apply dark-mode styles and how the project's styles handle prefers-color-scheme. Done means an auto-mode class matches the browser preference without relying on JavaScript; first check the linked pull request, which is closed and unmerged.
索引モデルが issue の本文から書いたものです。
説明
Description
Currently, you can switch your Cloudscape application to dark mode by adding the dark mode classes awsui-polaris-dark-mode and awsui-dark-mode to <body>. (Incidentally, this behavior doesn't seem to be documented at https://cloudscape.design/foundation/visual-foundation/visual-modes/.) But there's no class you can use to match the browser's prefers-color-scheme.
You could consume that preference in JavaScript and then set the appropriate class, but that doesn't work for SSR: The server has no way of knowing what the user's prefers-color-scheme value is. In practice, this means that any Cloudscape app that uses SSR and automatically switches the theme to match the browser-level preference will show an initial flicker of the wrong mode for some users.
This could be addressed by providing an awsui-auto-mode class that looks like this:
.awsui-auto-mode {
@media (prefers-color-scheme: dark) {
/* dark mode styles... */
}
}
Code of Conduct
- I agree to follow this project's Code of Conduct
- I checked the current issues for duplicate requests
- 主要言語
- TypeScript
- スター
- 2.7k
- フォーク
- 248
- 平均マージ
- 3日 14時間
- マージ済み PR(30日)
- 83
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
cloudscape-design/components のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
cloudscape-design/components#5184 · コメント 2 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
cloudscape-design/components#5152 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
cloudscape-design/components#5149 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
cloudscape-design/components#5117 · コメント 2 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
cloudscape-design/components#5106 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
cloudscape-design/components の issue をすべて見る
似ている issue
-
category::task code priority::normal
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
e0ipso/strikethroo#145 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 85/100
cocos/cocos-docs#3333 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
RevenueCat/react-native-purchases#2079 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
RevenueCat/purchases-hybrid-common#2039 ·
メンテナーはふだん 1 日以内に返信
-
agent-reported area/react bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信