From 6274d4d81484325ccf5a8e0246fcbb63e82855f4 Mon Sep 17 00:00:00 2001 From: GOMA Date: Wed, 16 Jul 2025 13:34:49 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feature:=20Add=20mixin=20to=20gener?= =?UTF-8?q?ate=20typography=20css=20classes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/functions/_mixins.scss | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/src/functions/_mixins.scss b/src/functions/_mixins.scss index 4ec02c3..31306de 100644 --- a/src/functions/_mixins.scss +++ b/src/functions/_mixins.scss @@ -1,4 +1,4 @@ -// Mixin that generates css variables +// Mixin to generate 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 == "" { @@ -11,3 +11,24 @@ } } } + +// Mixin to generate typography css classes +@mixin generate-typo-class($map) { + @each $name, $value in $map { + @if $name == "family" { + font-family: $value; + } @else if $name == "size" { + font-size: $value; + } @else if $name == "weight" { + font-weight: $value; + } @else if $name == "line-height" { + line-height: $value; + } @else if $name == "style" { + font-style: $value; + } @else if $name == "text-transform" { + text-transform: $value; + } @else if $name == "text-decoration" { + text-decoration: $value; + } + } +} \ No newline at end of file