0.0.5-beta.0 • Published 1 year ago

tailwindcss-dark-mode-plugin v0.0.5-beta.0

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

tailwindcss-dark-mode-plugin

Dark mode plugin for tailwind css

Installation

yarn add tailwindcss-dark-mode-plugin --save-dev
# or
npm install tailwindcss-dark-mode-plugin --save-dev
# or
pnpm install tailwindcss-dark-mode-plugin --save-dev

Usage Example

In your tailwind.config.js:

import plugin from "tailwindcss/plugin";
import { themeColors, themePlugin } from "tailwindcss-dark-mode-plugin";

/** @type {import('tailwindcss').Config} */
export default {
  theme: {
    colors: themeColors,
  },
  plugins: [plugin(themePlugin)],
};

Feature

  1. Use css variable mode for dark night mode injection.For :root and html#id.
  2. It depend on tailwindcss, all tailwindcss built-in colors have been rewritten.
  3. Dark mode is out of the box as long as you use tailwindcss built-in colors. You don't need to write class like dark:bg-black.

Recommendation

  1. You can configure css styles to whole document like, let it more out of the box
@layer base {
  body {
    @apply text-neutral-700;
  }
}
0.0.5-beta.0

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago

0.0.0

1 year ago