diff --git a/src/functions/_mixins.scss b/src/functions/_mixins.scss new file mode 100644 index 0000000..4ec02c3 --- /dev/null +++ b/src/functions/_mixins.scss @@ -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}; + } + } +}