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

dartsass-sprockets not noticing changes in secondary @import .scss files, with deprecation warnings #26

Open
nimmolo opened this issue Jun 28, 2024 · 0 comments · May be fixed by #29
Open

Comments

@nimmolo
Copy link

nimmolo commented Jun 28, 2024

The issue i'm having is that for the last month or so, my CSS is not getting re-compiled when I alter certain imported scss files. (I don't have any imported .css files — the issue reported in #24 that has a workaround.)

Here is the order of compilation: the app has different themes like theme_one.css that are loaded in the head according to user preferences, instead of an application.css. The scss structure is:

// app/assets/stylesheets/theme_one.scss

// import this theme's variables
@import "custom/theme_one_vars"
// import the whole application
@import "application"
// app/assets/stylesheets/application.scss

@import "bootstrap-sprockets";
@import "custom/map_theme_vars_to_bootstrap_vars"; 
@import "bootstrap";
// Now that bootstrap defaults are themed, set custom SCSS for our elements.
@import "custom/elements";
// etc

The changes i want to make are in custom/elements.scss. But if I only change custom/elements.scss, CSS does not get recompiled. However, if I make my changes to custom/elements.scss and also, experimentally, alter a variable in custom/theme_one_vars.scss - in this case, all of the SCSS is recompiled, reflecting the changes in custom/elements.scss.

It occurred to me that this may be related to scss deprecation warnings. The app still uses Bootstrap 3, but our upgrade migration is a couple months away. Considering the order of imports, this indicates to me that maybe dartsass-sprockets, sprockets or dartsass stops checking for altered files after finding a deprecation warning. But that doesn't quite make sense — in the case where the CSS does get compiled, the compilation proceeds even after the warnings.

(To anticipate a possible question, yes I have run assets:clobber to be sure I don't have precompiled assets!)

@nimmolo nimmolo changed the title dartsass-sprockets not noticing changes in secondary @import .scss files dartsass-sprockets not noticing changes in secondary @import .scss files, with deprecation warnings Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant