Mechanize UI color token enforcement check
メンテナーはふだん 1 日以内に返信
@ArthurArthurArthur0817 がすでに取り組んでいます。
2026年11月4日 から。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 68/100
調査の方向性
Start by reading scripts/test.sh and the project’s CSS token guidance to understand how checks are run and which token-definition blocks are exempt. Add the checker at scripts/check-css-tokens.py and cover it in tests/scripts/test_check_css_tokens.py; run the unit tests and bash scripts/test.sh. Done means hardcoded colors outside exempt blocks are reported with file and line, while permitted tokens, comments, and strings do not cause false positives.
索引モデルが issue の本文から書いたものです。
説明
Summary
Adds an automated CSS color token enforcement tool in scripts/check-css-tokens.py to mechanize stylesheet color rules and prevent interface styles from hardcoding literal color values (Hex/RGB/HSL).
Motivation & Context
As described in the "Strengthening skills: code checking and progressive review" section of subsequent contribution directions, project guidelines require UI colors to use CSS tokens (var(--...)) to maintain consistency across themes (light/dark modes). However, this rule is not yet mechanized and relies entirely on manual code reviews. This creates unnecessary review overhead and allows hardcoded colors—such as fixed hex values failing on light backgrounds—to slip into the codebase.
Changes
- Add checker script (
scripts/check-css-tokens.py):- Scans CSS files under
web/. - Excludes
:rootand theme-specific token definition blocks, then checks remaining CSS rules for hardcoded literal color values (#hex,rgb(),rgba(),hsl(), etc.). - Reports exact file paths, line numbers, and offending values upon detecting violations, exiting with a non-zero status code (
1).
- Scans CSS files under
- Integrate into local test gates:
- Adds the checker to
scripts/test.shso style rules are validated automatically during the test run.
- Adds the checker to
- Add test coverage (
tests/scripts/test_check_css_tokens.py):- Implements unit tests for the script covering valid
var(--...)usage, permitted comments/strings, and interception of prohibited literal color formats to ensure zero false positives and reliable detection.
- Implements unit tests for the script covering valid
Testing
- Script unit tests pass:
python3 -m unittest tests/scripts/test_check_css_tokens.py(orpytest tests/scripts/test_check_css_tokens.py). - Full local test suite passes with no regressions:
bash scripts/test.sh. - Intentionally introduced
#ff0000intoweb/styles.cssto verify that the script pinpoints the offending line and halts the build.
- 主要言語
- Rust
- スター
- 223
- フォーク
- 148
- 平均マージ
- 1日 11時間
- マージ済み PR(30日)
- 224
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
sysprog21/codetrial のほかの issue
-
Check C++ starter node comments against the C++ harness対応中かも @bangyou0912 が今日担当しました。 オープン
sysprog21/codetrial#594 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Transcript tab does not scroll to new turns対応中かも @henrylee1003 が今日担当しました。 オープン
sysprog21/codetrial#592 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Let candidates save and switch between named session setups対応中かも @domin67 が 1 日前に担当しました。 オープン
sysprog21/codetrial#591 · コメント 1 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Let the candidate choose the editor indentation width対応中かも @princelu1009 が 1 日前に担当しました。 オープン
sysprog21/codetrial#589 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
sysprog21/codetrial#587 · コメント 4 件 ·
メンテナーはふだん 1 日以内に返信
sysprog21/codetrial の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
メンテナーはふだん 1 日以内に返信
-
🐞 bug 🧩 bevy_gantz_egui
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
nannou-org/gantz#500 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
metasequoiaime/msime#10989 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
fritzprix/libr-agent#2612 ·
メンテナーはふだん 1 日以内に返信
-
find: -printf %h drops a doubled slash対応中かも @qodelicious が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信