We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
No description provided.
The text was updated successfully, but these errors were encountered:
Would you provide more information? What are you trying?
Sorry, something went wrong.
I found a solution to this problem.
I have 3 custom fonts called MyFont-Regular, MyFont-Light, MyFont-Bold in repo/public/fonts/. And I want to use them as tailwindcss classes.
repo/public/fonts/
// nuxt.config.ts module.exports = { // other configs theme: { extend: { fontFamily: { span: ['MyFont', 'sans-serif'], sans: ['MyFont', 'sans-serif'], display: ['MyFont', 'sans-serif'], custom: ['MyFont'], }, fontWeight: { light: 300, normal: 400, bold: 700, }, }, utilities: { fontCustom: { fontFamily: 'MyFont', }, fontLight: { fontWeight: 'light', }, fontNormal: { fontWeight: 'normal', }, fontBold: { fontWeight: 'bold', }, }, }, }
// app.css @tailwind; @tailwind base; @tailwind components; @tailwind utilities; @font-face { font-family: 'MyFont'; src: url('~public/fonts/MyFont-Light.otf'); font-weight: 300; font-style: normal; font-display: swap; } @font-face { font-family: 'MyFont'; src: url('~public/fonts/MyFont-Regular.otf'); font-weight: 400; font-style: normal; font-display: swap; } @font-face { font-family: 'MyFont'; src: url('~public/fonts/MyFont-Bold.otf'); font-weight: 700; font-style: normal; font-display: swap; }
Example of using MyFont
<template> <span class="text-md text-cell-dark font-bold">{{ text }}</span> </template>
No branches or pull requests
No description provided.
The text was updated successfully, but these errors were encountered: