CSS Custom Property
CSSカスタムプロパティ
CSSのcustom propertyは、何度も使えるCSSの値で、CSS変数とも呼ばれます。CSSのルールに従って、使う場所やテーマに合わせて変えられます。
もう一つの例
カードは、今使っている明るいテーマか暗いテーマから、--surfaceと--textの値をもらうよ。
主な部分
- 01Foundation or token
- 02Applied component
- 03Visible state and rule
以下の場合に使用します
テーマ、デザイントークン、およびCSSで共有される値にはカスタムプロパティを使用してください。
以下の場合は使用しないでください
ページの内容や一度きりの番号をグローバルカスタムプロパティに保存してはいけません。
コードで使用する名前
--token-name 出荷前に
Check content order, shared design values, component consistency, contrast, zoom, and layout changes by screen size. Verify every theme, language, and state. If there is motion, offer an equal reduced-motion experience.
Outcome:Complete the task with CSSカスタムプロパティ (CSS Custom Property)。 User context:カードは、今使っている明るいテーマか暗いテーマから、--surfaceと--textの値をもらうよ。 Design concept to apply:CSSカスタムプロパティ (CSS Custom Property)。 Why it fits:テーマ、デザイントークン、およびCSSで共有される値にはカスタムプロパティを使用してください。 Do not use it when:ページの内容や一度きりの番号をグローバルカスタムプロパティに保存してはいけません。 Design requirements: Set the content order, shared design values, and reusable components. Define how the layout changes by screen size and state. Keep useful design choices separate from decoration. Inclusion and resilience: Check contrast, zoom, languages, themes, and reduced motion when needed. Do not use color or effects as the only way to show meaning. Acceptance criteria: The design stays clear on phones and desktops, at zoom, in every theme, and in all supported languages. Interactive states stay clear and consistent. Evidence and limits (evidence boundary):きちんとした書類でも、まだドラフトやリリース候補、あるいは最終版かもしれません。ステータスや、ブラウザやプラットフォームの対応状況を確認しましょう。 Unknowns to confirm: Brand limits, amount of content, supported themes and languages, target devices, and design-system rules.
このリクエストを確認する
Review how CSSカスタムプロパティ (CSS Custom Property) is used now. Definition: CSSのcustom propertyは、何度も使えるCSSの値で、CSS変数とも呼ばれます。CSSのルールに従って、使う場所やテーマに合わせて変えられます。 Release checks: Check content order, shared design values, component consistency, contrast, zoom, and layout changes by screen size. Verify every theme, language, and state. If there is motion, offer an equal reduced-motion experience. Before changing code, list the evidence, gaps, severity, and the smallest safe fix.