OSS Tanbou

write type-safe styles in TypeScript and extract them to static CSS at build time

About these scores

OSS scale score is an unbounded metric that log-compresses and weights Stars, Watchers, Forks, and Contributors. Discovery score is the current OSS scale score minus the score at discovery. Update pace is commits in the last 30 days, growth momentum is the OSS scale score difference within the recent observation window, and OSS health is a 0–100 rating based on available recency, Community Health, and release data.

Stars
10,435
Primary language
TypeScript
License
MIT
Repository last updated
Sep 27, 2026
On this page

Overview

vanilla-extract is a styling library that defines styles in TypeScript or JavaScript and generates static CSS during the build. Code in .css.ts files can produce locally scoped classes, CSS variables, themes, keyframes, and other CSS constructs with type safety while remaining frontend-framework agnostic.

Features and best fit

Based on official documentation; not hands-on tested · Content checked:

Key features

Generate locally scoped CSS classes from TypeScript

Calling style() in a .css.ts file produces static CSS and a locally scoped class name during the build, allowing style definitions to stay out of the application's runtime bundle.

Sources: [2][4]

Model CSS variables and themes as typed objects

APIs such as createTheme map design tokens to CSS variables so colors, typography, spacing, and related values can be referenced through TypeScript while still using standard CSS primitives.

Sources: [2]

Best fit

Fits design systems and component libraries that want styles and types to stay aligned

It is useful when applications or design systems want scoped classes and typed design tokens without coupling the styling layer to React or another frontend framework.

Sources: [2][4]

Before adoption

A bundler integration is required

The core package does not make .css.ts files work in a normal build by itself. A Vite, webpack, esbuild, or other supported integration must be configured for the target toolchain.

Sources: [4]

Do not use the Vite plugin as a library-build integration

The official Vite guide targets web applications and explicitly says library builds are unsupported. Published libraries should use an integration designed for that workflow, such as the Rollup plugin. The current core package metadata reports version 1.21.2.

Sources: [5][3]

Official sources

  1. [1]vanilla-extract repository(2026-09-30)
  2. [2]vanilla-extract README(2026-09-30)
  3. [3]@vanilla-extract/css package metadata(2026-09-30)
  4. [4]vanilla-extract getting started(2026-09-30)
  5. [5]vanilla-extract Vite integration(2026-09-30)
  6. [6]vanilla-extract MIT license(2026-09-30)
Supplemental curator note

vanilla-extract is especially useful when teams want typed design tokens and style definitions without runtime CSS-in-JS. Build-tool integration is part of the architecture, and application and library builds may require different plugins.

Try it in 3 steps

  1. 1

    Install the core package and Vite plugin

    Add the core package and Vite integration. Use the matching integration package when the project uses a different bundler.

    npm install @vanilla-extract/css npm install --save-dev @vanilla-extract/vite-plugin
  2. 2

    Configure the Vite plugin

    Add the plugin to vite.config.js or vite.config.ts so .css.ts files are processed during the build.

    import { vanillaExtractPlugin } from '@vanilla-extract/vite-plugin'; export default { plugins: [vanillaExtractPlugin()] };
  3. 3

    Create a style in a .css.ts file

    Import the generated class name into application code and verify that the build emits static CSS.

    import { style } from '@vanilla-extract/css'; export const container = style({ padding: 10 });
Check the official README

Growth

Growth trends · Last 30 days

10,435 Stars

Trend data is still being collected.

Built with

Categories and tags

GitHub data

GitHub dataView detailed GitHub data
Stars
10,435
Forks
359
Watchers
34
Open issues
74
Owner type
Organization
Primary language
TypeScript
License
MIT
Repository last updated
Sep 27, 2026
Write a related article

Share a guide or use case for this OSS in Markdown. Articles are published after administrator approval.

Report incorrect information

Tell us if any listing information is incorrect or outdated.

After reading this page, do you know what to do next?