Skip to content

Leptos + Tailwind + Custom fonts #669

Answered by juhinagpure
bryanmaina asked this question in Q&A
Discussion options

You must be logged in to vote

The issue you're facing is that the url() in your Tailwind CSS file is resolving relative to the location of the CSS file, which includes the /pkg part.

  1. Instead of using url(fonts/CooperHewitt-Bold.woff), use /fonts/CooperHewitt-Bold.woff.
  2. This way, it looks directly in the root /fonts directory, bypassing the /pkg folder

@font-face {
font-family: 'Cooper Hewitt';
font-style: normal;
font-weight: 700;
src: local('Cooper Hewitt'), url('/fonts/CooperHewitt-Bold.woff') format('woff');
}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@bryanmaina
Comment options

Answer selected by bryanmaina
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants