tailwind color set for dark code example

Example 1: tailwind add theme colors

// tailwind.config.js
module.exports = {
  theme: {
    colors: {
      transparent: 'transparent',
      current: 'currentColor',
      blue: {
        light: '#85d7ff',
        DEFAULT: '#1fb6ff',
        dark: '#009eeb',
      },
      pink: {
        light: '#ff7ce5',
        DEFAULT: '#ff49db',
        dark: '#ff16d1',
      },
      gray: {
        darkest: '#1f2d3d',
        dark: '#3c4858',
        DEFAULT: '#c0ccda',
        light: '#e0e6ed',
        lightest: '#f9fafc',
      }
    }
  }
}

Example 2: tailwind css dark mode

<div class="bg-white dark:bg-gray-800">
  <h1 class="text-gray-900 dark:text-white">Dark Mode!!</h1>
  <p class="text-gray-600 dark:text-gray-300">
    Example Text
  </p>
</div>
/* NOT MINE THO Dislike if not working i'll remove*/

/* tailwind.config.js  (JAVASCRIPT FILE)*/
module.exports = {
  darkMode: 'media',
}

Tags:

Misc Example