2022-08-18 19:51:53 +02:00
|
|
|
@use "design-system";
|
|
|
|
@use "sass:map";
|
|
|
|
|
|
|
|
$text-variants: (
|
|
|
|
display: ("md"),
|
|
|
|
heading: ( "sm", "md", "lg"),
|
|
|
|
body: ("xs", "sm", "sm-bold", "md", "md-bold", "lg-medium"),
|
|
|
|
);
|
|
|
|
|
|
|
|
// Variable output mixin
|
|
|
|
// screen size, type, size
|
|
|
|
|
|
|
|
@mixin textVariables($type, $size) {
|
|
|
|
font-family: var(--typography-s-#{$type}-#{$size}-font-family);
|
|
|
|
font-weight: var(--typography-s-#{$type}-#{$size}-font-weight);
|
|
|
|
font-size: var(--typography-s-#{$type}-#{$size}-font-size);
|
|
|
|
line-height: var(--typography-s-#{$type}-#{$size}-line-height);
|
|
|
|
letter-spacing: var(--typography-s-#{$type}-#{$size}-letter-spacing);
|
|
|
|
|
|
|
|
@include screen-md-min {
|
|
|
|
font-family: var(--typography-l-#{$type}-#{$size}-font-family);
|
|
|
|
font-weight: var(--typography-l-#{$type}-#{$size}-font-weight);
|
|
|
|
font-size: var(--typography-l-#{$type}-#{$size}-font-size);
|
|
|
|
line-height: var(--typography-l-#{$type}-#{$size}-line-height);
|
|
|
|
letter-spacing: var(--typography-l-#{$type}-#{$size}-letter-spacing);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2022-12-01 18:26:19 +01:00
|
|
|
.mm-text {
|
2022-08-18 19:51:53 +02:00
|
|
|
// Set default styles
|
|
|
|
color: var(--color-text-default);
|
2023-01-13 22:58:09 +01:00
|
|
|
font-family: var(--font-family-sans);
|
2022-08-18 19:51:53 +02:00
|
|
|
|
2023-04-26 21:46:03 +02:00
|
|
|
> strong {
|
|
|
|
font-weight: var(--font-weight-bold);
|
|
|
|
}
|
|
|
|
|
2022-08-18 19:51:53 +02:00
|
|
|
@each $type, $size-options in $text-variants {
|
|
|
|
&--#{$type} {
|
|
|
|
// Sets a default
|
|
|
|
@include textVariables($type, "md");
|
|
|
|
// Generates all the size options
|
|
|
|
@each $size in $size-options {
|
|
|
|
&-#{$size} {
|
|
|
|
@include textVariables($type, $size);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@each $weight in $font-weight {
|
|
|
|
&--font-weight-#{$weight} {
|
|
|
|
@if $weight == "medium" {
|
|
|
|
font-weight: var(--font-weight-medium);
|
|
|
|
}
|
|
|
|
|
|
|
|
@else {
|
|
|
|
font-weight: $weight;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@each $style in $font-style {
|
|
|
|
&--font-style-#{$style} {
|
|
|
|
font-style: $style;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@each $alignment in $text-align {
|
|
|
|
&--text-align-#{$alignment} {
|
|
|
|
text-align: $alignment;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@each $overflow in $overflow-wrap {
|
|
|
|
&--overflow-wrap-#{$overflow} {
|
|
|
|
overflow-wrap: $overflow;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-04 18:55:51 +02:00
|
|
|
&--inherit {
|
|
|
|
font-family: inherit;
|
|
|
|
font-weight: inherit;
|
|
|
|
font-size: inherit;
|
|
|
|
line-height: inherit;
|
|
|
|
letter-spacing: inherit;
|
|
|
|
}
|
|
|
|
|
2022-08-18 19:51:53 +02:00
|
|
|
&--ellipsis {
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
white-space: nowrap;
|
|
|
|
overflow: hidden;
|
|
|
|
}
|
|
|
|
|
|
|
|
&--text-transform-uppercase {
|
|
|
|
text-transform: uppercase;
|
|
|
|
}
|
|
|
|
|
|
|
|
&--text-transform-lowercase {
|
|
|
|
text-transform: lowercase;
|
|
|
|
}
|
|
|
|
|
|
|
|
&--text-transform-capitalize {
|
|
|
|
text-transform: capitalize;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|