feat: refactor Columns to support container query-based sizing#220
Merged
brandonmcconnell merged 11 commits intomainfrom Mar 18, 2026
Merged
Conversation
Ensure the component can utilize its full allocated width without being restricted by `prose` typography styles, allowing for more flexible layouts.
Update the "static" layout mode to "none" for improved clarity and consistency. This change better communicates that no specific auto-flow behavior is applied, allowing the default grid styling to take precedence.
Remove the `layout` prop and its associated `auto-fill`/`auto-fit` grid logic from the Columns component. This simplifies the component's API and internal implementation, streamlining its responsive behavior to rely on CSS variables and standard grid classes. Storybook examples and argTypes have been updated to reflect this change, removing the `LayoutModes` story and simplifying the `InsideContainer` story.
Update the `InsideContainer` story to be explicitly resizable and visually distinct, providing a better demonstration of how the Columns component adapts to its parent container's width. Add clarifying JSDoc to guide user interaction.
pqoqubbw
approved these changes
Mar 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds container query support to the
Columnscomponent, enabling it to adjust its layout based on the width of its parent container rather than the viewport.This change:
Columnscomponent's behavior within a container query context.Test Plan
InsideContainerstory in Storybook, observing that theColumnscomponent correctly re-arranges its child elements when the containingdivchanges width (e.g., by resizing the Storybook canvas or the browser window).Columnsstories still render as expected, maintaining their responsiveness to viewport changes where container queries are not explicitly applied.Note
Medium Risk
Updates
Columnslayout logic from fixed breakpoint-based classes to CSS-variable/container-query-driven sizing, which can affect responsive rendering across consuming pages. Risk is moderate and largely visual/layout-related.Overview
Refactors
Columnsto size its grid using a--colsCSS variable and Tailwind container-query syntax, replacing the previous hardcodedsm:grid-cols-{n}breakpoint rules and removing the implicit max-width constraint.Adds a new Storybook story (
InsideContainer) demonstrating thatColumnscan respond to a parent@containerwidth (not just the viewport), and centralizes the default column count via a newDEFAULT_COLSexport.Written by Cursor Bugbot for commit 48a2833. This will update automatically on new commits. Configure here.