You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
plugin.js hard-codes .dark class selectors instead of respecting Tailwind's darkMode config #1131
Flowbite's plugin.js contains 22 hard-coded .dark class selectors that don't respect Tailwind's darkMode configuration. This means if a project uses a custom dark mode selector — which Tailwind v3 and v4 both explicitly support — Flowbite's dark styles for form controls, tooltips, and charts silently break.
For example, Tailwind v4 lets you customize the dark variant:
@variant dark (&:where([data-theme="dark"], [data-theme="dark"] *));
And Tailwind v3 supports:
darkMode: ['selector','[data-theme="dark"]']
But Flowbite's plugin ignores this and emits hard-coded .dark selectors that won't match.
These selectors should respect the project's configured dark mode selector rather than hard-coding .dark. The plugin could read the dark mode config from Tailwind's context and generate selectors accordingly, or use Tailwind's dark: variant properly.
Context
Flowbite v3.0 moved many dark styles to CSS variables (reducing hard-coded .dark selectors from ~39 in v2.x to ~22 in v4.x), but form controls, tooltips, and chart integrations were not migrated. Projects using Tailwind's native custom dark mode selector support currently need a workaround of applying both their custom selector and class="dark" on <html> to keep Flowbite working.
Activity