sveltejs / svelte-preprocess

A ✨ magical ✨ Svelte preprocessor with sensible defaults and support for: PostCSS, SCSS, Less, Stylus, Coffeescript, TypeScript, Pug and much more.
MIT License
1.73k stars 147 forks source link

fix: Adjust globalifySelector to not split selectors with parentheses. #632

Closed gregschmit closed 3 weeks ago

gregschmit commented 1 month ago

Fixes #501

I ran into an issue where I could not use simple tailwind apply directives for dark mode and also couldn't import Daisy UI. I tracked it down to a problem with svelte-preprocess creating :global rules that svelte is not happy with. User https://github.com/MagDevX suggested an adjustment to globalifySelector.js combinatorPattern to prevent selectors with parenthesis from being split.

gregschmit commented 1 month ago

Update: I added a test that shows the problem and it fails in main but passes on this branch. I ran tests and everything passed.