fix: theme skipping not skipping a theme if its name also starts with another theme name #3251
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.
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 aprimary-legacy
theme, and we only wanted to generatestaticCss
for theprimary
theme,primary-legacy
was also being included in the token generation due to it also started withprimary
⛳️ 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.