postcss / postcss-simple-vars

PostCSS plugin for Sass-like variables
MIT License
415 stars 36 forks source link

Variables = Parent #63

Closed venelinn closed 7 years ago

venelinn commented 7 years ago

Hi, Is there a way to do something like this?

$baseColor: #444; $baseText: $baseColor;

Thanks !

ai commented 7 years ago

Yeap. In this order it should work.

ai commented 7 years ago

I tested with CSS:

$baseColor: #444444;
$baseText: $baseColor;
color: $baseText;

and got:

color: $baseText

Error was reported to 51 line in source code. So this 2 lines is not all that you have there. Maybe problem is different.

ara4n commented 7 years ago

hm, it's working for me...

sierra:vector-web matthew$ cat > test.css
.moo {
    $baseColor: #444444;
    $baseText: $baseColor;
    color: $baseText;
}
sierra:vector-web matthew$ node_modules/.bin/postcss -u postcss-simple-vars test.css
.moo {
    color: #444444;
}