✨ feature: Add mixin to generate css variables
This commit is contained in:
parent
975e5ad002
commit
fa2730f2b0
13
src/functions/_mixins.scss
Normal file
13
src/functions/_mixins.scss
Normal file
|
@ -0,0 +1,13 @@
|
|||
// 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};
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user