Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View jan-heise's full-sized avatar

Jan Heise jan-heise

  • dasMinisterium.com Werbeagentur GmbH
  • Wuppertal, Germany
  • 15:45 (UTC +02:00)
View GitHub Profile
@jan-heise
jan-heise / readme.md
Created April 22, 2020 06:56
Enable Darkmode Variants in TailwindUI depending on OS / Browser Settings

Enable Darkmode Variants in TailwindUI depending on OS / Browser Settings

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.