Container Query
Query del contenitore
Una container query permette al CSS di adattare un componente al suo contenitore. Controlla la dimensione o lo stile di quel contenitore, non solo la finestra.
Un altro esempio
Una scheda prodotto mostra tutti i dettagli in un'area larga. In una barra laterale stretta, mostra un breve riassunto.
Parti principali
- 01Outer constraint
- 02Content and spacing model
- 03Computed size or reflow result
Usalo quando
Usa le query dei contenitori quando un componente riutilizzabile appare in aree di layout di dimensioni diverse.
Non usarlo quando
Non aggiungere mai molte regole di query quando il contenuto può già disporsi bene da solo.
Nome usato nel codice
@container 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 Query del contenitore (Container Query). User context: Una scheda prodotto mostra tutti i dettagli in un'area larga. In una barra laterale stretta, mostra un breve riassunto. Design concept to apply: Query del contenitore (Container Query). Why it fits: Usa le query dei contenitori quando un componente riutilizzabile appare in aree di layout di dimensioni diverse. Do not use it when: Non aggiungere mai molte regole di query quando il contenuto può già disporsi bene da solo. 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 Query del contenitore (Container Query) is used now. Definition: Una container query permette al CSS di adattare un componente al suo contenitore. Controlla la dimensione o lo stile di quel contenitore, non solo la finestra. 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.