Skip to content
PluginStats

tailwind-css-variables-theme-generator weekly downloads statistics

By sonofmagic (3 listings) · npm · Tailwind plugins

help you generate tailwindcss css variables utilities and change theme esaily by expose your scss variables

View on npm Fresh · Dec 6, 2026

tailwind-css-variables-theme-generator has 47 recorded weekly downloads on npm, an increase of 88.0% over the past 30 days, ranking #2785 of 3,247 tracked listings.

Weekly downloads
47
Official API · Dec 5, 2026
7-day growth
+236%
+33 weekly downloads
30-day growth
+88.0%
+22 weekly downloads
90-day growth
+292%
+35 weekly downloads
Rank
#2785
▲ 111 in 7 days

About tailwind-css-variables-theme-generator

tailwind-css-variables-theme-generator

English

一种基于 tailwindcss 的 just-in-time 模式的动态多主题色快速生成,和管理方案。

特性

  • 可作为 tailwindcss 插件运行, tailwindcss IDE 智能提示插件友好
  • 全局的 scss 变量注入 (additionalData)
  • 生成 scss 工具类,方案自由可完全由前端或者后端数据自定义

使用方式

安装
npm i -D tailwind-css-variables-theme-generator sass
# or
yarn add -D tailwind-css-variables-theme-generator sass
准备需要被暴露的变量文件
  1. 创建一个或者多个 sass:map:
// constants.scss
$root-vars: (
  --color-canvas-default-transparent: rgba(32, 54, 85, 0),
  --color-marketing-icon-primary: #053c74,
  --color-custom-text-color: #546821
);
// another style
$root-style1-vars: (
  --color-canvas-default-transparent: rgba(21, 89, 184, 0),
  --color-marketing-icon-primary: #0b121a,
  --color-custom-text-color: #43463e
);
// another style
$root-style2-vars: (
  --color-canvas-default-transparent: rgba(89, 101, 117, 0),
  --color-marketing-icon-primary: #003879,
  --color-custom-text-color: #314215,
);

小技巧:你可以直接从 chrome devtool 把其他网站,所有的变量全部复制下来之后,只要把 ';' 符号替换成 ',',就快速产生了一个 sass:map。

  1. 把这些数据提取出来
// expose.scss
// 刚刚那个文件
@use './constants.scss' as C;
// same as expose-with-selector(C.$root-style1-vars, ":root")
$style0: expose(C.$root-vars); 
$style1: expose-with-selector(C.$root-style1-vars, "[data-color-mode='light']");
$style2: expose-with-selector(C.$root-style2-vars, "[data-color-mode='dark']");

这样数据部分就准备完成了!

作为 Tailwindcss Plugin 来使用

在 tailwind.config.js 中引入,并添加配置:

const { createPlugin } = require('tailwind-css-variables-theme-generator')

/** @type {import('tailwindcss').Config} */
module.exports = {
  // ...
  plugins: [
    createPlugin({
      // 推荐使用绝对路径,相对路径基于 process.cwd ,一旦 cwd 路径不对插件容易报错
      entryPoint: 'path/to/expose.scss'
    })
  ],
}

添加后,插件会自动去修改 theme.extend.colors 和 @tailwind base;,把主题颜色和css变量,自动注入进来。

这时候你就可以写:

<div class="text-color-custom-text-color">
  <p class="bg-color-canvas-default-transparent/70">hello</p>
</div>

默认的生成类名为tailwindcss变量前缀(text,bg,border...),加自定义变量名

插件会自动生成 css:

:root {--color-canvas-default-transparent: 32 54 85;--color-marketing-icon-primary: 5 60 116;--color-custom-text-color: 84 104 33
}
[data-color-mode='light'] {--color-canvas-default-transparent: 21 89 184;--color-marketing-icon-primary: 11 18 26;--color-custom-text-color: 67 70 62
}
[data-color-mode='dark'] {--color-canvas-default-transparent: 89 101 117;--color-marketing-icon-primary: 0 56 121;--color-custom-text-color: 49 66 21
}
*, ::before, ::after {--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x:  ;--tw-pan-y:  ;--tw-pinch-zoom:  ;--tw-scroll-snap-strictness: proximity;--tw-ordinal:  ;--tw-slashed-zero:  ;--tw-numeric-figure:  ;--tw-numeric-spacing:  ;--tw-numeric-fraction:  ;--tw-ring-inset:  ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / 0.5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur:  ;--tw-brightness:  ;--tw-contrast:  ;--tw-grayscale:  ;--tw-hue-rotate:  ;--tw-invert:  ;--tw-saturate:  ;--tw-sepia:  ;--tw-drop-shadow:  ;--tw-backdrop-blur:  ;--tw-backdrop-brightness:  ;--tw-backdrop-contrast:  ;--tw-backdrop-grayscale:  ;--tw-backdrop-hue-rotate:  ;--tw-backdrop-invert:  ;--tw-backdrop-opacity:  ;--tw-backdrop-saturate:  ;--tw-backdrop-sepia:  
}
::backdrop {--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x:  ;--tw-pan-y:  ;--tw-pinch-zoom:  ;--tw-scroll-snap-strictness: proximity;--tw-ordinal:  ;--tw-slashed-zero:  ;--tw-numeric-figure:  ;--tw-numeric-spacing:  ;--tw-numeric-fraction:  ;--tw-ring-inset:  ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / 0.5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur:  ;--tw-brightness:  ;--tw-contrast:  ;--tw-grayscale:  ;--tw-hue-rotate:  ;--tw-invert:  ;--tw-saturate:  ;--tw-sepia:  ;--tw-drop-shadow:  ;--tw-backdrop-blur:  ;--tw-backdrop-brightness:  ;--tw-backdrop-contrast:  ;--tw-backdrop-grayscale:  ;--tw-backdrop-hue-rotate:  ;--tw-backdrop-invert:  ;--tw-backdrop-opacity:  ;--tw-backdrop-saturate:  ;--tw-backdrop-sepia:  
}
.bg-color-canvas-default-transparent\\/70 {background-color: rgb(var(--color-canvas-default-transparent) / 0.7)
}
.text-color-custom-text-color {--tw-text-opacity: 1;color: rgb(var(--color-custom-text-color) / var(--tw-text-opacity))
}

当然工具类的名称是可以自定义的,比如要去除 -color- 这样的变量前缀,就可以这样配置:

createPlugin({
  entryPoint: 'path/to/expose.scss',
  intelliSense: {
    // formatter var name
    getVarName (str) {
      return str.substring(8)
    },
    // getVarValue (str){
    //   return str
    // }
  },
  // use `page` selector replace `:root`
  // injectSelector: 'page'
})

这样,上述的类名就变成了这样:

<div class="text-custom-text-color">
  <p class="bg-canvas-default-transparent/70">hello</p>
</div>
作为 Nodejs 脚本来使用

当作为 Nodejs 脚本来使用时,核心表现为生成文件,让用户自定义引入哪些文件进行使用。

例如:

const { generateSync } = require('tailwind-css-variables-theme-generator')
const path = require('path')
// 在 expose.scss 所在目录生成文件
generateSync({
  entryPoint: path.resolve(__dirname, 'path/to/expose.scss')
})

当然也有更精细的文件生成配置:

const { generateSync } = require('tailwind-css-variables-theme-generator')
const path = require('path')…

Description from the npm listing.

  • tailwindcss
  • css
  • generator
  • theme
  • variables
  • tailwindcss theme
  • tailwindcss-utility
  • tailwindcss-plugin
  • css variables
  • tailwindcss multi theme

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

tailwind-css-variables-theme-generator weekly downloads on npm, last 90 days: 47 weekly downloads as of Dec 5, 2026, +292% over 90 days.tailwind-css-variables-theme-generatorWeekly downloads on npm · Last 90 days47downloads / week+292% over 90 days0102030405060Sep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
tailwind-css-variables-theme-generator weekly downloads on npm, last 90 days: 47 weekly downloads as of Dec 5, 2026, +292% over 90 days.

7/30/90-day growth

tailwind-css-variables-theme-generator weekly downloads growth on npm: +236% over 7 days, +88.0% over 30 days, +292% over 90 days.tailwind-css-variables-theme-generatorWeekly downloads growth on npm47downloads / week now7-day growth+33 weekly downloads+236%30-day growth+22 weekly downloads+88.0%90-day growth+35 weekly downloads+292%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
tailwind-css-variables-theme-generator weekly downloads growth on npm: +236% over 7 days, +88.0% over 30 days, +292% over 90 days.

Ranking history

tailwind-css-variables-theme-generator npm ranking history: currently #2785 (by weekly downloads).tailwind-css-variables-theme-generatornpm ranking · by weekly downloads · Last 90 days#2785current rank#1600#1800#2000#2200#2400#2600#2800#3000Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 18, 2026 – Dec 6, 2026 · 44 observations · Updated Dec 5, 2026pluginstats.com
tailwind-css-variables-theme-generator npm ranking history: currently #2785 (by weekly downloads).

Listing placement

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

Listing placement

Tailwind plugins292 listings · 15 pages · page 7, #16 (overall #136)
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 (170)
Recent weekly downloads observations for tailwind-css-variables-theme-generator
Date (UTC)Weekly downloadsChange vs. previous
47+1
46-6
520
52+38
14+2
120
12-2
140
14-12
26-1
270
27-3
300
30—

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/tailwind-css-variables-theme-generator. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.