How to use different weights of font?
Answered
Acacia-ants posted this in #help-forum
![Avatar](https://cdn.discordapp.com/embed/avatars/1.png)
Acacia-antsOP
I'm importing a font provided in google font imports from nextjs. I'm importing it like this my question is how can I use this font by using its different weights in the class tags.
const barlow = Barlow({
subsets: ["latin"],
weight: ["100", "300", "200", "400"],
});
Answered by joulev
Use normal css for that?
If you use tailwind then https://tailwindcss.com/docs/font-weight
.your-class {
font-weight: 300;
}
If you use tailwind then https://tailwindcss.com/docs/font-weight
6 Replies
![Avatar](https://cdn.discordapp.com/avatars/484037068239142956/f386ac21405ce3442e0f3598223e1cb3.webp?size=256)
joulev
Use normal css for that?
If you use tailwind then https://tailwindcss.com/docs/font-weight
.your-class {
font-weight: 300;
}
If you use tailwind then https://tailwindcss.com/docs/font-weight
Answer
![Avatar](https://cdn.discordapp.com/embed/avatars/1.png)
Acacia-antsOP
so after doing like
<div classname = {
${barlow.classname} }> abc </div>
I have to create/use a tailwind class to do that?![Avatar](https://cdn.discordapp.com/avatars/484037068239142956/f386ac21405ce3442e0f3598223e1cb3.webp?size=256)
joulev
If you are using tailwind you can use a tailwind class, else you just… specify the font weight with css/inlined style like you would do for text colours, font size, etc
It’s just css
![Avatar](https://cdn.discordapp.com/embed/avatars/1.png)
Acacia-antsOP
okay got it
thanks for the help mate!!