feature: Add mixin to generate typography css classes

This commit is contained in:
GOMA 2025-07-16 13:34:49 +02:00
parent 259fb3b91f
commit 6274d4d814

View File

@ -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: “” // If the variable has no prefix, don't assign anything to the $prefix attribute, leave its default value: “”
@mixin generate-css-variables($map, $prefix: "") { @mixin generate-css-variables($map, $prefix: "") {
@if $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;
}
}
}