Development · GitHub repo

StyleX

Meta's type-safe, compile-time styling system for web applications

Visit stylexjs.com ↗

StyleX is an open-source CSS styling system developed by Meta that powers platforms like Facebook, Instagram, and Threads. It combines the developer ergonomics of CSS-in-JS with compile-time CSS extraction, ensuring zero runtime overhead and predictable style composition without specificity clashes. It includes built-in TypeScript support and an atomic CSS compiler.

What it's for

  • Manage scoped, conflict-free styles across large web applications
  • Enforce static type checking on CSS properties and design system tokens
  • Compile styles into optimized atomic CSS bundles with zero runtime cost

Features

  • Compile-time CSS extraction into atomic stylesheets
  • Full TypeScript integration for type-safe CSS properties
  • Deterministic style resolution that eliminates specificity issues
  • Deterministic dynamic theming and token management
  • Modular component-level styling using stylex.create and stylex.props

Pricing

Open source. Free and open-source (MIT License)

Details

Type
GitHub repo
Category
Development
Topic
CSS & Styling
Open source
Yes
Platforms
Code library, Web
For
Frontend engineers and design system developers building scalable JavaScript and TypeScript applications
Alternative to
Tailwind CSS, Styled Components, Emotion, Vanilla Extract
Tags
css, css in js, typescript, meta, styling, frontend

Why it was saved

  • @icodestuff.io, 19 December 2023: Eliminates CSS specificity clashes and provides strict static type safety while keeping styles modular and compiling into optimized atomic CSS.

Related

Updated