This is what I have in fonts.css (in styles/common). app.css is like this:
@import 'common/fonts.css';
/* stylelint-disable scss/at-rule-no-unknown */
@tailwind base;
@tailwind components;
@tailwind utilities;
@layer base {
address {
@apply not-italic;
}
/* Setting base for focus style */
/* :is(a, button, input, textarea, summary,[tabindex="0"]) {
@apply focus:outline-none ring-focusring ring-offset-2 ring-offset-white focus:ring-2
} */
/* Remove all animations and transitions
for people that prefer not to see them */
@media (prefers-reduced-motion: reduce) {
*,
*::before,
*::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
scroll-behavior: auto !important;
}
}
}
@layer components {...}
In editor.css I only have this string @import 'common/fonts.css';
Obviously I have fonts in resources/fonts.
I run ‘yarn build’ command too.
Do you know how to solve this?
P.S.
The import was: @import 'common/fonts'; (without .css) but VS Code was not linking the file correctly. I tried anyway both and no one is properly working
I followed the guide. The only thing I have not done is to configure theme.json because it says is generated automatically by bud.
Not loading properly means that I don’t see text changing on the website.
On VS Code if I click on @fonts/open-sans-regular.woff2 will say it cannot be found. But, bud build recognize properly fonts in assets.
For the last two questions, can you please explain what are you talking about?
To to confirm, we’re only talking about fonts not showing up in the editor?
You must make the changes to the Tailwind config and Bud config as shown in the guide, and then run the build (which generates theme.json), in order for your fonts to be working in the editor. You could verify this by seeing that your theme.json file currently doesn’t reference your custom font, since you haven’t yet updated your Bud config per the guide.
You are right, it worked. But, I haven’t changed that part because it says ’ theme.json can be configured for the new font’. So, I understood that theme.json would be like that after bud build. This is why I told you before ‘The only thing I have not done is to configure theme.json because it says is generated automatically by bud.’