Skip to content
PluginStats

css-typed-vars weekly downloads statistics

By StanislavKozachenko · npm · Webpack plugins

Generate TypeScript typed constants from CSS custom properties

View on npm Fresh · Dec 6, 2026

css-typed-vars has 790 recorded weekly downloads on npm, an increase of 1134% over the past 30 days, ranking #2144 of 3,247 tracked listings.

Weekly downloads
790
Official API · Dec 5, 2026
7-day growth
+90.4%
+375 weekly downloads
30-day growth
+1134%
+726 weekly downloads
90-day growth
+276%
+580 weekly downloads
Rank
#2144
▲ 63 in 7 days

About css-typed-vars

<img src="https://repository-images.githubusercontent.com/1204912196/ef5412c5-0846-4b94-bf5d-811202144eb9" alt="css-typed-vars" /> <h1>css-typed-vars</h1> <p>Generate TypeScript typed constants from CSS custom properties</p> <p><a href="https://stanislavkozachenko.github.io/css-typed-vars/">📖 Full documentation</a></p> <p> <a href="https://github.com/StanislavKozachenko/css-typed-vars/actions"><img src="https://github.com/StanislavKozachenko/css-typed-vars/actions/workflows/ci.yml/badge.svg" alt="CI" /></a> <a href="https://www.npmjs.com/package/css-typed-vars"><img src="https://img.shields.io/npm/v/css-typed-vars" alt="npm version" /></a> <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/github/license/StanislavKozachenko/css-typed-vars" alt="MIT License" /></a> </p>

var(--color-primary) is just a string. Rename the variable — the error shows up only in the browser.

css-typed-vars scans your CSS files and gives you typed constants. Use cssVars.colorPrimary instead — TypeScript catches missing variables at compile time.

Each generated key also carries a /** @default ... */ comment with the property's declared CSS value, so your editor shows it on hover and autocomplete. A value written over several lines (a font stack, a list of shadows) is joined into one. If the variable is registered with @property, its syntax descriptor shows up too, and an enum-like syntax (e.g. "light | dark | system") gets its own exported TS union type.

Installation

npm install -D css-typed-vars

Requires Node.js 20.19+ or 22.12+.

Two approaches

CLIPlugin
How it worksGenerates cssVars.ts in your projectVirtual module, no file generated
Importimport { cssVars } from './cssVars'import { cssVars } from 'css-typed-vars/vars'
Watch--watch flagvite dev, browser reloads automatically
Works withEverythingVite, webpack, Rollup, esbuild (not Turbopack)

CLI

Create a config file in your project root:

// css-typed-vars.config.js
export default {
  input: 'src/styles/**/*.{css,scss}',
  output: 'src/cssVars.ts',
};

Then run:

npx css-typed-vars         # generate once
npx css-typed-vars --watch # watch for changes

Add to your package.json scripts:

{
  "scripts": {
    "generate:vars": "css-typed-vars",
    "generate:vars:watch": "css-typed-vars --watch"
  }
}

Given this CSS:

:root {
  --color-primary: #3b82f6;
  --spacing-md: 8px;
}

Generates src/cssVars.ts:

// generated — do not edit
export const cssVars = {
  colorPrimary: 'var(--color-primary)',
  spacingMd: 'var(--spacing-md)',
} as const;

export type CssVarName = keyof typeof cssVars;
CLI flags
npx css-typed-vars --input "src/styles/**/*.css" --output src/cssVars.ts
npx css-typed-vars --input "src/styles/**/*.{css,scss}" --output src/cssVars.ts --watch
npx css-typed-vars --input "src/**/*.css" --output src/cssVars.ts --exclude "**/vendor/**"
npx css-typed-vars --input "src/**/*.css" --output src/cssVars.ts --prefix theme --naming snake
npx css-typed-vars --input "src/**/*.css" --output src/cssVars.js  # generates .js + .d.ts
npx css-typed-vars --input "src/**/*.css" --output tokens.json      # W3C design tokens (DTCG) JSON
npx css-typed-vars --input "src/**/*.css" --output src/cssVars.ts --selector ".dark" --selector "[data-theme='dark']"
npx css-typed-vars --input "src/**/*.css" --output src/cssVars.ts --check  # for CI: exits 1 if out of date
npx css-typed-vars --input "src/**/*.css" --output src/cssVars.ts --group  # nest keys by first name segment
npx css-typed-vars --input "src/**/*.css" --output src/cssVars.ts --prune --usage "src/**/*.{ts,tsx}"        # drop unused vars from the output
npx css-typed-vars --input "src/**/*.css" --output src/cssVars.ts --prune-check --usage "src/**/*.{ts,tsx}"  # for CI: exits 1 if any var is unused
```…

Description from the npm listing.

  • css
  • scss
  • less
  • css-variables
  • custom-properties
  • typescript
  • codegen
  • typed
  • vite-plugin
  • unplugin
  • webpack-plugin
  • rollup-plugin
  • esbuild-plugin
  • design-tokens
  • dtcg
  • tailwindcss

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

css-typed-vars weekly downloads on npm, last 90 days: 790 weekly downloads as of Dec 5, 2026, +276% over 90 days.css-typed-varsWeekly downloads on npm · Last 90 days790downloads / week+276% over 90 days02004006008001KSep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
css-typed-vars weekly downloads on npm, last 90 days: 790 weekly downloads as of Dec 5, 2026, +276% over 90 days.

7/30/90-day growth

css-typed-vars weekly downloads growth on npm: +90.4% over 7 days, +1134% over 30 days, +276% over 90 days.css-typed-varsWeekly downloads growth on npm790downloads / week now7-day growth+375 weekly downloads+90.4%30-day growth+726 weekly downloads+1134%90-day growth+580 weekly downloads+276%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
css-typed-vars weekly downloads growth on npm: +90.4% over 7 days, +1134% over 30 days, +276% over 90 days.

Ranking history

css-typed-vars npm ranking history: currently #2144 (by weekly downloads).css-typed-varsnpm ranking · by weekly downloads · Last 90 days#2144current rank#1600#1700#1800#1900#2000#2100#2200#2300Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankNov 13, 2026 – Dec 6, 2026 · 24 observations · Updated Dec 5, 2026pluginstats.com
css-typed-vars npm ranking history: currently #2144 (by weekly downloads).

Listing placement

All npm3,247 listings · 163 pages · 1,084 shown · page 108, #4 (overall #2,144)
All npm: every listing in weekly downloads order

Listing placement

Webpack plugins349 listings · 18 pages · page 5, #5 (overall #85)
Webpack 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 (142)
Recent weekly downloads observations for css-typed-vars
Date (UTC)Weekly downloadsChange vs. previous
790+86
704-152
856+118
738+191
547+109
438+16
422+7
415-2
417+163
254-165
419+34
385+4
381+144
237—

Similar npm Webpack plugins plugins

All 20 css-typed-vars 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/css-typed-vars. First seen Nov 13, 2026; last successful collection Dec 6, 2026. See the methodology.