Environment
- Phoenix version (mix deps): 1.8.0
Actual behavior
Using the dark prefix doesn't work when the selected theme is system. Selecting dark adds the data-theme="dark" attribute to the document and
@custom-variant dark (&:where([data-theme=dark], [data-theme=dark] *));
applies it. When the system switches to dark mode and the selected theme is not dark, Tailwind doesn't apply the variant as it doesn't know the color mode has changed:
Now instead of dark:* utilities being applied based on prefers-color-scheme, they will be applied whenever the dark class is present earlier in the HTML tree
from Tailwind docs
Expected behavior
Using the system theme should pick up dark mode.
Environment
Actual behavior
Using the
darkprefix doesn't work when the selected theme issystem. Selectingdarkadds thedata-theme="dark"attribute to the document andapplies it. When the system switches to dark mode and the selected theme is not
dark, Tailwind doesn't apply the variant as it doesn't know the color mode has changed:from Tailwind docs
Expected behavior
Using the
systemtheme should pick up dark mode.