importing Google fonts
Answered
Oriental Scops-Owl posted this in #help-forum
Oriental Scops-OwlOP
is there some way / standard to import google fonts via CDN URL? I absolutely do not want to use className={} on every element im trying to change fonts for. id rather be able to declare it in generic CSS inside a global css file for elements such as h1, p, body etc
Answered by Oriental Scops-Owl
i got it working using css variables although i still dislike the approach nextjs has taken with fonts
8 Replies
Netherland Dwarf
You dont have to,
You can simply add classname in layout
And then in the styles.scss add the font family
This the hacky way to do it
Oriental Scops-OwlOP
gonna try CSS variables section here https://nextjs.org/docs/pages/api-reference/components/font
Oriental Scops-OwlOP
i got it working using css variables although i still dislike the approach nextjs has taken with fonts
Answer
Netherland Dwarf
I personally like it, what i do is i export all fonts in a single file and simply call the exported reference.
well it's opinionated. some people like it, some don't