Skip to content
Discussion options

You must be logged in to vote

Hello—Thanks for posting this!

The reason _tw doesn't wrap imports from Tailwind in @layer is because WordPress's own styles don't use @layer, so if you're using WordPress's own styles, Tailwind isn't able to override them. (Styles outside @layer will take precedence over those inside @layer.)

If you're disabling all of the core stylesheets, your approach shouldn't have any side effects. If you need, e.g., default block editor styles, and you're hoping to add styles from Tailwind on top of that, you may run into issues with Preflight styles not being applied to block editor elements in the way you'd expect.

That said, since you're selective wrapping only Preflight, I think there's a chanc…

Replies: 1 comment 2 replies

Comment options

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

@gregsullivan
Comment options

Answer selected by boynet
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