OSS TanbouSign in with GitHub

keep CSS-in-JS authoring while extracting styles 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
12,350
Primary language
TypeScript
License
MIT
Repository last updated
Oct 4, 2026
On this page

Overview

Linaria is a zero-runtime CSS-in-JS library. It evaluates css tags and React styled APIs during the build and extracts the resulting styles into CSS files instead of shipping a runtime styling engine.

Features and best fit

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

Key features

Extract css-tag styles to static CSS at build time

Styles authored with @linaria/core are processed through the WyW-based transform and emitted as CSS assets without a client-side style runtime.

Sources: [1]

Use React styled APIs with CSS custom properties for dynamic styles

@linaria/react provides styled-component-like APIs, with dynamic prop values represented through CSS custom properties.

Sources: [1][3]

Integrate Vite, Webpack, and Rollup through @wyw-in-js packages

Linaria moved its bundler integrations onto WyW, such as @wyw-in-js/vite for Vite builds.

Sources: [1][4]

Best fit

Fits frontends that want colocated styles without runtime CSS-in-JS cost

It is useful for React and JavaScript codebases that want CSS-in-JS ergonomics while delivering static CSS in production.

Sources: [1]

Before adoption

Linaria 8 requires Node 22.12.0 or later

Both @linaria/core and @linaria/react 8.2.0 declare Node >=22.12.0, so local and CI toolchains must be upgraded accordingly.

Sources: [2][3]

Build-time module evaluation can affect side effects and invalidation

The README calls out slow builds, invalidation storms, and unexpected build-time execution as potential WyW evaluation issues. Review module structure and the migration guide for evaluator-sensitive code.

Sources: [1][5]

Official sources

  1. [1]Linaria 8.2.0 README(2026-10-05)
  2. [2]@linaria/core 8.2.0 package metadata(2026-10-05)
  3. [3]@linaria/react 8.2.0 package metadata(2026-10-05)
  4. [4]Linaria bundler integration guide(2026-10-05)
  5. [5]Linaria migration guide(2026-10-05)
  6. [6]Linaria MIT license(2026-10-05)
Supplemental curator note

Linaria 8 is built on WyW 2 and requires Node.js >=22.12.0. Older bundler packages such as @linaria/vite moved to @wyw-in-js/*, so legacy integration guides should not be reused unchanged.

Try it in 3 steps

  1. 1

    Install Linaria 8.2.0 with the Vite integration

    On Node.js 22.12.0 or later, pin Linaria core together with the matching WyW/Vite integration line.

    demo=$(mktemp -d "${TMPDIR:-/tmp}/linaria.XXXXXX") && cd "$demo" && npm init -y >/dev/null && npm install --save-exact @linaria/core@8.2.0 @wyw-in-js/vite@2.4.0 vite@6.4.3
  2. 2

    Create a css-tag source file and Vite config

    Create the smallest setup where the WyW Vite plugin can process an @linaria/core css tag at build time.

    mkdir -p src && printf "%s\n" "import { defineConfig } from 'vite';" "import linaria from '@wyw-in-js/vite';" "export default defineConfig({ plugins: [linaria()] });" > vite.config.mjs && printf "%s\n" '<!doctype html><div id="app"></div><script type="module" src="/src/main.js"></script>' > index.html && printf "%s\n" "import { css } from '@linaria/core';" "const title = css`color: rebeccapurple; font-weight: 700;`;" "document.querySelector('#app').innerHTML = '<h1 class="' + title + '">Linaria</h1>';" > src/main.js
  3. 3

    Build with Vite and verify static CSS extraction

    Confirm the production build emits a CSS asset instead of relying on a runtime styling engine.

    npx vite build && test -n "$(find dist -name '*.css' -type f -print -quit)"
Check the official README

Growth

Growth trends · Last 30 days

12,350 Stars

Trend data is still being collected.

Built with

Categories and tags

GitHub data

GitHub dataView detailed GitHub data

GitHub Topics

  • css
  • css-in-js
  • css-in-react
  • react
Stars
12,350
Forks
413
Watchers
64
Open issues
73
Owner type
Organization
Primary language
TypeScript
License
MIT
Repository last updated
Oct 4, 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?