'Store CSS font-size/line-height in Sass variable

Is there a way to store the font-size/line-height in a Sass variable like this:

$font-normal: 14px/21px;

Using this declaration I get a division as described in the documentation. Is there a way to avoid the division?
Note: I use the scss syntax.



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