SASS Color Theme without repeat elements
I need to create themes with many colors using sass, but all examples I
saw I have to replicate blocks of CSS using different variable names. What
I want is use same name variables on different classes colors.
What I have in my mind is something like this.
//
// My regular CSS
//
.header
background-color: $color1
border-color: $color2
.menu
background-color: $color2
border-color: $color1
//
// My colors.sass could be like this
//
.color-green
$color1: green
$color2: red
.color-blue
$color1: blue
$color2: orange
What I think the compile would give me:
.color-green .header
background-color: green
border-color: red
.color-blue .header
background-color: blue
border-color: orange
.color-green .menu
background-color: red
border-color: green
.color-green .menu
background-color: orange
border-color: blue
Is this possible?
No comments:
Post a Comment