Scss Variable is resolved by name, library root take precedence over project files

Hi,

 

I've a project where inside the assets/scss/settings/ I have a file called _colors.scss, within this file there is a variable $color-primary. Same for the library root.

 

When I try to use a variable within my project  the variable of the library root take precedence, so I see the color of the library root file instead the one that come from the variable within the project.

 

To be better cleary:

My project is a WordPress theme, and I have a plugin Framework as library root ( under External Libraries ).

Within the project I have assets/scss/settings/_color.scss and within the plugin fw assets/scss/settings/_color.scss, the color that I see associated to the variable $color-primary within my project is the one from the plugin fw not the one from the project. How can I invert this behavior?

 

Want to give precedence to the variables defined within the project.

 

1 comment

Hmmm... If the file is not imported explicitly, and variables are resolved by name only, there is no way to give them a priority - all variables found when indexing project scss files appear in arbitrary order. So the only solution is to explicitly import _color.scss in your file 

0

Please sign in to leave a comment.