Hi,
In my latest Astro project (https://www.webmoov.be) I'm using the Tailwind Integration.
Now I want to add a custom font to my project. I have defined this custom font in tailwind.config.mjs:
fontFamily: {
tommy: ['Tommy Soft Bold', 'sans-serif'],
tommyfat: ['TommySoftBlack', 'sans-serif'],
body: ['inter-variable', 'sans-serif'] }
but I also need to define an @layer base directive in a .css file:
@layer base {
@font-face {
font-family: 'TommySoftBlack';
src: url('MADE-Tommy-Soft-Black.otf') format('otf');
font-weight: 900;
font-style: bold;
font-display: swap;
}
}
I need to add this in base.css, but this file is injected automatically in every page, so I don't know how I can add this @layer directive to my project.
Does anyone have experience configuring a custom font in a Astro project using Tailwind?
Thanks for your help,
Anthony
