Closed hylomorph closed 1 year ago
FWIW the alternative syntax using a script tag is the recommended usage in Vite. It's usually not a good idea to put global tailwind css in <style global>
too if you're using any other bundler.
Thanks @bluwy, that sent me in the right direction! In my case I had other issues importing css files related to ShadowRoot
, but am now able to work around that (see sveltejs/svelte#7737).
Personally, I consider this resolved since there are enough alternatives.
Describe the bug Using syntax like this
or this
will cause the following issue: When tailwind classes are updated in imported components, they will not end up in the build.
Using syntax like
or
works fine.
(I hope this is the correct place to file this bug, but since there's no problem when using regular css imports I assume it's not a problem with tailwind.)
To Reproduce https://github.com/hylomorph/svelte-preprocess-postcss-global-subcomponent-issue
Observe that the first paragraph is blue and the second one is green.
Change the class in
src/B.svelte
tobg-green-600
. The background will turn white, becausebg-green-600
doesn't end up in the build.Change anything in
src/App.svelte
, and save. This will cause a "good" rebuild and now the background of the second paragraph is green again.Expected behavior I would expect adding new tailwind classes anywhere in the component hierarchy to correctly update. I believe this worked fine in the past.
Information about your project: