Skip to content

feat(css): add container query mixins and tokens#855

Open
wibjorn wants to merge 1 commit into
mainfrom
wbb/container-queries
Open

feat(css): add container query mixins and tokens#855
wibjorn wants to merge 1 commit into
mainfrom
wbb/container-queries

Conversation

@wibjorn
Copy link
Copy Markdown
Contributor

@wibjorn wibjorn commented May 7, 2026

Summary

Add container query SCSS mixins for component-level responsive design, complementing Atlas's existing viewport-based media query mixins.

New tokens (\css/src/tokens/containers.scss)

Token Value
\-query-320\ 320px
\-query-480\ 480px (existed)
\-query-640\ 640px
\-query-800\ 800px

New mixins (\css/src/mixins/container-queries.scss)

  • *\container(, )* marks an element as a container query context
  • *\container-320/480/640/800()* mobile-first @container\ size queries with optional named container targeting

Usage

\\scss
.card-grid {
@include mixins.container;

.card {
@include mixins.container-480 {
display: flex;
}
}
}
\\

Other changes

  • Refactored the timeline component to use the new \container-480\ mixin
  • Updated naming conventions in \css/src/components/README.md\ with rationale for pixel-based token names
  • Expanded \site/src/tokens/breakpoints.md\ with container query documentation, usage examples, and a decision guide

Add container-query SCSS mixins for component-level responsive design:
- container() mixin for marking elements as query containers
- container-320, container-480, container-640, container-800 size query mixins
- New tokens: \-query-320, \-query-640, \-query-800
- Refactored timeline component to use new container-480 mixin
- Updated naming conventions docs with rationale for pixel-based names
- Expanded breakpoints.md with container query documentation

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@wibjorn wibjorn requested a review from a team as a code owner May 7, 2026 20:42
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 7, 2026

🦋 Changeset detected

Latest commit: 50060f7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@microsoft/atlas-css Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

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