To enable darkmode variants simply add the following lines to the theme/extend section of your tailwind config
screens: {
'dark-mode': {'raw': '(prefers-color-scheme: dark)'},
},
This enables the dark-mode
variant for your classes. You are now able to use dark-mode:bg-gray-900
on your site.