I am working with a color array that looks like this:
$colors: (
'primary': '#aaa',
'secondary': '#bbb',
'color-3': '#ccc',
'color-4': '#ddd',
'color-5': '#eee',
);
My goal is to automate the creation of classes in a loop, similar to this:
@each $col in map-keys($theme-colors){
&.btn-#{$col} {
background-color: map-get($theme-colors, $col);
&:hover{
background-color: map-get($theme-colors, $col + 1); // <= my issue lies here in getting "$col + 1"
}
}
}
The concept is to have a class btn-primary
with a primary color background and, on hover, switch to the secondary color as the background.
For the class btn-secondary
, it should have a secondary color background and change to color-3 on hover, and so on for other classes.
Any suggestions on how I can achieve this functionality?
Thank you! :)