From fa2730f2b09f129087e581491cbcb5b599996f85 Mon Sep 17 00:00:00 2001 From: GOMA Date: Tue, 15 Jul 2025 12:41:52 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feature:=20Add=20mixin=20to=20gener?= =?UTF-8?q?ate=20css=20variables?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/functions/_mixins.scss | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/functions/_mixins.scss 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}; + } + } +}