Skip to content

fix: theme skipping not skipping a theme if its name also starts with another theme name #3251

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

drobannx
Copy link

@drobannx drobannx commented Apr 30, 2025

Closes #3250

📝 Description

This PR fixes an issue where if one theme's name shared the start of another, both would be included in the resulting token generation. Example, if there was a primary theme and a primary-legacy theme, and we only wanted to generate staticCss for the primary theme, primary-legacy was also being included in the token generation due to it also started with primary

⛳️ Current behavior (updates)

The current behavior checks to see if a theme should be skipped by checking if the key starts with any condition, this can overmatch in the example above

🚀 New behavior

The new behavior is a bit more strict in its key matching. It looks for either an exact match on the condition or checks to see if condition starts with the key + a : so that conditions like dark mode still get generated.

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

This should not break any changes and only reduce unused token generation.

Copy link

changeset-bot bot commented Apr 30, 2025

🦋 Changeset detected

Latest commit: f836f11

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

This PR includes changesets to release 20 packages
Name Type
@pandacss/generator Patch
@pandacss/node Patch
@pandacss/parser Patch
@pandacss/reporter Patch
@pandacss/astro-plugin-studio Patch
@pandacss/dev Patch
@pandacss/postcss Patch
@pandacss/studio Patch
@pandacss/config Patch
@pandacss/core Patch
@pandacss/extractor Patch
@pandacss/is-valid-prop Patch
@pandacss/logger Patch
@pandacss/preset-atlaskit Patch
@pandacss/preset-base Patch
@pandacss/preset-open-props Patch
@pandacss/preset-panda Patch
@pandacss/shared Patch
@pandacss/token-dictionary Patch
@pandacss/types Patch

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 Apr 30, 2025

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

Name Status Preview Updated (UTC)
panda-docs ✅ Ready (Inspect) Visit Preview Apr 30, 2025 8:34pm
panda-playground ✅ Ready (Inspect) Visit Preview Apr 30, 2025 8:34pm
panda-studio ✅ Ready (Inspect) Visit Preview Apr 30, 2025 8:34pm

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.

Theme filtering incorrectly matches partial theme names when only one is specified in staticCss.themes
1 participant