'Store CSS font-size/line-height in Sass variable
Solution 1:[1]
I use:$somevar: unquote("14px/17px");
Solution 2:[2]
To elaborate on @capi-etheriel 's answer:
add this to the top of the scss file:
@use "sass:list";
and than define $font-normal as:
$font-normal: list.slash(14px, 21px);
For font: to work you have to add at minimum a font-family:
p {
font: $font-normal sans-serif;
}
But I assume you realized that.
This will generate in css:
p: 14px/21px sans-serif;
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Boris Astanin |
| Solution 2 | theking2 |
