-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
SCSS @import directives nested inside @layer are not tracked #4838
Comments
Good catch, I spent some time looking into this and I think the issue is that we are never informed that that file is a dependency, so we don't bust our internal cache when it changes. Probably not the workaround you want to hear but are you able to just not use Sass? Using just PostCSS will be faster with less compatibility issues to worry about, and still supports all the Sass features you probably need. https://tailwindcss.com/docs/using-with-preprocessors Notes for myself — this is basically because CSS files are treated as context dependencies, but with Sass we don't get a full list of the actual files, I'm guessing we are only getting the |
Same here. |
I'm running into this issue periodically in my current setup and I'd like to eliminate it. I'm moving slowly towards removing sass in my workflow, but I'm not there yet and it would be awesome to fix, even if it's a hack like "automatically forcing a save on the main file if a sub file is saved" kinda thing. I'm using Laravel-Mix right now and I'm thinking maybe there's a way to automate this 🤔 |
Same here. 🤔 |
Originally posted by @asafari72 in #6425
|
Same here, anyone find a way fix that? |
The problem still exists in version 3.0.18. Does anyone have a solution to this problem? |
Yeah I'm also experiencing this issue using version 3.0.19 |
Also experiencing this issue using 3.0.19 and a laravel mix build using tailwind and SASS. The only stable solution i have today is to revert back to Tailwind v2 and force using the JIT mode. |
Same here, i'm using 3.0.23 and laravel mix. My app.scss file looks like this :
in my Saving the file will trigger my watcher but unfortunately the changes are not tracked and nothing happened. Saving the Hope to have this solved ASAP :) |
Same when tried to import scss file after main layers. /*tailwind.css*/
@import "tailwindcss/base";
@import "tailwindcss/components";
@import "tailwindcss/utilities";
@import "./layers.scss"; //layers.scss
@layer base {
[theme="light"] {
html {
@apply bg-light-light-shades text-light-dark-shades;
}
}
[theme="dark"] {
html {
@apply bg-light-dark-shades text-light-light-shades;
}
}
} Expected: the I'm using nuxt 3 with vite and @nuxtjs/tailwindcss v6.12.1 |
What version of Tailwind CSS are you using?
v2.2.4
What build tool (or framework if it abstracts the build tool) are you using?
Nuxt with @nuxtjs/tailwindcss
What version of Node.js are you using?
v14.16.1
What browser are you using?
N/A
What operating system are you using?
Linux
Reproduction repository
https://github.com/makkarpov/tailwind-dep-repro
Describe your issue
SCSS loses track of dependencies when
@import
statements are embedded within@layer ... { ... }
directive. Change of imported file does not trigger recompilation of the style, and as a result nothing is changed in actual output.If you have SCSS organized like this
main.scss:
_inner.scss:
then changes in
_inner.scss
won't be picked by HMR, requiring change inmain.scss
to trigger recompilation process. This greatly hinders development, requiring any nested change to be followed by change of root file.The text was updated successfully, but these errors were encountered: