-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
Sass styles are not loaded when nuxt-windicss is enabled #173
Comments
bump - still happens for me |
Hey @abhay-agarwal & @skizer Are you able to provide a reproduction in stackblitz? I've attempted to replicate the issue and haven't been able to here: https://stackblitz.com/edit/nuxt-3-windicss-ohqssr?file=windi.config.ts |
Hey @harlan-zw, thanks for that fast response, What specifically is not working and what I was doing is using @apply in a nuxt sfc inside a style tag set to sass lang. <style lang="sass">
#test
@apply bg-red-600
</style> Seems like a nuxt-windicss problem as the vite plugin works flawlessly in that way? |
I have tried again with the most recent |
I should also mention that the latest version I found without this issue is |
Hey guys, apologised for the delay in the response. Took the last month off travelling, I've been able to replicate the issue. The issue is related to how the Vite plugin handles the order in which to transform CSS. By default, the Vite plugin transforms CSS after it's been loaded by any pre-processors (sass, less, postcss, etc). This is okay but it means a lot of the styles in the Vue SFC don't work. To get around this the Nuxt module sets the default transform CSS to happen before the pre-processors You can likely get the
The webpack plugin gets around this using pitching to determine the best time to process the styles. This most likely won't get ported to the vite plugin as it's mostly in a maintenance phase at the moment. Your options would be:
|
sass and scss don't work for me. I have to downgrade to 2.2.8. |
SCSS function @each doesn't work when nuxt-windi enabled. This code does nothing; $sizes: 40px, 50px, 80px;
@each $size in $sizes {
.icon-#{$size} {
font-size: #{$size};
height: #{$size};
width: #{$size};
}
} When windi disabled, it works fine. |
2.2.11 is fine, but sass is not loaded with 2.3.0. It seems that some change in this commit is the cause. |
If I enable the nuxt-windicss plugin, my sass styles as defined in the nuxt config
css
parameter are not loaded. This does not happen if I use a css stylesheet.The text was updated successfully, but these errors were encountered: