postcss-advanced-variables
postcss-advanced-variables copied to clipboard
Suggestion for a new feature: Read-Only Variables to Overide other Variables
Hey @jonathantneal !
To begin with, thanks for a great plugin!
Since we want to use our NUXTJS boilerplate on various projects, we want to be able to change the values for properties like background colors or width dynamically without changing the whole template each time.
Here is an example:
./overriding.sss
$background-color: orange ---> This overrides and affects all the files in variablee.sss and other files that uses this variable.
*Order of the files doesn't matter here
./variable.sss
$fg: $blue
$fg--1: color( $fg shade(15%) )
$fg--2: color( $fg shade(30%) )
$fg-1: color( $fg tint(15%) )
$fg-2: color( $fg tint(30%) )
The syntax for overriding features can be something like:
@readonly {
$fg: yellow
}
This readonly declaration comes before the original $fg declaration defined in other file.
We are thinking of making a PR. We really want to have this feature added!
Appreciate any response!
I like it. Forgive me if this is a daft question, but does this mirror an existing Sass feature, too?
@jonathantneal Thanks for the question! Yeah, Sass doesn't have this feature implemented.