font variable is not defined
Answered
Acacia-ants posted this in #help-forum
Acacia-antsOP
I use local fonts and Tailwind and added font like this in tailwind config^
If I don't use
fontFamily: {
sans: ['var(--font)', ...defaultTheme.fontFamily.sans]
}If I don't use
font-sans classname font is not applied and chrome devtools shows that variable is not defined. However, if I use it, variable is defined:<h1 className="font-normal">Hi I'm h1 tag</h1>
<h2 className="font-sans font-medium">Hi I'm h2 tag</h2>
<h3 className="font-sans font-bold">Hi I'm h3 tag</h3>Answered by Acacia-ants
Okay, the reason was I gave
to
className={`${helvetica.variable}`} to
body and not html. Therefore, html didn't know about --font variable.1 Reply
Acacia-antsOP
Okay, the reason was I gave
to
className={`${helvetica.variable}`} to
body and not html. Therefore, html didn't know about --font variable.Answer