2

I'm trying to customise react datepicker's inside elements(calendar, headers, nav buttons) in dark & light mode while using with Tailwind css? In the below image- I'm looking to change css for those light coloured areas.

dark mode datepicker

I tried giving Tailwind's dark classes directly to Datepicker component--> doesn't work. Tried applying css through global css file as below --> doesn't work

react-datepicker__time-list {
  background-color: #fff;
  color: #000;
}
@media screen and (prefers-color-scheme: dark) {
  .react-datepicker__time-box,
  react-datepicker__time-list {
    background-color: #000;
    color: #fff;
  }
}

Is there is any className property I can apply to each components inside the Datepicker element for dark/light mode? Can someone help me here?

Amila Senadheera
  • 12,229
  • 15
  • 27
  • 43
AmeeraJ
  • 71
  • 1
  • 5

0 Answers0