Issue with Preflight overriding DaisyUI styles, is wrapping it in @layer base safe? #213
-
|
Hi, After this change, DaisyUI seems to work correctly. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
Hello—Thanks for posting this! The reason _tw doesn't wrap imports from Tailwind in 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 chance this works without issue; the bigger problem was the default Tailwind approach of wrapping everything in layers. Please let me know if you have any other questions as far as that goes! |
Beta Was this translation helpful? Give feedback.
Hello—Thanks for posting this!
The reason _tw doesn't wrap imports from Tailwind in
@layeris 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@layerwill 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…