elreco / vue-tailwind-datepicker

A Vue 3 Datepicker using Tailwind CSS
https://vue-tailwind-datepicker.com
MIT License
234 stars 45 forks source link

Dark mode doesn't work in nuxt3 #83

Open henrywu-new opened 1 year ago

henrywu-new commented 1 year ago

1. tailwind.config.ts :

module.exports = { darkMode: 'class', // ... }

  1. gobal class:

html.dark { color-scheme: dark; }

roiLeo commented 1 year ago

See Theming options

in tailwind.config.ts:

export default {
  darkMode: 'class',
  theme: {
    extend: {
      colors: {
        'vtd-primary': colors.sky, // Light mode Datepicker color
        'vtd-secondary': colors.gray, // Dark mode Datepicker color
      },
    },
  }
}

wfm

elreco commented 1 year ago

@henrywu-new Does it work for you?

escalante29 commented 9 months ago

Hey @elreco this thread is not mine but I have a question. I was trying to make the light mode work, cause by default it showed up dark... After a little bit of trial and error I added to tailwind.config.js the following:

darkMode: "class",

And it worked! Now I have it light as I needed. But it doesn't make sense to me. Can you explain or tell me how/if it's possible to change the theme programatically from a vue component?

Thanks in advance!