Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[Feature Request]: Add support for prefers-color-scheme

オープン
#4,128 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 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 の本文から書いたものです。

説明

enhancement
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
主要言語
TypeScript
スター
2.7k
フォーク
248
平均マージ
3日 14時間
マージ済み PR(30日)
83

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

cloudscape-design/components のほかの issue

cloudscape-design/components の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。