visua/src/functions/_mixins.scss

14 lines
428 B
SCSS
Raw Normal View History

// Mixin that generates css variables
// If the variable has no prefix, don't assign anything to the $prefix attribute, leave its default value: “”
@mixin generate-css-variables($map, $prefix: "") {
@if $prefix == "" {
@each $name, $value in $map {
--#{$name}: #{$value};
}
} @else {
@each $name, $value in $map {
--#{$prefix}-#{$name}: #{$value};
}
}
}