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

fix(optimize-css): only remove bx-- prefixed classes #56

Merged
merged 1 commit into from
Apr 8, 2024
Merged

Conversation

metonym
Copy link
Collaborator

@metonym metonym commented Apr 8, 2024

Fixes #55

Currently, the optimizeCss plugin is too aggressive. It will remove non-Carbon prefixed selectors.

The fix is to first check that selectors actually include the Carbon bx-- prefix. This is an even more conservative approach, However, the critical mandate is to avoid false positives.

With this change, I've tested that the following selectors are not removed:

  • Scoped Svelte style
  • Global Svelte style (e.g., :global())
  • Global selector from CSS StyleSheet
  • Global selector overriding a Carbon class

@metonym metonym merged commit 077b1f1 into main Apr 8, 2024
1 check passed
@metonym metonym deleted the fix-55 branch April 8, 2024 02:50
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.

optimizeCss v0.11.0 breaks image styling on production builds with Sveltekit
1 participant