Research

Is StyleX worth choosing over Tailwind?

This site and the Storybook playground are built with StyleX only. Every finding below was reproduced here, not just read about. The full write-up lives in docs/.

Deterministic merge

good

stylex.props(a, b) resolves per property, shorthand-aware. No tailwind-merge, no class-order surprises.

Typed style contracts

good

Components expose sx?: StyleXStyles and can restrict which properties callers may touch.

Tokens are imports

good

defineVars / defineConsts live in a shared package; a typo is a compile error, not a dead class.

Token files are rigid

pain

defineVars must live in *.stylex.ts with named exports only. You cannot define a token beside the component.

Cascade layers bite once

pain

useCSSLayers puts StyleX under UA styles; a:link / a:visited need an unlayered reset.

Styling at a distance is deliberate work

pain

Parent-state child styles need defineVars or stylex.when + markers. One selector in CSS, three touch points here.