Overview of 1035: Why Everyone Is Moving to Stylex?
Wes Bos and Scott Tolinski break down Stylex, Meta’s internal CSS system, and why it’s suddenly getting attention in the age of AI agents. They explain how it works, why it’s appealing at scale, where it feels awkward, and how it compares to alternatives like Tailwind, CSS Modules, Panda CSS, and Svelte-scoped styles.
What Stylex Is
- Stylex is Meta’s CSS authoring system, used across Facebook/Meta properties.
- Styles are written in JavaScript objects with typed properties and values.
- A build step compiles those styles into generated atomic class names like the mysterious hashes seen in Meta’s HTML.
- Unlike “one class per component,” Stylex often creates one class per unique property/value pair, which can lead to many class names on a single element.
Why People Are Excited About It
Great for AI agents
- A key argument in favor of Stylex is that it’s easier for agents to generate correctly than hand-written CSS.
- Jared Palmer’s take is highlighted: Stylex’s constraints improve consistency and correctness as codebases grow.
- Because the system is rigid and typed, AI-generated styles are less likely to drift or invent invalid class names.
Scales well in large codebases
- At large companies, CSS gets huge and difficult to manage.
- Stylex helps by making styles more deterministic, more reusable, and less dependent on runtime logic.
- The browser doesn’t have to do as much cascade/override work at runtime because many decisions are resolved at build time.
Performance benefits
- Adam Hutchison from Linear is cited saying they’ve moved over 50% of Linear to Stylex and seen:
- better component composition control
- clearer overwrite behavior
- improved render performance
- Another example mentioned a personal migration from Tailwind to Stylex that reportedly improved:
- First Contentful Paint by 20%
- Largest Contentful Paint by 7%
- CSS size by 50%
Main Pros
- Type-safe styling
- CSS becomes more like TypeScript: constrained, validated, and easier to reason about.
- Reusable and importable
- Styles can be shared cleanly across components.
- No runtime CSS-in-JS overhead
- Styles are compiled ahead of time rather than computed on every render.
- Composability
- JavaScript objects make overriding and combining styles easier than string-based class manipulation.
- Better for large systems
- Especially useful when many teams and many components need consistent styling rules.
Main Cons
- Ugly to author by hand
- Wes and Scott repeatedly emphasize how unpleasant the syntax feels for humans.
- Nested selectors and pseudo/state styling are awkward
- Things that feel natural in plain CSS can become verbose and clunky.
- Modern CSS can be cumbersome
- Newer syntax and more complex patterns can be harder to express cleanly.
- Feels less natural than regular CSS
- The show makes it clear that this is not a “fun” authoring experience for humans, even if it’s strong for machines.
Alternatives Discussed
Panda CSS
- Presented as the closest alternative.
- Supports both:
- object syntax similar to Stylex
- tagged template syntax, which feels closer to real CSS
- Seen as a strong “best of both worlds” option, especially for greenfield projects.
CSS Modules
- Liked for clearer importing and easier navigation to the source of styles.
- More natural than Tailwind for some workflows, especially when inspecting components.
Tailwind
- Still praised as a strong human DSL.
- But the hosts note that Stylex may be better suited for AI-assisted code generation and large-scale consistency.
Svelte / styled-components / scoped CSS
- Mentioned as other approaches that solve pieces of the same problem:
- co-locating styles
- generating scoped class names
- reducing CSS drift
Bottom Line
- Stylex is compelling not because it’s pleasant to hand-write, but because it’s rigid, typed, and scalable.
- The hosts’ core conclusion: Stylex looks especially good in an AI-assisted workflow and in very large applications, where consistency and compile-time guarantees matter more than syntax elegance.
- For humans writing CSS manually, it may feel “gross.”
- For agents and large systems, it may be one of the most practical styling approaches available right now.
