MCPcopy Index your code
hub / github.com/facebook/stylex

github.com/facebook/stylex @0.19.0

repository ↗ · DeepWiki ↗ · release 0.19.0 ↗ · + Follow
3,115 symbols 6,817 edges 720 files 85 documented · 3% updated 3d ago0.17.5 · 2026-01-21★ 9,540108 open issues
README

StyleX · GitHub license npm version tests PRs Welcome

StyleX is a JavaScript library for defining styles for optimized user interfaces.

Documentation

Documentation Website

Documentation for individual packages can be found in their respective README files. Start with @stylexjs/stylex.

Example

Here is a simple example of StyleX use:

import * as stylex from '@stylexjs/stylex';

const styles = stylex.create({
  root: {
    padding: 10,
  },
  element: {
    backgroundColor: 'red',
  },
});

const styleProps = stylex.props(styles.root, styles.element);

Development

This is the development monorepo for StyleX.

Structure

Tasks

First, yarn install the yarn workspace.

  • build
  • Use yarn build to run the build script in every package.
  • Use yarn workspace <package-name> build to run the build script for a specific package.
  • test
  • Use yarn test to run tests for every package.
  • Use yarn workspace <package-name> test to run the test script for a specific package. More details can be found in the contributing guide below.

Contributing

Development happens in the open on GitHub and we are grateful for contributions including bug fixes, improvements, and ideas.

Code of Conduct

This project expects all participants to adhere to Meta's OSS Code of Conduct. Please read the full text so that you can understand what actions will and will not be tolerated.

Contributing Guide

Read the contributing guide to learn about our development process, how to propose bug fixes and improvements, and how to build and test your changes.

Architectural Principles

Before proposing a change or addition to the StyleX API, you should familiarize yourself with the goals and architectural principles of the project.

License

StyleX is MIT licensed.

Extension points exported contracts — how you extend this code

IPreRule (Interface)
(no doc) [6 implementers]
packages/@stylexjs/babel-plugin/src/shared/preprocess-rules/PreRule.js
Chalk (Interface)
(no doc) [1 implementers]
flow-typed/npm/chalk_v4.x.x.js
Register (Interface)
(no doc)
packages/typescript-tests/src/env.ts
SidebarProps (Interface)
(no doc)
packages/docs/src/components/sidebar.tsx
GlobalProps (Interface)
(no doc)
examples/example-redwoodsdk/worker-configuration.d.ts
RouteConfig (Interface)
(no doc)
examples/example-waku/src/pages.gen.ts
UnderlyingSource (Interface)
(no doc)
flow-typed/environments/streams.js
CompileUtils (Interface)
(no doc)
packages/@stylexjs/atoms/src/babel-transform.d.ts

Core symbols most depended-on inside this repo

create
called by 21983
flow-typed/environments/bom.js
toMatchInlineSnapshot
called by 1171
flow-typed/npm/jest_v27.x.x.js
makeLiteralRule
called by 708
packages/@stylexjs/eslint-plugin/src/rules/makeLiteralRule.js
toEqual
called by 651
flow-typed/npm/jest_v27.x.x.js
parseToEnd
called by 550
packages/style-value-parser/src/token-parser.js
map
called by 541
packages/style-value-parser/src/token-parser.js
toThrow
called by 382
flow-typed/npm/jest_v27.x.x.js
makeUnionRule
called by 292
packages/@stylexjs/eslint-plugin/src/rules/makeUnionRule.js

Shape

Function 1,181
Class 1,149
Method 405
Interface 378
Enum 2

Languages

TypeScript100%

Modules by API surface

flow-typed/environments/bom.js320 symbols
flow-typed/npm/@babel/types.js254 symbols
flow-typed/environments/html.js204 symbols
flow-typed/environments/node.js163 symbols
flow-typed/environments/dom.js153 symbols
packages/style-value-parser/src/css-types/transform-function.js73 symbols
packages/style-value-parser/src/css-types/color.js51 symbols
packages/style-value-parser/src/css-types/filter-function.js49 symbols
packages/@stylexjs/babel-plugin/src/shared/types/index.js47 symbols
flow-typed/npm/jest_v27.x.x.js47 symbols
packages/style-value-parser/src/token-parser.js44 symbols
packages/@stylexjs/eslint-plugin/src/utils/splitShorthands.js37 symbols

Dependencies from manifests, versioned

@babel/cli7.23.9 · 1×
@babel/core7.23.9 · 1×
@babel/eslint-parser7.26.8 · 1×
@babel/helper-module-imports7.25.9 · 1×
@babel/node7.23.9 · 1×
@babel/plugin-syntax-flow7.26.0 · 1×
@babel/plugin-syntax-jsx7.25.9 · 1×
@babel/plugin-syntax-typescript7.25.9 · 1×
@babel/plugin-transform-flow-strip-types7.27.1 · 1×
@babel/preset-env7.26.8 · 1×
@babel/preset-flow7.25.9 · 1×
@babel/preset-react7.26.3 · 1×

For agents

$ claude mcp add stylex \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact