Skip to content
Discussion options

You must be logged in to vote

Fix without !important

  1. Scope your global p styles
    Instead of p { … } in app.css, do something like:
/* app.css */
body > p {
  /* or use a class on your layout wrapper instead of global */
}

This ensures your custom p rules don’t override .prose p.

  1. Lower precedence of global styles
    In SvelteKit with Tailwind, app.css usually gets included last. If you move your custom CSS before Tailwind’s layers, Tailwind will win:
/* app.css */
@layer base {
  p {
    @apply text-base leading-relaxed; /* this still cooperates with prose */
  }
}
  1. Only use Tailwind utilities
    Instead of raw CSS:
/* bad */
p { font-size: 1rem; }

You can:

<p class="text-base leading-relaxed">

Or set defaults with @…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by in-sg
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
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