Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: container query (cq) pattern #2099

Merged
merged 13 commits into from
Jan 28, 2024
Merged

Conversation

astahmer
Copy link
Collaborator

📝 Description

Add new cq pattern in @pandacss/preset-base (included by default)

// 1 - Define container conditions

export default defineConfig({
  // ...
  theme: {
    containerNames: ['sidebar', 'content'],
    containerSizes: {
      xs: '40em',
      sm: '60em',
      md: '80em',
    },
  },
})
// 2 - Automatically generate container query pattern

import { cq } from 'styled-system/patterns'

function Demo() {
  return (
    <nav className={cq({ name: 'sidebar' })}>
      <div
        className={css({
          // When the sidebar container reaches the `sm` size
          // change font size to `md`
          fontSize: { base: 'lg', '@sidebar/sm': 'md' },
        })}
      />
    </nav>
  )
}

💣 Is this a breaking change (Yes/No):

no

Copy link

changeset-bot bot commented Jan 27, 2024

🦋 Changeset detected

Latest commit: 0832bef

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

This PR includes changesets to release 20 packages
Name Type
@pandacss/preset-base Minor
@pandacss/types Minor
@pandacss/core Minor
@pandacss/config Minor
@pandacss/fixture Minor
@pandacss/dev Minor
@pandacss/generator Minor
@pandacss/node Minor
@pandacss/parser Minor
@pandacss/preset-atlaskit Minor
@pandacss/preset-open-props Minor
@pandacss/preset-panda Minor
@pandacss/studio Minor
@pandacss/token-dictionary Minor
@pandacss/astro-plugin-studio Minor
@pandacss/postcss Minor
@pandacss/extractor Minor
@pandacss/is-valid-prop Minor
@pandacss/logger Minor
@pandacss/shared 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

Copy link

vercel bot commented Jan 27, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
panda-docs ✅ Ready (Inspect) Visit Preview Jan 28, 2024 8:57pm
panda-playground ✅ Ready (Inspect) Visit Preview Jan 28, 2024 8:57pm
panda-studio ✅ Ready (Inspect) Visit Preview Jan 28, 2024 8:57pm

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.

None yet

2 participants