Pseudo-class
Pseudo-classe
Una pseudo-classe fa parte di un selettore CSS. Trova un elemento attraverso una condizione, come stato, luogo, lingua o azione dell'utente.
Un altro esempio
Un modulo utilizza `:focus-visible` per il focus da tastiera. Utilizza `:user-invalid` dopo l'interazione e `:disabled` quando invia non è disponibile. Gli utenti touch non ottengono uno stile hover persistente. Gli errori del server restano come testo reale del DOM, non solo come stile pseudo-classe.
Parti principali
- 01Condizione con prefisso due punti
- 02Stato dell'elemento corrispondente
- 03dichiarazioni condizionali
Usalo quando
Usa pseudo-classi standard per stati reali del browser. Mantieni lo stato significativo e fornisci anche feedback accessibili.
Non usarlo quando
Non memorizzare uno stato aziendale importante solo in hover, focus o posizione. Deve sopravvivere ai cambiamenti nel metodo di input e nell'ordine del DOM.
Nome usato nel codice
:hover, :focus-visible, :checked, :disabled, :has(), :lang() 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 Pseudo-classe (Pseudo-class). User context: Un modulo utilizza `:focus-visible` per il focus da tastiera. Utilizza `:user-invalid` dopo l'interazione e `:disabled` quando invia non è disponibile. Gli utenti touch non ottengono uno stile hover persistente. Gli errori del server restano come testo reale del DOM, non solo come stile pseudo-classe. Design concept to apply: Pseudo-classe (Pseudo-class). Why it fits: Usa pseudo-classi standard per stati reali del browser. Mantieni lo stato significativo e fornisci anche feedback accessibili. Do not use it when: Non memorizzare uno stato aziendale importante solo in hover, focus o posizione. Deve sopravvivere ai cambiamenti nel metodo di input e nell'ordine del DOM. 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 Pseudo-classe (Pseudo-class) is used now. Definition: Una pseudo-classe fa parte di un selettore CSS. Trova un elemento attraverso una condizione, come stato, luogo, lingua o azione dell'utente. 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.