-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
detect font weights automatically #209
Comments
Hello, @ojvribeiro! I'm here to assist you with any questions or issues you have. Let's tackle this one together! The Here's an example of how you can define custom font weights: @font-face {
font-family: 'Roboto';
src: url('/path/to/roboto-regular.woff2') format('woff2'),
url('/path/to/roboto-regular.woff') format('woff');
font-weight: 400;
font-style: normal;
}
@font-face {
font-family: 'Roboto';
src: url('/path/to/roboto-bold.woff2') format('woff2'),
url('/path/to/roboto-bold.woff') format('woff');
font-weight: 700;
font-style: normal;
}
@font-face {
font-family: 'Roboto';
src: url('/path/to/roboto-medium.woff2') format('woff2'),
url('/path/to/roboto-medium.woff') format('woff');
font-weight: 500;
font-style: normal;
} You can then use these weights in your Tailwind CSS classes: <span class="font-roboto">...</span>
<span class="font-roboto font-bold">...</span>
<span class="font-roboto font-medium">...</span> This approach ensures that all specified font weights are available for use in your project [1]. |
What bot says is partly correct. |
@qwerzl I think my question remains: can the module detect font weights besides 400 and 700? As I showed in my code example, weights like I created this repro: https://stackblitz.com/edit/nuxt-starter-pngpso?file=app.vue Edit: by creating the reproduction, I noticed that it doesn't work if I use a custom font-family utility class created in |
Hi @ojvribeiro , I noticed the same behavior. I even suspected it was because the download of the font file failed. 😂😂😂 Now I added the configuration about font weight in the
|
@danielroe In the meantime, would it be worth highlighting this a little more prominent in the documentation? I too found myself struggling as to why my bold fonts weren't showing up only to realize the module's default configuration only pulls in the normal weight 🤔 I'll open up a PR with a docs suggestion to hopefully smoothen this out a bit for fellow |
thank you! that would be great |
From my testings, only weights
400
(normal) and700
(bold) are available out of the box by using the@nuxtjs/tailwindcss
module like this:Am I missing something, or do I do have to specify the other weights in the module options?
The text was updated successfully, but these errors were encountered: