---
title: "Styling Linear for the future with StyleX"
description: "Linear migrated its React apps from styled-components to Meta's StyleX over more than 1,000 PRs."
url: "https://swe.quest/articles/styling-linear-for-the-future-with-stylex-1042e4b9c269681c"
canonical: "https://linear.app/now/styling-linear-for-the-future-stylex"
source: "Linear"
published: "2026-08-26"
difficulty: "medium"
kind: "Case study"
reading_minutes: 9
tags: ["css","react","refactoring","web-performance","static-analysis"]
---

# Styling Linear for the future with StyleX

A post on [Linear](https://swe.quest/sources/linear.md), published 2026-08-26, 9 min read, Case study. Original: [https://linear.app/now/styling-linear-for-the-future-stylex](https://linear.app/now/styling-linear-for-the-future-stylex)

## Summary

Linear migrated its React apps from styled-components to Meta's StyleX over more than 1,000 PRs. It moved style generation to build time and made styling contracts between components explicit and enforced. The work combined a deterministic codemod, narrowly scoped coding agents and manual review, starting with leaf components while both systems coexisted. Oxlint rules and a type-aware cross-file checker enforce \`sx\` prop propagation, merge precedence and design tokens, with CSS Modules kept as an escape hatch. Runtime-generated LCH themes were kept by injecting StyleX's hashed variable names per ThemeProvider, and removing runtime style injection cut main-thread CPU work by roughly 20–35% on view-heavy pages.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [CSS](https://swe.quest/tags/css.md) (Web & mobile)
- [React](https://swe.quest/tags/react.md) (Web & mobile)
- [Refactoring & migrations](https://swe.quest/tags/refactoring.md) (Engineering practices)
- [Web performance](https://swe.quest/tags/web-performance.md) (Web & mobile)
- [Static analysis](https://swe.quest/tags/static-analysis.md) (Engineering practices)

## Prerequisites

- React components ([easy posts on React](https://swe.quest/tags/react.md?difficulty=easy))
- CSS-in-JS ([easy posts on CSS](https://swe.quest/tags/css.md?difficulty=easy))
- CSS custom properties ([easy posts on CSS](https://swe.quest/tags/css.md?difficulty=easy))

## Keywords

StyleX, styled-components, Linear, Oxlint, vanilla-extract, CSS Modules, Vite, React 18

## Related posts

- [StyleX: A Styling Library for CSS at Scale](https://swe.quest/articles/stylex-a-styling-library-for-css-at-scale-be53ddfe6134c8c8.md): Meta Engineering · 2025-11-11 · Medium · 10 min read · CSS, Frontend, Compilers, Design systems, Web performance
  StyleX is Meta's build-time CSS-in-JS compiler that extracts style objects into collision-free atomic CSS, replacing the earlier cx system and cutting CSS size by 80% across Facebook, Instagram, WhatsApp and others.
- [Improving site performance by shipping more CSS](https://swe.quest/articles/improving-site-performance-by-shipping-more-css-41480dcc45d65149.md): GitHub Engineering · 2026-09-25 · Medium · 7 min read · CSS, Web performance, Refactoring & migrations, Design systems, React
  GitHub migrated its Primer Design System and the github.com codebase from styled-components CSS-in-JS to CSS Modules, removing runtime styling costs on client and server.
- [Hydrogen & Tailwind: The Perfect Match for Building Beautiful Storefronts](https://swe.quest/articles/hydrogen-tailwind-the-perfect-match-for-building-beautiful-storefronts-f351623f38eedf37.md): Shopify Engineering · 2022-02-11 · Medium · 10 min read · CSS, Frontend, React, E-commerce, Design systems
  Tailwind's utility classes ship as the default styling option in Shopify's React-based Hydrogen storefront framework, and the case for them rests on componentization: styles live in reusable React components rather than semantically named classes like BEM-style product-card\_\_title, so layouts can be copied or extracted (e.g. ProductCard to BlogCard) without renaming or duplicating CSS.
- [Why We Ripped Twin out of 400+ Components](https://swe.quest/articles/why-we-ripped-twin-out-of-400-components-f0b99539dbfc3cb4.md): Railway · 2023-05-04 · Medium · 7 min read · CSS, Frontend, Refactoring & migrations, Build systems, React
  Railway replaced twin.macro with vanilla Tailwind across 400+ React components, which removed the last dependency on Babel and let the monorepo move fully to SWC.
- [The New York Times Games’ Path to Dark Mode](https://swe.quest/articles/the-new-york-times-games-path-to-dark-mode-4c848ca761eed7c4.md): NYT Open · 2025-09-25 · Easy · 8 min read · Design systems, Frontend, React, CSS, Product engineering
  Shipping Dark Mode for New York Times Games turned into paying down years of design debt, because eight games each had their own hex colors, fonts and component styles.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
