WORK-481
ID:WORK-481Status:ready

Container-query collapse contract + responsive-preview simulation

The shared data-collapse responsive contract (WORK-469, WORK-473) is @media-based: beside→stack collapse (split.css), grid→1-column reflow (feature.css), and collapse-to-carousel (carousel.css) all key off the global viewport. Two consequences:

Priority:mediumComplexity:moderateMilestone:v0.26.0Source:SPEC-100
claude/feature-carousel-gap-nav-fix View source

Criteria completion

Criteria completion: 0 of 6 (0%) checked; tracking started on Jun 26, no incremental history yet0%25%50%75%100%Jun 26Jul 11

Tracking started Jun 26 — check back for trends.

Branches 4
History 2
  1. 34464bb
    Content editedby Björn Andersson
    plan: renumber carousel CQ work item WORK-481 → WORK-489
  2. b21e70a
    Created (ready)by bjornolofandersson

Scope

  • Convert the shared data-collapse collapse rules from @media (max-width: …) to @container (max-width: …) in the three contract files: split.css (beside→stack), feature.css (grid→1-col), carousel.css (collapse-to-carousel + the existing --constrained blocks). Same sm/md/lg breakpoints and data-collapse hook; never still opts out.
  • Make .rf-preview__viewport-frame a container (container-type: inline-size) so a previewed rune queries the frame width — the viewport selector then accurately drives the collapse breakpoints. Confirm the preview's own existing @container chrome rules (toolbar/canvas, which live outside the frame) are unaffected (they continue to query .rf-page-content).
  • Restore the feature carousel doc example to grid + collapse-to="carousel" with responsive="mobile,tablet,desktop" once the flip is simulable, and update the prose.

Non-goals

  • No matchMedia mount/unmount in the behavior layer (SPEC-100 ruled this out; the responsive path stays CSS/touch-only — no JS nav on collapse).
  • No change to the breakpoint values (sm/md/lg) or the data-collapse author API.

Acceptance Criteria

  • The data-collapse collapse rules in split.css, feature.css, and carousel.css are container-query driven (@container), keyed off the nearest container (.rf-page-content on real pages), with the sm/md/lg breakpoints and never opt-out unchanged.
  • A rune in a narrow column collapses on its own available width, not the global viewport (verified for a feature in the docs layout beside the sidebar).
  • .rf-preview__viewport-frame is a container, so a previewed rune's collapse flips track the viewport selector (mobile flips collapse-to="carousel" to a swipe row; tablet/desktop keep the grid).
  • The preview's existing @container chrome rules (toolbar/canvas bleed) are unaffected by the new frame container.
  • Cross-layout visual pass: marketing (full-bleed), docs (sidebar column), and anchored-measure page sections collapse at sensible points; document any intentional breakpoint shifts vs. the old viewport-relative behavior.
  • The feature carousel doc example is restored to grid + collapse-to="carousel" with a responsive preview, and the prose explains the flip.

Approach

Mechanical @media@container swap in the three files, relying on the existing .rf-page-content container. Key risk is semantic shift: @container measures the content column, which is narrower than the viewport (especially docs pages with a sidebar), so flips will fire at a wider viewport than today — arguably more correct, but a site-wide visual change that needs the cross-layout pass above. Note a full-bleed data-width="full" rune still queries .rf-page-content (its container ancestor), not its own bled width — confirm that collapse point is acceptable or scope an explicit container on bled hosts. Land behind the v0.26.0 carousel epic so it can be reverted independently if the breakpoint shift proves undesirable.

Dependencies

  • WORK-469 — the data-collapse hook being converted.
  • WORK-473 — the collapse-to-carousel CSS target being converted.
  • WORK-474feature carousel adoption (the doc example restored here).

References

  • Spec: SPEC-100 (carousel as a shared layout mode), SPEC-099 §3 (collapse semantics).
  • Prior art: existing @container usage in default.css, split.css, bento.css, hero.css, mockup.css, docs.css.
  • Origin: discovered while fixing the feature carousel doc example — the preview viewport selector could not demonstrate collapse-to="carousel" because the flip is @media-gated and the frame is width-only.