saadeghi / daisyui

๐ŸŒผ ๐ŸŒผ ๐ŸŒผ ๐ŸŒผ ๐ŸŒผ โ€ƒThe most popular, free and open-source Tailwind CSS component library
https://daisyui.com
MIT License
34.01k stars 1.3k forks source link

bug: themes that change the default font conflicts with the ones that does not. #3272

Open dlgiovani opened 2 days ago

dlgiovani commented 2 days ago

What version of daisyUI are you using?

v4.12.14

Which browsers are you seeing the problem on?

Chrome

Reproduction URL

https://play.tailwindcss.com/lRO0Xn8ZBy

Describe your issue

Problem:

Themes such as wireframe that changes the default font will also change the font of children elements that have another data-theme that does not changes the default font.

For example, if you have this:

<div data-theme="wireframe">
  <p>Hello</p>
  <!-- this font will be serif, as expected from the theme "wireframe" -->

  <p data-theme="dark">World</p>
  <!-- this font will ALSO be serif, which is not expected for the theme "dark" -->
</div>

This seems to only occur when the parent data-theme has an explicit change to the default font, in other words, having a dark themed parent won't affect the wireframe themed children.

github-actions[bot] commented 2 days ago

Thank you @dlgiovani for reporting issues. It helps daisyUI a lot ๐Ÿ’š
I'll be working on issues one by one. I will help with this one as soon as a I find a solution.
In the meantime providing more details and reproduction links would be helpful.