Skip to content
PluginStats

tailwindcss-theme-variants weekly downloads statistics

By JakeNavith · npm · Tailwind plugins

Media-query- or JavaScript-based theme variants with fallback for Tailwind CSS

View on npm Fresh · Dec 6, 2026

tailwindcss-theme-variants has 1,248 recorded weekly downloads on npm, an increase of 15.2% over the past 30 days, ranking #2020 of 3,247 tracked listings.

Weekly downloads
1,248
Official API · Dec 5, 2026
7-day growth
+87.4%
+582 weekly downloads
30-day growth
+15.2%
+165 weekly downloads
90-day growth
+22.4%
+228 weekly downloads
Rank
#2020
▲ 73 in 7 days

About tailwindcss-theme-variants

🌗 Tailwind CSS Theme Variants

This Tailwind CSS plugin registers variants for theming beyond just light and dark modes without needing custom properties. It has support for

  • Controlling themes with
    • Media queries, like prefers-color-scheme, print, or anything you want
    • CSS selectors, like classes and data attributes
    • Or both at the same time!
  • Responsive variants
  • Stacking on extra variants, like hover so you can change a link's hover color depending on the theme
  • Falling back to a certain theme when no other one could become active, like if a visitor's browser doesn't support JavaScript or the new prefers- media queries
  • As many themes as you want: light theme, dark theme, red theme, blue theme—just bring your own definitions! The experimental semantics feature makes multiple themes easy to deal with!

You are recommended to check out the comparison table of all Tailwind CSS theming plugins below before committing to any one. By the way, you might have noticed this plugin's documentation / README is very long—don't let that frighten you! I designed it to be overdocumented and as exhaustive as possible, and since most of it is long code snippets, it's shorter than it looks and you don't need to go through it all to do well!

What about Tailwind's upcoming official dark mode?

This plugin will still be maintained! Light and dark mode support is just one thing this plugin can do, and the complexity this plugin can provide will not be reflected in Tailwind core (see Design Rationale), so I will still need this around.

⬇️ Installation

npm install --save-dev tailwindcss-theme-variants

🛠 Basic usage

Using selectors to choose the active theme

With this Tailwind configuration,

const { themeVariants } = require("tailwindcss-theme-variants");

module.exports = {
    theme: {
        backgroundColor: {
            "gray-900": "#1A202C",
        },
    },

    variants: {
        backgroundColor: ["light", "dark"],
    },

    plugins: [
        themeVariants({
            themes: {
                light: {
                    selector: ".light-theme",
                },
                dark: {
                    selector: ".dark-theme",
                },
            },
        }),
    ],
};

this CSS is generated:

.bg-gray-900 {
    background-color: #1A202C
}

/* If you're having trouble understanding,
   imagine it said html instead of :root,
   like in the example HTML below */

:root.light-theme .light\:bg-gray-900 {
    background-color: #1A202C
}

:root.dark-theme .dark\:bg-gray-900 {
    background-color: #1A202C
}

After also enabling "light" and "dark" variants for textColor and bringing in more colors from the default palette, we can implement a simple themed button in HTML like this:

<html class="light-theme"> <!-- Change to dark-theme -->
    <button class="light:bg-teal-200   dark:bg-teal-800 
                   light:text-teal-700 dark:text-teal-100">
        
        Sign up
    </button>
</html>

This will result in dark blue text on a light blue background in the light theme, and light blue text on a dark blue background in the dark theme.

💡 You can choose more than just classes for your selectors. Other, good options include data attributes, like [data-padding=compact]. You can go as crazy as .class[data-theme=light]:dir(rtl), for example, but I think that's a bad idea!

Using media queries to choose the active theme

You may rather choose to tie your theme selection to matched media queries, like prefers-color-scheme:

const { themeVariants, prefersLight, prefersDark } = require("tailwindcss-theme-variants");

module.exports = {
    theme: {
        backgroundColor: {
            "teal-500": "#38B2AC",
        },
    },

    variants: {
        backgroundColor: ["light", "dark"],
    },

    plugins: [
        themeVariants({
            themes: {
                light: {
                    mediaQuery: prefersLight /* "@media (prefers-color-scheme: light)" */,
                },
                dark: {
                    mediaQuery: prefersDark /* "@media (prefers-color-scheme: dark)" */,
                },
            },
        }),
    ],
};

Which generates this CSS:

.bg-teal-500 {
    background-color: #38B2AC
}

@media (prefers-color-scheme: light) {
    .light\:bg-teal-500 {
        background-color: #38B2AC
    }
}

@media (prefers-color-scheme: dark) {
    .dark\:bg-teal-500 {
        background-color: #38B2AC
    }
}

Keep the variants listed in the same order as in themes in this plugin's configuration for consistency and the most expected behavior: in backgroundColor's variants, light came first, then dark, so we also list light before dark in themeVariants's themes option.

💡 The group feature will take care of this for you!

⚙️ Full configuration

This plugin expects configuration of the form

{
    group?: string,
    
    themes: {
        [name: string]: {
            // At least one is required
            selector?: string,
            mediaQuery?: string,
        },
    },

    baseSelector?: string,
    fallback?: boolean | "compact",

    variants?: {
        [name: string]: (selector: string) => string,
    },
}

Where each parameter means:…

Description from the npm listing.

  • plugin
  • tailwind
  • tailwindcss
  • tailwindcss-plugin
  • tailwindcss-theme
  • tailwindcss-themes

README badge

Show your rank in a README or on your website. The badge updates automatically.

Charts

Images: 30d · 1y · all time · 1600×900 dark

Adoption over time

tailwindcss-theme-variants weekly downloads on npm, last 90 days: 1,248 weekly downloads as of Dec 5, 2026, +22.4% over 90 days.tailwindcss-theme-variantsWeekly downloads on npm · Last 90 days1,248downloads / week+22.4% over 90 days01K2K3K4K5K6KSep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
tailwindcss-theme-variants weekly downloads on npm, last 90 days: 1,248 weekly downloads as of Dec 5, 2026, +22.4% over 90 days.

7/30/90-day growth

tailwindcss-theme-variants weekly downloads growth on npm: +87.4% over 7 days, +15.2% over 30 days, +22.4% over 90 days.tailwindcss-theme-variantsWeekly downloads growth on npm1,248downloads / week now7-day growth+582 weekly downloads+87.4%30-day growth+165 weekly downloads+15.2%90-day growth+228 weekly downloads+22.4%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
tailwindcss-theme-variants weekly downloads growth on npm: +87.4% over 7 days, +15.2% over 30 days, +22.4% over 90 days.

Ranking history

tailwindcss-theme-variants npm ranking history: currently #2020 (by weekly downloads).tailwindcss-theme-variantsnpm ranking · by weekly downloads · Last 90 days#2020current rank#400#600#800#1000#1200#1400#1600#1800#2000#2200Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 17, 2026 – Dec 6, 2026 · 45 observations · Updated Dec 5, 2026pluginstats.com
tailwindcss-theme-variants npm ranking history: currently #2020 (by weekly downloads).

Listing placement

All npm3,247 listings · 163 pages · 1,083 shown · page 101, #20 (overall #2,020)
All npm: every listing in weekly downloads order

Listing placement

Tailwind plugins292 listings · 15 pages · page 2, #10 (overall #30)
Tailwind plugins: every listing in weekly downloads order

Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.

Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.

Recent observations

Full history (592)
Recent weekly downloads observations for tailwindcss-theme-variants
Date (UTC)Weekly downloadsChange vs. previous
1,248+57
1,191+130
1,061+37
1,024+250
774+121
653-1
654-12
666-88
754-100
854-99
953+1
952-169
1,121-46
1,167—

Similar npm Tailwind plugins plugins

All 20 tailwindcss-theme-variants alternatives

Data source

Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.

Listing: https://www.npmjs.com/package/tailwindcss-theme-variants. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.