feature: Add mixin to generate css variables

This commit is contained in:
GOMA 2025-07-15 12:41:52 +02:00
parent 975e5ad002
commit fa2730f2b0

View 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};
}
}
}