Skip to content

SvelteKit and Tailwind set up guide doesn't seem to work #14678

Answered by wongjn
john-pome asked this question in Help
Discussion options

You must be logged in to vote

Your project does seem to be working for me:

Without the tailwind class in the h1 tag it just renders as a paragraph text. Is that expected behavior to override the html tags?

This is expected behavior, as per the documentation:

Headings are unstyled

All heading elements are completely unstyled by default, and have the same font-size and font-weight as normal text.

h1,
h2,
h3,
h4,
h5,
h6 {
  font-size: inherit;
  font-weight: inherit;
}

The reason for this is two-fold:

  • It helps you avoid accidentally deviating from your type scale. By default, browsers assign sizes to headings that don't exist in Tailwind's default type scale, and aren't guaranteed to exist in your own type scale.
  • In…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@wongjn
Comment options

Answer selected by john-pome
@john-pome
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