Closed iliatcymbal closed 6 years ago
When scss files were transformed to css files, variables substitutions would be the nearest variable definition before the selector, but not the last variable definition. That's different from less. So all the generated theme files would have the same content.
original scss:
$content: "First content";
.main {
content: $content;
}
$content: "Second content";
css:
.main {
content: "First content";
}
To solve the problem, theme-level variables will be imported before default variables and default variables should be marked with !default
.
css or sass rules don't have "default" rule, it's some unnecessary artifact
Actually sass has the default
rule, for more details, you can visit the sass documentation.
https://sass-lang.com/documentation/file.SASS_REFERENCE.html#variable_defaults_default
Ah, ok, got it. But stiil fill uncomfartable with this !default) Thank you
Indeed, it's different from other style formats in sass, only the variables marked with !default
can be substituted by individual theme variables in compilation. I also wanna discard it if I can.
Is it possible to set scss variables without
!default
directive? It looks bad and bit confusing (css or sass rules don't have "default" rule, it's some unnecessary artifact)