CSS Variables Question

I have looked and looked for an answer to this, and I have come across zero examples of what I mean, so I'm guessing it's not possible. I was wondering if there is a way to apply multiple values to a single variable. So, you could create one variable which dictates the font family AND the font size? Is that possible?? Thanks!
2 Replies
MarkBoots
MarkBoots2mo ago
you could use the font shorthand property
:root{
--font-main: 1.2rem "Comic Sans";
}
body {
font: var(--font-main);
}
:root{
--font-main: 1.2rem "Comic Sans";
}
body {
font: var(--font-main);
}
https://developer.mozilla.org/en-US/docs/Web/CSS/font
MDN Web Docs
font - CSS: Cascading Style Sheets | MDN
The font CSS shorthand property sets all the different properties of an element's font. Alternatively, it sets an element's font to a system font.
salentipy
salentipy2mo ago
Ooooh thank you! I don't recall coming across a single example with something like that in it today.