Skip to content

Add @container queries#580

Open
celsobonutti wants to merge 12 commits into
rtfeldman:masterfrom
celsobonutti:master
Open

Add @container queries#580
celsobonutti wants to merge 12 commits into
rtfeldman:masterfrom
celsobonutti:master

Conversation

@celsobonutti

@celsobonutti celsobonutti commented Jun 21, 2022

Copy link
Copy Markdown
  • Adds a Css.Container module for supporting @container queries.
  • Adds expr, anyOf, allOf, inverse, condition, gt, lt, ge, le, eq, between functions to Css.Media so they have the same helper functions for their algebras.

@celsobonutti celsobonutti reopened this Jul 6, 2026
@celsobonutti celsobonutti changed the title Adds prefers-reduced-motion media query Add @container queries Jul 6, 2026
celsobonutti and others added 12 commits July 6, 2026 16:09
…nQuery variants

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…laration

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…tics

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… nesting

The spec documents v1 nesting semantics: when withContainer is nested
inside withMedia (or vice versa), the outer rule applies and the inner
condition is dropped. The WithMedia branch of applyStyles previously
left a nested ContainerRule untouched (via styleBlockToMediaRule),
letting the inner container survive and silently discarding the outer
media condition. The MediaRule branch of toContainerRule had the
opposite bug: it kept the inner media rule unchanged instead of
folding it into the outer container rule. Both now special-case the
inner at-rule and substitute the outer condition, consistent with the
existing (and now corrected) comments.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Fix Css.Global nested @container to and-combine conditions (inner name
  wins) instead of dropping the inner condition, matching the Style-path
  toContainerRule and the sibling media helper's append semantics.
- Add tests for global nested-container combine and Style-path inner-name-
  wins nesting (1694 -> 1696 tests).
- Add CHANGELOG entry for the container-queries feature set.
- Fill in empty docs for Css.Media gt/lt/ge/le/eq, Css.Container
  width/height/aspectRatio/landscape/portrait, and note custom-ident
  validation caveats on containerName/containerNames/container.
- Run elm-format over touched files; align containerRanges token
  qualification to bare (no collision) for consistency.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Add container query support (Css.Container)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant