There is no good way around this without modifying your _partial.scss
file.
If you want to have default variables, that you can override on @import
you need to use them with !default
:
_partial.scss:
$var: #FFFFFF !default;
body {
color: $var;
}
file.scss:
$var: #000000;
@import 'partial';
Output CSS:
body {
color: black;
}
Otherwise whichever value is assigned last overrides the one before.
Another option is to define all variables in a separate file (e.g. _variables.scss
) outside of _partial.scss
... then you can override/modify them (for example directly in file.scss
if you wish) before importing _partial.scss
.