Skip to content

How to add a custom font to Tailwind CSS 4 using the CSS configuration #18238

Answered by wongjn
ShawnXU0208 asked this question in Help
Discussion options

You must be logged in to vote

None such approach exists if you want to override said theme token. You can avoid copying if defining a new value:

@import 'tailwindcss';

@theme {
  --font-foo: "MyCustomFont", var(--font-sans);
}

Also, see #15253 (comment).

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@ShawnXU0208
Comment options

@wongjn
Comment options

wongjn Jun 6, 2025
Collaborator

Answer selected by ShawnXU0208
@ShawnXU0208
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants