Skip to content

Custom font doesn't work with css var #18073

Discussion options

You must be logged in to vote

Hey!

This is because the default text reads the CSS variable from :root, but you define the variable somewhere nested in the tree. So at the time of reading the variable for the default --font-mono it's still the default monospaced value not the new one you set deeply nested.

If you want the default text to be set, hoist the custom font up, e.g. in :root: https://play.tailwindcss.com/AHhxHtJmP7?file=css

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by PhotonQuantum
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
Converted from issue

This discussion was converted from issue #18072 on May 17, 2025 09:48.