react-tailwindcss-datepicker icon indicating copy to clipboard operation
react-tailwindcss-datepicker copied to clipboard

Theme is broken

Open daninus14 opened this issue 2 years ago • 4 comments

As it stands the theme is chosen based on the system choice, and not on the tailwind choice. Even if the tailwind config is not setting the dark mode, the component will be displayed in dark mode.

There should be a prop to choose the theme, and then another way to base it on the tailwind config and not on the user's system alone...

daninus14 avatar Jul 31 '23 13:07 daninus14

After restarting the server, the light theme loaded, but it still should be easier to change the theme by a prop.

Thanks!

daninus14 avatar Jul 31 '23 14:07 daninus14

Yes, I had the same problem. I didn't set a color theme, but it was using my system's one (dark), but the rest of the page was on the default (white mode), so it was weird.

This was how I fixed it:


// tailwind.config.js
{
    ...
    darkMode: 'class', // Insert this
    ...
}

Useful readings:

murilosr avatar Aug 02 '23 13:08 murilosr

@murilosr thank you so much for the workaround and for the tailwind doc links!

daninus14 avatar Aug 03 '23 14:08 daninus14

Same here. Fixed it using the workaround @murilosr suggested. Thank you.

HurSungYun avatar Aug 16 '23 08:08 HurSungYun