CSS Custom Property
Proprietà personalizzata CSS
Una CSS custom property è un valore CSS riutilizzabile, spesso chiamato variabile CSS. Segue la cascata e può cambiare in base allo scope o al tema.
Un altro esempio
Una scheda prende i suoi valori --surface e --text dal tema chiaro o scuro attivo in quel momento.
Parti principali
- 01Foundation or token
- 02Applied component
- 03Visible state and rule
Usalo quando
Usa proprietà personalizzate per temi, token di design e valori condivisi nel CSS.
Non usarlo quando
Non memorizzare mai il contenuto della pagina o ogni numero usa e getta nelle proprietà personalizzate globali.
Nome usato nel codice
--token-name Prima di spedire
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 Proprietà personalizzata CSS (CSS Custom Property). User context: Una scheda prende i suoi valori --surface e --text dal tema chiaro o scuro attivo in quel momento. Design concept to apply: Proprietà personalizzata CSS (CSS Custom Property). Why it fits: Usa proprietà personalizzate per temi, token di design e valori condivisi nel CSS. Do not use it when: Non memorizzare mai il contenuto della pagina o ogni numero usa e getta nelle proprietà personalizzate globali. 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): Un documento formale può ancora essere una bozza, un release candidate o la versione finale. Controlla il suo stato e il supporto per browser o piattaforma. Unknowns to confirm: Brand limits, amount of content, supported themes and languages, target devices, and design-system rules.
Controlla questa richiesta
Review how Proprietà personalizzata CSS (CSS Custom Property) is used now. Definition: Una CSS custom property è un valore CSS riutilizzabile, spesso chiamato variabile CSS. Segue la cascata e può cambiare in base allo scope o al tema. 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.