-
Notifications
You must be signed in to change notification settings - Fork 8
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
|
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: