Skip to content

An open source design system that's fully customizable and agent ready

TypeScript

docs: StyleX CSS capability scanner with output validation (#648)

Cindy Zhang6f497440188e
diff --git a/CLAUDE.md b/CLAUDE.md
index f2ba05b9e1..72fe1bf765 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -84,3 +84,38 @@ Look for `<!-- SYNC: ... -->` comments and `SYNC:` in file headers as reminders.
- **`@example` code fences must use plain ` ``` `, not ` ```tsx `.**
Storybook's autodocs parser doesn't handle language-tagged fences in JSDoc correctly — the code block won't render as a proper code block. Always use untagged fences in `@example` blocks.
+
+<!-- STYLEX-CAPS:START -->
+
+[StyleX v0.17.5 CSS Support]|Use CSS-native solutions. Don't build JS workarounds for supported features.
+|AT-RULES: @media, @supports, @container (+named), @starting-style, @scope — YES
+|AT-RULES: @layer, @property (explicit) — NO (compiles but invalid CSS output)
+|PSEUDO-CLS: :hover, :focus, :focus-visible, :focus-within, :active, :disabled — YES
+|PSEUDO-CLS: :first-child, :last-child, :nth-child(), :where(), :is(), :has(), :not() — YES
+|PSEUDO-CLS: :placeholder-shown, :checked, :empty, :modal, :user-valid, :user-invalid — YES
+|PSEUDO-EL: ::before, ::after, ::placeholder, ::selection, ::backdrop, ::marker, ::view-transition-_ — YES
+|COMPOUND: ::backdrop+condition, RTL :is([dir="rtl"] _), nested @media+pseudo — YES
+|VALUES: var(), calc(), clamp(), light-dark(), color-mix(), container-type/name — YES
+|ANIM: transition (shorthand+individual), transitionBehavior:allow-discrete, animation, stylex.keyframes — YES
+|WHEN: stylex.when.ancestor(':hover'/':focus-within'/':active'/':disabled') — YES
+|WHEN: stylex.when.descendant(':hover'), siblingBefore(':checked'), siblingAfter(':checked'), anySibling(':hover') — YES
+|WHEN: stylex.when.ancestor('[data-attr]') — NO (pseudo selectors only, must start with ":")
+|NESTING: CSS nesting with & — NO (use stylex.when.ancestor/descendant/sibling for parent-child state)
+|API: stylex.firstThatWorks() for CSS fallbacks (e.g. display: grid with flex fallback) — YES
+|API: stylex.positionTry() for anchor positioning @position-try — YES
+|API: stylex.types.color/length/etc for typed CSS variables in defineVars — YES
+|API: stylex.defineConsts() for compile-time constants — YES
+|DYNAMIC: Functions in stylex.create for runtime values — YES
+|VARS: stylex.defineVars, stylex.createTheme (require .stylex.ts files) — YES
+|LAYOUT: grid, flex+gap, aspect-ratio, overscrollBehavior, scrollbar-gutter/width — YES
+|PATTERN: dialog entry animation -> @starting-style (not useState+rAF)
+|PATTERN: parent hover child style -> stylex.when.ancestor(':hover') (not CSS nesting)
+|PATTERN: hover on touch -> @media (hover: hover) guard
+|PATTERN: zebra striping -> :nth-child(even) (not index%2 JS)
+|PATTERN: container responsive -> @container (not ResizeObserver)
+|PATTERN: CSS fallback values -> stylex.firstThatWorks() (not manual fallback)
+|PATTERN: dynamic/runtime values -> stylex.create({ s: (val) => ({ prop: val }) }) (not inline styles)
+|PATTERN: conditional styles -> stylex.props(condition && styles.x) (not className toggling)
+|VERIFY: node internal/stylex-capabilities/scan.mjs
+
+<!-- STYLEX-CAPS:END -->
diff --git a/internal/stylex-capabilities/CAPABILITIES.md b/internal/stylex-capabilities/CAPABILITIES.md
new file mode 100644
index 0000000000..7700771bb2
--- /dev/null
+++ b/internal/stylex-capabilities/CAPABILITIES.md
@@ -0,0 +1,255 @@
+# StyleX CSS Capability Reference
+
+> Auto-generated by `internal/stylex-capabilities/scan.mjs`
+> StyleX version: **0.17.5**
+> Generated: 2026-03-17
+
+**82/92** features supported
+
+## At-Rules
+
+| Feature | Status | CSS Output |
+| ---------------------------------------------------- | ------ | ------------------------------------------ |
+| @media | ✅ | `ltr: ".x1e2nbdu{color:red}", |
+| ltr: "@media (max-width: 768px){.x1v9tpll.x1v9tpll{` |
+| @media (hover: hover) | ✅ | `ltr: ".x1e2nbdu{color:red}", |
+| ltr: "@media (hover: hover){.x1qg27m4.x1qg27m4{colo` |
+| @media (prefers-reduced-motion) | ✅ | `ltr: ".x4afe7t{animation-duration:.3s}", |
+| ltr: "@media (prefers-reduced-motion: r` |
+| @media (prefers-color-scheme) | ✅ | `ltr: ".x1mqxbix{color:black}", |
+| ltr: "@media (prefers-color-scheme: dark){.xat0y8` |
+| @supports | ✅ | `ltr: ".x78zum5{display:flex}", |
+| ltr: "@supports (display: grid){.xr4m3m1.xr4m3m1{` |
+| @container | ✅ | `ltr: ".xif65rj{font-size:14px}", |
+| ltr: "@container (min-width: 400px){.x5ca7px.x5` |
+| @container (named) | ✅ | `ltr: ".xif65rj{font-size:14px}", |
+| ltr: "@container sidebar (min-width: 400px){.x1` |
+| @layer | ❌ | Error |
+| @starting-style | ✅ | `ltr: ".x1hc1fzr{opacity:1}", |
+| ltr: "@starting-style{.x4itv7f.x4itv7f{opacity:0}}"` |
+| @starting-style (transform) | ✅ | `ltr: ".xbryuvx{transform:translateX(0)}", |
+| ltr: "@starting-style{.x1yqmsfc.x1yqms` |
+
+## Pseudo-Classes
+
+| Feature | Status | CSS Output |
+| ------------------------------------------------- | ------ | ------------------------------------------ |
+| :hover | ✅ | `ltr: ".x1e2nbdu{color:red}", |
+| ltr: ".x17z2mba:hover{color:blue}",` |
+| :focus | ✅ | `ltr: ".x1e2nbdu{color:red}", |
+| ltr: ".x1cg8fzh:focus{color:blue}",` |
+| :focus-visible | ✅ | `ltr: ".x1a2a7pz{outline:none}", |
+| ltr: ".xp1qbqn:focus-visible{outline:2px solid b` |
+| :focus-within | ✅ | `ltr: ".xzppbbw{border-color:gray}", |
+| ltr: ".x1v09i5w:focus-within{border-color:bl` |
+| :active | ✅ | `ltr: ".x1e2nbdu{color:red}", |
+| ltr: ".x4oye9d:active{color:blue}",` |
+| :disabled | ✅ | `ltr: ".x1hc1fzr{opacity:1}", |
+| ltr: ".xijokvz:disabled{opacity:.5}",` |
+| :first-child | ✅ | `ltr: ".x1xmf6yo{margin-top:8px}", |
+| ltr: ".x14l7nz5:first-child{margin-top:0}",` |
+| :last-child | ✅ | `ltr: ".x1e56ztr{margin-bottom:8px}", |
+| ltr: ".xzboxd6:last-child{margin-bottom:0}"` |
+| :nth-child() | ✅ | `ltr: ".x12peec7{background-color:white}", |
+| ltr: ".x91ra16:nth-child(even){backgro` |
+| :where() | ✅ | `ltr: ".x1s85apg{display:none}", |
+| ltr: ".xf1xu1x.xf1xu1x:where([open]){display:fle` |
+| :is() | ✅ | `ltr: ".x1e2nbdu{color:red}", |
+| ltr: ".xdxic9:is(:hover, :focus){color:blue}",` |
+| :has() | ✅ | `ltr: ".xzppbbw{border-color:gray}", |
+| ltr: ".x1vswxf2:has(:focus){border-color:blu` |
+| :not() | ✅ | `ltr: ".x1lliihq{display:block}", |
+| ltr: ".x41xwj8:not(:last-child){display:block}"` |
+| :placeholder-shown | ✅ | `ltr: ".x1mqxbix{color:black}", |
+| ltr: ".x8yzjlm:placeholder-shown{color:gray}",` |
+| :checked | ✅ | `ltr: ".x12peec7{background-color:white}", |
+| ltr: ".x5ry8ap:checked{background-colo` |
+| :empty | ✅ | `ltr: ".x1lliihq{display:block}", |
+| ltr: ".xjl7jj:empty{display:none}",` |
+
+## Pseudo-Elements
+
+| Feature | Status | CSS Output |
+| ----------------------------------------- | ------ | --------------------------------------------------------------- |
+| ::before | ✅ | `ltr: ".x1cpjm7i::before{content:\"\"}", |
+| ltr: ".x1fgarty::before{display:block}",` |
+| ::after | ✅ | `ltr: ".x1s928wv::after{content:\"\"}", |
+| ltr: ".xhkezso::after{display:block}",` |
+| ::placeholder | ✅ | `ltr: ".x6yu8oj::placeholder{color:gray}", |
+| ltr: ".xefv9yz::placeholder{font-style` |
+| ::selection | ✅ | `ltr: ".x1hr2xla::selection{background-color:blue}", |
+| ltr: ".x50npbo::selection{co` |
+| ::backdrop | ✅ | `ltr: ".x17fofgw::backdrop{background-color:rgba(0,0,0,.5)}",` |
+| ::marker | ✅ | `ltr: ".xab66pc::marker{color:blue}",` |
+| ::file-selector-button | ✅ | `ltr: ".x1905k51::file-selector-button{background-color:blue}", |
+| ltr: ".xjdbxwa::f` |
+
+## Compound Selectors
+
+| Feature | Status | CSS Output |
+| ------------------------------------------------------- | ------ | ---------------------------------------------- |
+| Pseudo-class on pseudo-element (::backdrop + condition) | ✅ | `ltr: ".xph5o2a::backdrop{opacity:0}", |
+| ltr: ".x1pgog5j.x1pgog5j::backdrop:where([` |
+| RTL context (:is([dir="rtl"] \*)) | ✅ | `ltr: ".x5i6ehr{transform:translateX(-100%)}", |
+| ltr: ".xttggg:is([dir=\"rtl\"] \*){` |
+| Nested @media + pseudo | ✅ | `ltr: ".x1e2nbdu{color:red}", |
+
+ltr: ".x17z2mba:hover{color:blue}",
+ltr: "@media (h` |
+
+## CSS Values
+
+| Feature | Status | CSS Output |
+| --------------------------------- | ------ | ---------------------------------------------------------- |
+| CSS variables (custom properties) | ✅ | `ltr: ".x14qql8p{color:var(--color-primary)}",` |
+| calc() | ✅ | `ltr: ".xkxa9zd{width:calc(100% - 32px)}",` |
+| clamp() | ✅ | `ltr: ".xdq3cbq{font-size:clamp(14px,2vw,18px)}",` |
+| light-dark() | ✅ | `ltr: ".xarbrzd{color:light-dark(black,white)}",` |
+| color-mix() | ✅ | `ltr: ".x10zuzju{color:color-mix(in srgb,red 50%,blue)}",` |
+| container-type | ✅ | `ltr: ".x12h1iku{container-type:inline-size}",` |
+| container-name | ✅ | `ltr: ".x4s5kx9{container-name:sidebar}",` |
+
+## Transitions & Animations
+
+| Feature | Status | CSS Output |
+| ---------------------------------- | ------ | ---------------------------------------------------------------------------------- |
+| transition (shorthand) | ✅ | `ltr: ".xqz5vs7{transition:opacity .3s ease}",` |
+| transition (individual properties) | ✅ | `ltr: ".x19991ni{transition-property:opacity}", |
+| ltr: ".x1d8287x{transition-durati` |
+| transitionBehavior: allow-discrete | ✅ | `ltr: ".xd00j3c{transition-behavior:allow-discrete}",` |
+| animation (shorthand) | ✅ | (processed) |
+| stylex.keyframes | ✅ | `ltr: "@keyframes x1wc8ddo-B{from{transform:rotate(0deg);}to{transform:rotate(360` |
+
+## Dynamic Styles
+
+| Feature | Status | CSS Output |
+| ------------------------------------------- | ------ | --------------------------------------- |
+| Dynamic values (function in stylex.create) | ✅ | `ltr: ".x5lhr3w{width:var(--x-width)}", |
+| ltr: "@property --x-width { syntax: \"\*\"` |
+
+## Variables
+
+| Feature | Status | CSS Output |
+| ------------------ | ------ | ------------------------------------------------------------ |
+| stylex.defineVars | ❌ | /vercel/sandbox/repos/xds-worktrees/stylex-caps/test.tsx: Un |
+| stylex.createTheme | ❌ | /vercel/sandbox/repos/xds-worktrees/stylex-caps/test.tsx: Un |
+
+## Ancestor/Sibling Selectors
+
+| Feature | Status | CSS Output |
+| ---------------------------------------------------- | ------ | ------------------------------------------------------------ |
+| stylex.when.ancestor(:hover) | ✅ | `ltr: ".x1e2nbdu{color:red}", |
+| ltr: ".xobp4yc.xobp4yc:where(.x-default-marker:hove` |
+| stylex.when.ancestor(:hover) + @media | ✅ | `ltr: ".x1e2nbdu{color:red}", |
+| ltr: "@media (hover: hover){.x1mm45h8.x1mm45h8.x1mm` |
+| stylex.when.ancestor(:focus-within) | ✅ | `ltr: ".xzppbbw{border-color:gray}", |
+| ltr: ".x1y7zxk6.x1y7zxk6:where(.x-default-ma` |
+| stylex.when.ancestor(:active) | ✅ | `ltr: ".x1c071of{transform:none}", |
+| ltr: ".x1nyz7lo.x1nyz7lo:where(.x-default-mark` |
+| stylex.when.ancestor(:disabled) | ✅ | `ltr: ".x1hc1fzr{opacity:1}", |
+| ltr: ".x1ymx0df.x1ymx0df:where(.x-default-marker:di` |
+| stylex.when.ancestor([data-attr]) | ❌ | /vercel/sandbox/repos/xds-worktrees/stylex-caps/test.tsx: Ps |
+| stylex.when.descendant(:hover) | ✅ | `ltr: ".x1e2nbdu{color:red}", |
+| ltr: ".xepvv76.xepvv76:where(:has(.x-default-marker` |
+| stylex.when.siblingBefore(:checked) | ✅ | `ltr: ".x1e2nbdu{color:red}", |
+| ltr: ".x72zv5i.x72zv5i:where(.x-default-marker:chec` |
+| stylex.when.siblingAfter(:checked) | ✅ | `ltr: ".x1e2nbdu{color:red}", |
+| ltr: ".x1e2z1t3.x1e2z1t3:where(:has(~ .x-default-ma` |
+| stylex.when.anySibling(:hover) | ✅ | `ltr: ".x1hc1fzr{opacity:1}", |
+| ltr: ".x1tq5f2g.x1tq5f2g:where(.x-default-marker:ho` |
+
+## StyleX APIs
+
+| Feature | Status | CSS Output |
+| ---------------------------- | ------ | ------------------------------------------------------------ |
+| stylex.firstThatWorks() | ✅ | `ltr: ".x1fb8ovd{display:flex;display:grid}",` |
+| stylex.positionTry() | ✅ | `ltr: "@position-try --x19yd6gm {top:top;top:anchor(end);}", |
+| ltr: ".xvc0jx8{posit` |
+| stylex.viewTransitionClass() | ❌ | /vercel/sandbox/repos/xds-worktrees/stylex-caps/test.tsx: vi |
+| stylex.defineConsts() | ❌ | /vercel/sandbox/repos/xds-worktrees/stylex-caps/test.stylex. |
+| stylex.types.color() | ❌ | /vercel/sandbox/repos/xds-worktrees/stylex-caps/test.stylex. |
+| stylex.types.length() | ❌ | /vercel/sandbox/repos/xds-worktrees/stylex-caps/test.stylex. |
+
+## Bleeding Edge
+
+| Feature | Status | CSS Output |
+| ---------------------------------------------------- | ------ | ---------------------------------------------------------------------- |
+| @scope | ✅ | `ltr: ".x1e2nbdu{color:red}", |
+| ltr: "@scope (.card){.x1ph799q.x1ph799q{color:blue}` |
+| @property (explicit) | ❌ | Error |
+| ::view-transition-old | ✅ | `ltr: ".x1bb6q1l::view-transition-old(root){animation-duration:.3s}",` |
+| ::view-transition-new | ✅ | `ltr: ".x1wpo8qz::view-transition-new(root){animation-duration:.3s}",` |
+| :modal | ✅ | `ltr: ".x12peec7{background-color:white}", |
+| ltr: ".x1mt27nc:modal{background-color` |
+| anchor() positioning | ✅ | `ltr: ".xnj0yav{top:anchor(--my-anchor bottom)}", |
+| ltr: ".x1os70c6{position-anchor` |
+| CSS nesting (&) | ❌ | /vercel/sandbox/repos/xds-worktrees/stylex-caps/test.tsx: In |
+| @media (scripting: none) | ✅ | `ltr: ".x1lliihq{display:block}", |
+| ltr: "@media (scripting: none){.x1cfwndu.x1cfwn` |
+| :user-valid / :user-invalid | ✅ | `ltr: ".xzppbbw{border-color:gray}", |
+| ltr: ".xwdq3mt:user-invalid{border-color:red` |
+| color-scheme property | ✅ | `ltr: ".x108lcm5{color-scheme:light dark}",` |
+| text-wrap: balance | ✅ | `ltr: ".x1w2vvpw{text-wrap:balance}",` |
+| text-wrap: pretty | ✅ | `ltr: ".x1fzhlzt{text-wrap:pretty}",` |
+| field-sizing: content | ✅ | `ltr: ".x5f5z56{field-sizing:content}",` |
+| interpolate-size: allow-keywords | ✅ | `ltr: ".xftp66k{interpolate-size:allow-keywords}",` |
+| scrollbar-gutter | ✅ | `ltr: ".x185mbhu{scrollbar-gutter:stable}",` |
+| scrollbar-width | ✅ | `ltr: ".x1597r2g{scrollbar-width:thin}",` |
+| accent-color | ✅ | `ltr: ".xwgdyvq{accent-color:blue}",` |
+
+## Logical Properties
+
+| Feature | Status | CSS Output |
+| ----------------------------------------- | ------ | ------------------------------------------------ |
+| paddingInline / paddingBlock | ✅ | `ltr: ".x1hr3lfm{padding-inline:16px}", |
+| ltr: ".x1vvogim{padding-block:8px}",` |
+| insetInlineStart / insetInlineEnd | ✅ | `ltr: ".x1o0tod{inset-inline-start:0}", |
+| ltr: ".x1woyocn{inset-inline-end:auto}",` |
+| borderInlineStart | ✅ | `ltr: ".xpilrb4{border-inline-start-width:1px}", |
+| ltr: ".x1t7ytsu{border-inline-st` |
+| marginInlineStart: auto | ✅ | `ltr: ".xvc5jky{margin-inline-start:auto}",` |
+
+## Layout
+
+| Feature | Status | CSS Output |
+| ------------- | ------ | ------------------------------- |
+| display: grid | ✅ | `ltr: ".xrvj5dj{display:grid}", |
+
+ltr: ".x1o61qjw{grid-template-columns:1fr 1fr}",
+`|
+| display: flex + gap | ✅ |`ltr: ".x78zum5{display:flex}",
+ltr: ".xou54vl{gap:16px}",`|
+| aspect-ratio | ✅ |`ltr: ".x186iv6y{aspect-ratio:16 / 9}",`|
+| overscrollBehavior | ✅ |`ltr: ".xish69e{overscroll-behavior:contain}",` |
+
+---
+
+## Compact Reference (for LLM context)
+
+StyleX v0.17.5 supports these CSS features in `stylex.create()`:
+
+**At-Rules:** @media ✅, @media (hover: hover) ✅, @media (prefers-reduced-motion) ✅, @media (prefers-color-scheme) ✅, @supports ✅, @container ✅, @container (named) ✅, @layer ❌, @starting-style ✅, @starting-style (transform) ✅
+
+**Pseudo-Classes:** :hover ✅, :focus ✅, :focus-visible ✅, :focus-within ✅, :active ✅, :disabled ✅, :first-child ✅, :last-child ✅, :nth-child() ✅, :where() ✅, :is() ✅, :has() ✅, :not() ✅, :placeholder-shown ✅, :checked ✅, :empty ✅
+
+**Pseudo-Elements:** ::before ✅, ::after ✅, ::placeholder ✅, ::selection ✅, ::backdrop ✅, ::marker ✅, ::file-selector-button ✅
+
+**Compound Selectors:** Pseudo-class on pseudo-element (::backdrop + condition) ✅, RTL context (:is([dir="rtl"] \*)) ✅, Nested @media + pseudo ✅
+
+**CSS Values:** CSS variables (custom properties) ✅, calc() ✅, clamp() ✅, light-dark() ✅, color-mix() ✅, container-type ✅, container-name ✅
+
+**Transitions & Animations:** transition (shorthand) ✅, transition (individual properties) ✅, transitionBehavior: allow-discrete ✅, animation (shorthand) ✅, stylex.keyframes ✅
+
+**Dynamic Styles:** Dynamic values (function in stylex.create) ✅
+
+**Variables:** stylex.defineVars ❌, stylex.createTheme ❌
+
+**Ancestor/Sibling Selectors:** stylex.when.ancestor(:hover) ✅, stylex.when.ancestor(:hover) + @media ✅, stylex.when.ancestor(:focus-within) ✅, stylex.when.ancestor(:active) ✅, stylex.when.ancestor(:disabled) ✅, stylex.when.ancestor([data-attr]) ❌, stylex.when.descendant(:hover) ✅, stylex.when.siblingBefore(:checked) ✅, stylex.when.siblingAfter(:checked) ✅, stylex.when.anySibling(:hover) ✅
+
+**StyleX APIs:** stylex.firstThatWorks() ✅, stylex.positionTry() ✅, stylex.viewTransitionClass() ❌, stylex.defineConsts() ❌, stylex.types.color() ❌, stylex.types.length() ❌
+
+**Bleeding Edge:** @scope ✅, @property (explicit) ❌, ::view-transition-old ✅, ::view-transition-new ✅, :modal ✅, anchor() positioning ✅, CSS nesting (&) ❌, @media (scripting: none) ✅, :user-valid / :user-invalid ✅, color-scheme property ✅, text-wrap: balance ✅, text-wrap: pretty ✅, field-sizing: content ✅, interpolate-size: allow-keywords ✅, scrollbar-gutter ✅, scrollbar-width ✅, accent-color ✅
+
+**Logical Properties:** paddingInline / paddingBlock ✅, insetInlineStart / insetInlineEnd ✅, borderInlineStart ✅, marginInlineStart: auto ✅
+
+**Layout:** display: grid ✅, display: flex + gap ✅, aspect-ratio ✅, overscrollBehavior ✅
diff --git a/internal/stylex-capabilities/capabilities.json b/internal/stylex-capabilities/capabilities.json
new file mode 100644
index 0000000000..b49a2d8535
--- /dev/null
+++ b/internal/stylex-capabilities/capabilities.json
@@ -0,0 +1,649 @@
+{
+ "version": "0.17.5",
+ "generatedAt": "2026-03-17T11:34:45.797Z",
+ "total": 92,
+ "supported": 82,
+ "results": [
+ {
+ "category": "At-Rules",
+ "name": "@media",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".x1e2nbdu{color:red}\",\nltr: \"@media (max-width: 768px){.x1v9tpll.x1v9tpll{color:blue}}\","
+ },
+ {
+ "category": "At-Rules",
+ "name": "@media (hover: hover)",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".x1e2nbdu{color:red}\",\nltr: \"@media (hover: hover){.x1qg27m4.x1qg27m4{color:blue}}\","
+ },
+ {
+ "category": "At-Rules",
+ "name": "@media (prefers-reduced-motion)",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".x4afe7t{animation-duration:.3s}\",\nltr: \"@media (prefers-reduced-motion: reduce){.x9urbn7.x9urbn7{animation-duration:.01s}}\","
+ },
+ {
+ "category": "At-Rules",
+ "name": "@media (prefers-color-scheme)",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".x1mqxbix{color:black}\",\nltr: \"@media (prefers-color-scheme: dark){.xat0y86.xat0y86{color:white}}\","
+ },
+ {
+ "category": "At-Rules",
+ "name": "@supports",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".x78zum5{display:flex}\",\nltr: \"@supports (display: grid){.xr4m3m1.xr4m3m1{display:grid}}\","
+ },
+ {
+ "category": "At-Rules",
+ "name": "@container",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".xif65rj{font-size:14px}\",\nltr: \"@container (min-width: 400px){.x5ca7px.x5ca7px{font-size:16px}}\","
+ },
+ {
+ "category": "At-Rules",
+ "name": "@container (named)",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".xif65rj{font-size:14px}\",\nltr: \"@container sidebar (min-width: 400px){.x1gydygj.x1gydygj{font-size:16px}}\","
+ },
+ {
+ "category": "At-Rules",
+ "name": "@layer",
+ "supported": false,
+ "hasInject": true,
+ "output": "ltr: \"@layer{.x1e70b1w.x1e70b1w{@layer:utilities}}\",\nltr: \".x1e2nbdu{color:red}\",",
+ "invalidReason": "Compiles but produces invalid CSS output"
+ },
+ {
+ "category": "At-Rules",
+ "name": "@starting-style",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".x1hc1fzr{opacity:1}\",\nltr: \"@starting-style{.x4itv7f.x4itv7f{opacity:0}}\","
+ },
+ {
+ "category": "At-Rules",
+ "name": "@starting-style (transform)",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".xbryuvx{transform:translateX(0)}\",\nltr: \"@starting-style{.x1yqmsfc.x1yqmsfc{transform:translateX(100%)}}\","
+ },
+ {
+ "category": "Pseudo-Classes",
+ "name": ":hover",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".x1e2nbdu{color:red}\",\nltr: \".x17z2mba:hover{color:blue}\","
+ },
+ {
+ "category": "Pseudo-Classes",
+ "name": ":focus",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".x1e2nbdu{color:red}\",\nltr: \".x1cg8fzh:focus{color:blue}\","
+ },
+ {
+ "category": "Pseudo-Classes",
+ "name": ":focus-visible",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".x1a2a7pz{outline:none}\",\nltr: \".xp1qbqn:focus-visible{outline:2px solid blue}\","
+ },
+ {
+ "category": "Pseudo-Classes",
+ "name": ":focus-within",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".xzppbbw{border-color:gray}\",\nltr: \".x1v09i5w:focus-within{border-color:blue}\","
+ },
+ {
+ "category": "Pseudo-Classes",
+ "name": ":active",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".x1e2nbdu{color:red}\",\nltr: \".x4oye9d:active{color:blue}\","
+ },
+ {
+ "category": "Pseudo-Classes",
+ "name": ":disabled",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".x1hc1fzr{opacity:1}\",\nltr: \".xijokvz:disabled{opacity:.5}\","
+ },
+ {
+ "category": "Pseudo-Classes",
+ "name": ":first-child",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".x1xmf6yo{margin-top:8px}\",\nltr: \".x14l7nz5:first-child{margin-top:0}\","
+ },
+ {
+ "category": "Pseudo-Classes",
+ "name": ":last-child",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".x1e56ztr{margin-bottom:8px}\",\nltr: \".xzboxd6:last-child{margin-bottom:0}\","
+ },
+ {
+ "category": "Pseudo-Classes",
+ "name": ":nth-child()",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".x12peec7{background-color:white}\",\nltr: \".x91ra16:nth-child(even){background-color:#f5f5f5}\","
+ },
+ {
+ "category": "Pseudo-Classes",
+ "name": ":where()",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".x1s85apg{display:none}\",\nltr: \".xf1xu1x.xf1xu1x:where([open]){display:flex}\","
+ },
+ {
+ "category": "Pseudo-Classes",
+ "name": ":is()",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".x1e2nbdu{color:red}\",\nltr: \".xdxic9:is(:hover, :focus){color:blue}\","
+ },
+ {
+ "category": "Pseudo-Classes",
+ "name": ":has()",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".xzppbbw{border-color:gray}\",\nltr: \".x1vswxf2:has(:focus){border-color:blue}\","
+ },
+ {
+ "category": "Pseudo-Classes",
+ "name": ":not()",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".x1lliihq{display:block}\",\nltr: \".x41xwj8:not(:last-child){display:block}\","
+ },
+ {
+ "category": "Pseudo-Classes",
+ "name": ":placeholder-shown",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".x1mqxbix{color:black}\",\nltr: \".x8yzjlm:placeholder-shown{color:gray}\","
+ },
+ {
+ "category": "Pseudo-Classes",
+ "name": ":checked",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".x12peec7{background-color:white}\",\nltr: \".x5ry8ap:checked{background-color:blue}\","
+ },
+ {
+ "category": "Pseudo-Classes",
+ "name": ":empty",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".x1lliihq{display:block}\",\nltr: \".xjl7jj:empty{display:none}\","
+ },
+ {
+ "category": "Pseudo-Elements",
+ "name": "::before",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".x1cpjm7i::before{content:\\\"\\\"}\",\nltr: \".x1fgarty::before{display:block}\","
+ },
+ {
+ "category": "Pseudo-Elements",
+ "name": "::after",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".x1s928wv::after{content:\\\"\\\"}\",\nltr: \".xhkezso::after{display:block}\","
+ },
+ {
+ "category": "Pseudo-Elements",
+ "name": "::placeholder",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".x6yu8oj::placeholder{color:gray}\",\nltr: \".xefv9yz::placeholder{font-style:italic}\","
+ },
+ {
+ "category": "Pseudo-Elements",
+ "name": "::selection",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".x1hr2xla::selection{background-color:blue}\",\nltr: \".x50npbo::selection{color:white}\","
+ },
+ {
+ "category": "Pseudo-Elements",
+ "name": "::backdrop",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".x17fofgw::backdrop{background-color:rgba(0,0,0,.5)}\","
+ },
+ {
+ "category": "Pseudo-Elements",
+ "name": "::marker",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".xab66pc::marker{color:blue}\","
+ },
+ {
+ "category": "Pseudo-Elements",
+ "name": "::file-selector-button",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".x1905k51::file-selector-button{background-color:blue}\",\nltr: \".xjdbxwa::file-selector-button{color:white}\","
+ },
+ {
+ "category": "Compound Selectors",
+ "name": "Pseudo-class on pseudo-element (::backdrop + condition)",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".xph5o2a::backdrop{opacity:0}\",\nltr: \".x1pgog5j.x1pgog5j::backdrop:where([data-open])::backdrop{opacity:1}\","
+ },
+ {
+ "category": "Compound Selectors",
+ "name": "RTL context (:is([dir=\"rtl\"] *))",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".x5i6ehr{transform:translateX(-100%)}\",\nltr: \".xttggg:is([dir=\\\"rtl\\\"] *){transform:translateX(100%)}\","
+ },
+ {
+ "category": "Compound Selectors",
+ "name": "Nested @media + pseudo",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".x1e2nbdu{color:red}\",\nltr: \".x17z2mba:hover{color:blue}\",\nltr: \"@media (hover: hover){.xnvl49l.xnvl49l:hover{color:green}}\","
+ },
+ {
+ "category": "CSS Values",
+ "name": "CSS variables (custom properties)",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".x14qql8p{color:var(--color-primary)}\","
+ },
+ {
+ "category": "CSS Values",
+ "name": "calc()",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".xkxa9zd{width:calc(100% - 32px)}\","
+ },
+ {
+ "category": "CSS Values",
+ "name": "clamp()",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".xdq3cbq{font-size:clamp(14px,2vw,18px)}\","
+ },
+ {
+ "category": "CSS Values",
+ "name": "light-dark()",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".xarbrzd{color:light-dark(black,white)}\","
+ },
+ {
+ "category": "CSS Values",
+ "name": "color-mix()",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".x10zuzju{color:color-mix(in srgb,red 50%,blue)}\","
+ },
+ {
+ "category": "CSS Values",
+ "name": "container-type",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".x12h1iku{container-type:inline-size}\","
+ },
+ {
+ "category": "CSS Values",
+ "name": "container-name",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".x4s5kx9{container-name:sidebar}\","
+ },
+ {
+ "category": "Transitions & Animations",
+ "name": "transition (shorthand)",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".xqz5vs7{transition:opacity .3s ease}\","
+ },
+ {
+ "category": "Transitions & Animations",
+ "name": "transition (individual properties)",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".x19991ni{transition-property:opacity}\",\nltr: \".x1d8287x{transition-duration:.3s}\",\nltr: \".xwji4o3{transition-timing-function:ease}\","
+ },
+ {
+ "category": "Transitions & Animations",
+ "name": "transitionBehavior: allow-discrete",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".xd00j3c{transition-behavior:allow-discrete}\","
+ },
+ {
+ "category": "Transitions & Animations",
+ "name": "animation (shorthand)",
+ "supported": true,
+ "hasInject": false,
+ "output": ""
+ },
+ {
+ "category": "Transitions & Animations",
+ "name": "stylex.keyframes",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \"@keyframes x1wc8ddo-B{from{transform:rotate(0deg);}to{transform:rotate(360deg);}}\",\nltr: \".x1aerksh{animation-name:x1wc8ddo-B}\","
+ },
+ {
+ "category": "Dynamic Styles",
+ "name": "Dynamic values (function in stylex.create)",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".x5lhr3w{width:var(--x-width)}\",\nltr: \"@property --x-width { syntax: \\\"*\\\"; inherits: false;}\","
+ },
+ {
+ "category": "Variables",
+ "name": "stylex.defineVars",
+ "supported": false,
+ "error": "/vercel/sandbox/repos/xds-worktrees/stylex-caps/test.tsx: Unable to generate hash for defineVars(). Check that the file has a valid extension and that unstable_moduleResolution is configured."
+ },
+ {
+ "category": "Variables",
+ "name": "stylex.createTheme",
+ "supported": false,
+ "error": "/vercel/sandbox/repos/xds-worktrees/stylex-caps/test.tsx: Unable to generate hash for defineVars(). Check that the file has a valid extension and that unstable_moduleResolution is configured."
+ },
+ {
+ "category": "Ancestor/Sibling Selectors",
+ "name": "stylex.when.ancestor(:hover)",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".x1e2nbdu{color:red}\",\nltr: \".xobp4yc.xobp4yc:where(.x-default-marker:hover *){color:blue}\","
+ },
+ {
+ "category": "Ancestor/Sibling Selectors",
+ "name": "stylex.when.ancestor(:hover) + @media",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".x1e2nbdu{color:red}\",\nltr: \"@media (hover: hover){.x1mm45h8.x1mm45h8.x1mm45h8:where(.x-default-marker:hover *){color:blue}}\","
+ },
+ {
+ "category": "Ancestor/Sibling Selectors",
+ "name": "stylex.when.ancestor(:focus-within)",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".xzppbbw{border-color:gray}\",\nltr: \".x1y7zxk6.x1y7zxk6:where(.x-default-marker:focus-within *){border-color:blue}\","
+ },
+ {
+ "category": "Ancestor/Sibling Selectors",
+ "name": "stylex.when.ancestor(:active)",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".x1c071of{transform:none}\",\nltr: \".x1nyz7lo.x1nyz7lo:where(.x-default-marker:active *){transform:scale(.98)}\","
+ },
+ {
+ "category": "Ancestor/Sibling Selectors",
+ "name": "stylex.when.ancestor(:disabled)",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".x1hc1fzr{opacity:1}\",\nltr: \".x1ymx0df.x1ymx0df:where(.x-default-marker:disabled *){opacity:.5}\","
+ },
+ {
+ "category": "Ancestor/Sibling Selectors",
+ "name": "stylex.when.ancestor([data-attr])",
+ "supported": false,
+ "error": "/vercel/sandbox/repos/xds-worktrees/stylex-caps/test.tsx: Pseudo selector must start with \":\""
+ },
+ {
+ "category": "Ancestor/Sibling Selectors",
+ "name": "stylex.when.descendant(:hover)",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".x1e2nbdu{color:red}\",\nltr: \".xepvv76.xepvv76:where(:has(.x-default-marker:hover)){color:blue}\","
+ },
+ {
+ "category": "Ancestor/Sibling Selectors",
+ "name": "stylex.when.siblingBefore(:checked)",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".x1e2nbdu{color:red}\",\nltr: \".x72zv5i.x72zv5i:where(.x-default-marker:checked ~ *){color:blue}\","
+ },
+ {
+ "category": "Ancestor/Sibling Selectors",
+ "name": "stylex.when.siblingAfter(:checked)",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".x1e2nbdu{color:red}\",\nltr: \".x1e2z1t3.x1e2z1t3:where(:has(~ .x-default-marker:checked)){color:blue}\","
+ },
+ {
+ "category": "Ancestor/Sibling Selectors",
+ "name": "stylex.when.anySibling(:hover)",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".x1hc1fzr{opacity:1}\",\nltr: \".x1tq5f2g.x1tq5f2g:where(.x-default-marker:hover ~ *, :has(~ .x-default-marker:hover)){opacity:.5}\","
+ },
+ {
+ "category": "StyleX APIs",
+ "name": "stylex.firstThatWorks()",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".x1fb8ovd{display:flex;display:grid}\","
+ },
+ {
+ "category": "StyleX APIs",
+ "name": "stylex.positionTry()",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \"@position-try --x19yd6gm {top:top;top:anchor(end);}\",\nltr: \".xvc0jx8{position-try-options:--x19yd6gm}\","
+ },
+ {
+ "category": "StyleX APIs",
+ "name": "stylex.viewTransitionClass()",
+ "supported": false,
+ "error": "/vercel/sandbox/repos/xds-worktrees/stylex-caps/test.tsx: viewTransitionClass() should have 1 argument."
+ },
+ {
+ "category": "StyleX APIs",
+ "name": "stylex.defineConsts()",
+ "filename": "test.stylex.ts",
+ "supported": false,
+ "error": "/vercel/sandbox/repos/xds-worktrees/stylex-caps/test.stylex.ts: Unable to generate hash for defineConsts(). Check that the file has a valid extension and that unstable_moduleResolution is configured."
+ },
+ {
+ "category": "StyleX APIs",
+ "name": "stylex.types.color()",
+ "filename": "test.stylex.ts",
+ "supported": false,
+ "error": "/vercel/sandbox/repos/xds-worktrees/stylex-caps/test.stylex.ts: Unable to generate hash for defineVars(). Check that the file has a valid extension and that unstable_moduleResolution is configured."
+ },
+ {
+ "category": "StyleX APIs",
+ "name": "stylex.types.length()",
+ "filename": "test.stylex.ts",
+ "supported": false,
+ "error": "/vercel/sandbox/repos/xds-worktrees/stylex-caps/test.stylex.ts: Unable to generate hash for defineVars(). Check that the file has a valid extension and that unstable_moduleResolution is configured."
+ },
+ {
+ "category": "Bleeding Edge",
+ "name": "@scope",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".x1e2nbdu{color:red}\",\nltr: \"@scope (.card){.x1ph799q.x1ph799q{color:blue}}\","
+ },
+ {
+ "category": "Bleeding Edge",
+ "name": "@property (explicit)",
+ "supported": false,
+ "hasInject": true,
+ "output": "ltr: \"@property --my-color{.xmbuxpl.xmbuxpl{syntax:\\\"<color>\\\"}}\",\nltr: \"@property --my-color{.x134jcp1.x134jcp1{inherits:false}}\",\nltr: \"@property --my-color{.xvp880b.xvp880b{initial-value:red}}\",",
+ "invalidReason": "Compiles but produces invalid CSS output"
+ },
+ {
+ "category": "Bleeding Edge",
+ "name": "::view-transition-old",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".x1bb6q1l::view-transition-old(root){animation-duration:.3s}\","
+ },
+ {
+ "category": "Bleeding Edge",
+ "name": "::view-transition-new",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".x1wpo8qz::view-transition-new(root){animation-duration:.3s}\","
+ },
+ {
+ "category": "Bleeding Edge",
+ "name": ":modal",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".x12peec7{background-color:white}\",\nltr: \".x1mt27nc:modal{background-color:white}\","
+ },
+ {
+ "category": "Bleeding Edge",
+ "name": "anchor() positioning",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".xnj0yav{top:anchor(--my-anchor bottom)}\",\nltr: \".x1os70c6{position-anchor:--my-anchor}\","
+ },
+ {
+ "category": "Bleeding Edge",
+ "name": "CSS nesting (&)",
+ "supported": false,
+ "error": "/vercel/sandbox/repos/xds-worktrees/stylex-caps/test.tsx: Invalid pseudo or at-rule."
+ },
+ {
+ "category": "Bleeding Edge",
+ "name": "@media (scripting: none)",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".x1lliihq{display:block}\",\nltr: \"@media (scripting: none){.x1cfwndu.x1cfwndu{display:none}}\","
+ },
+ {
+ "category": "Bleeding Edge",
+ "name": ":user-valid / :user-invalid",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".xzppbbw{border-color:gray}\",\nltr: \".xwdq3mt:user-invalid{border-color:red}\",\nltr: \".x109kazt:user-valid{border-color:green}\","
+ },
+ {
+ "category": "Bleeding Edge",
+ "name": "color-scheme property",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".x108lcm5{color-scheme:light dark}\","
+ },
+ {
+ "category": "Bleeding Edge",
+ "name": "text-wrap: balance",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".x1w2vvpw{text-wrap:balance}\","
+ },
+ {
+ "category": "Bleeding Edge",
+ "name": "text-wrap: pretty",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".x1fzhlzt{text-wrap:pretty}\","
+ },
+ {
+ "category": "Bleeding Edge",
+ "name": "field-sizing: content",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".x5f5z56{field-sizing:content}\","
+ },
+ {
+ "category": "Bleeding Edge",
+ "name": "interpolate-size: allow-keywords",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".xftp66k{interpolate-size:allow-keywords}\","
+ },
+ {
+ "category": "Bleeding Edge",
+ "name": "scrollbar-gutter",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".x185mbhu{scrollbar-gutter:stable}\","
+ },
+ {
+ "category": "Bleeding Edge",
+ "name": "scrollbar-width",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".x1597r2g{scrollbar-width:thin}\","
+ },
+ {
+ "category": "Bleeding Edge",
+ "name": "accent-color",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".xwgdyvq{accent-color:blue}\","
+ },
+ {
+ "category": "Logical Properties",
+ "name": "paddingInline / paddingBlock",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".x1hr3lfm{padding-inline:16px}\",\nltr: \".x1vvogim{padding-block:8px}\","
+ },
+ {
+ "category": "Logical Properties",
+ "name": "insetInlineStart / insetInlineEnd",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".x1o0tod{inset-inline-start:0}\",\nltr: \".x1woyocn{inset-inline-end:auto}\","
+ },
+ {
+ "category": "Logical Properties",
+ "name": "borderInlineStart",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".xpilrb4{border-inline-start-width:1px}\",\nltr: \".x1t7ytsu{border-inline-start-style:solid}\",\nltr: \".x17t5hbb{border-inline-start-color:gray}\","
+ },
+ {
+ "category": "Logical Properties",
+ "name": "marginInlineStart: auto",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".xvc5jky{margin-inline-start:auto}\","
+ },
+ {
+ "category": "Layout",
+ "name": "display: grid",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".xrvj5dj{display:grid}\",\nltr: \".x1o61qjw{grid-template-columns:1fr 1fr}\",\nltr: \".xou54vl{gap:16px}\","
+ },
+ {
+ "category": "Layout",
+ "name": "display: flex + gap",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".x78zum5{display:flex}\",\nltr: \".xou54vl{gap:16px}\","
+ },
+ {
+ "category": "Layout",
+ "name": "aspect-ratio",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".x186iv6y{aspect-ratio:16 / 9}\","
+ },
+ {
+ "category": "Layout",
+ "name": "overscrollBehavior",
+ "supported": true,
+ "hasInject": true,
+ "output": "ltr: \".xish69e{overscroll-behavior:contain}\","
+ }
+ ]
+}
\ No newline at end of file
diff --git a/internal/stylex-capabilities/scan.mjs b/internal/stylex-capabilities/scan.mjs
new file mode 100644
index 0000000000..879a3bbd34
--- /dev/null
+++ b/internal/stylex-capabilities/scan.mjs
@@ -0,0 +1,734 @@
+#!/usr/bin/env node
+/**
+ * StyleX CSS Capability Scanner
+ *
+ * Tests a battery of CSS features against the installed StyleX babel plugin
+ * to determine what's supported. Outputs a capability reference document.
+ *
+ * Usage: node internal/stylex-capabilities/scan.mjs
+ */
+
+import babel from '@babel/core';
+import stylexPlugin from '@stylexjs/babel-plugin';
+import fs from 'fs';
+import path from 'path';
+import {fileURLToPath} from 'url';
+
+const __dirname = path.dirname(fileURLToPath(import.meta.url));
+
+// ============================================================================
+// Test cases — each is a minimal StyleX snippet testing one CSS feature
+// ============================================================================
+
+const tests = [
+ // At-rules
+ {
+ category: 'At-Rules',
+ name: '@media',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { color: { default: 'red', '@media (max-width: 768px)': 'blue' } } });`,
+ },
+ {
+ category: 'At-Rules',
+ name: '@media (hover: hover)',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { color: { default: 'red', '@media (hover: hover)': 'blue' } } });`,
+ },
+ {
+ category: 'At-Rules',
+ name: '@media (prefers-reduced-motion)',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { animationDuration: { default: '0.3s', '@media (prefers-reduced-motion: reduce)': '0.01s' } } });`,
+ },
+ {
+ category: 'At-Rules',
+ name: '@media (prefers-color-scheme)',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { color: { default: 'black', '@media (prefers-color-scheme: dark)': 'white' } } });`,
+ },
+ {
+ category: 'At-Rules',
+ name: '@supports',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { display: { default: 'flex', '@supports (display: grid)': 'grid' } } });`,
+ },
+ {
+ category: 'At-Rules',
+ name: '@container',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { fontSize: { default: '14px', '@container (min-width: 400px)': '16px' } } });`,
+ },
+ {
+ category: 'At-Rules',
+ name: '@container (named)',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { fontSize: { default: '14px', '@container sidebar (min-width: 400px)': '16px' } } });`,
+ },
+ {
+ category: 'At-Rules',
+ name: '@layer',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { '@layer': 'utilities', color: 'red' } });`,
+ },
+ {
+ category: 'At-Rules',
+ name: '@starting-style',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { opacity: 1, '@starting-style': { opacity: 0 } } });`,
+ },
+ {
+ category: 'At-Rules',
+ name: '@starting-style (transform)',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { transform: 'translateX(0)', '@starting-style': { transform: 'translateX(100%)' } } });`,
+ },
+
+ // Pseudo-classes
+ {
+ category: 'Pseudo-Classes',
+ name: ':hover',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { color: { default: 'red', ':hover': 'blue' } } });`,
+ },
+ {
+ category: 'Pseudo-Classes',
+ name: ':focus',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { color: { default: 'red', ':focus': 'blue' } } });`,
+ },
+ {
+ category: 'Pseudo-Classes',
+ name: ':focus-visible',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { outline: { default: 'none', ':focus-visible': '2px solid blue' } } });`,
+ },
+ {
+ category: 'Pseudo-Classes',
+ name: ':focus-within',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { borderColor: { default: 'gray', ':focus-within': 'blue' } } });`,
+ },
+ {
+ category: 'Pseudo-Classes',
+ name: ':active',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { color: { default: 'red', ':active': 'blue' } } });`,
+ },
+ {
+ category: 'Pseudo-Classes',
+ name: ':disabled',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { opacity: { default: 1, ':disabled': 0.5 } } });`,
+ },
+ {
+ category: 'Pseudo-Classes',
+ name: ':first-child',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { marginTop: { default: 8, ':first-child': 0 } } });`,
+ },
+ {
+ category: 'Pseudo-Classes',
+ name: ':last-child',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { marginBottom: { default: 8, ':last-child': 0 } } });`,
+ },
+ {
+ category: 'Pseudo-Classes',
+ name: ':nth-child()',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { backgroundColor: { default: 'white', ':nth-child(even)': '#f5f5f5' } } });`,
+ },
+ {
+ category: 'Pseudo-Classes',
+ name: ':where()',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { display: { default: 'none', ':where([open])': 'flex' } } });`,
+ },
+ {
+ category: 'Pseudo-Classes',
+ name: ':is()',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { color: { default: 'red', ':is(:hover, :focus)': 'blue' } } });`,
+ },
+ {
+ category: 'Pseudo-Classes',
+ name: ':has()',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { borderColor: { default: 'gray', ':has(:focus)': 'blue' } } });`,
+ },
+ {
+ category: 'Pseudo-Classes',
+ name: ':not()',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { display: { default: 'block', ':not(:last-child)': 'block' } } });`,
+ },
+ {
+ category: 'Pseudo-Classes',
+ name: ':placeholder-shown',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { color: { default: 'black', ':placeholder-shown': 'gray' } } });`,
+ },
+ {
+ category: 'Pseudo-Classes',
+ name: ':checked',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { backgroundColor: { default: 'white', ':checked': 'blue' } } });`,
+ },
+ {
+ category: 'Pseudo-Classes',
+ name: ':empty',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { display: { default: 'block', ':empty': 'none' } } });`,
+ },
+
+ // Pseudo-elements
+ {
+ category: 'Pseudo-Elements',
+ name: '::before',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { '::before': { content: '""', display: 'block' } } });`,
+ },
+ {
+ category: 'Pseudo-Elements',
+ name: '::after',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { '::after': { content: '""', display: 'block' } } });`,
+ },
+ {
+ category: 'Pseudo-Elements',
+ name: '::placeholder',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { '::placeholder': { color: 'gray', fontStyle: 'italic' } } });`,
+ },
+ {
+ category: 'Pseudo-Elements',
+ name: '::selection',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { '::selection': { backgroundColor: 'blue', color: 'white' } } });`,
+ },
+ {
+ category: 'Pseudo-Elements',
+ name: '::backdrop',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { '::backdrop': { backgroundColor: 'rgba(0,0,0,0.5)' } } });`,
+ },
+ {
+ category: 'Pseudo-Elements',
+ name: '::marker',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { '::marker': { color: 'blue' } } });`,
+ },
+ {
+ category: 'Pseudo-Elements',
+ name: '::file-selector-button',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { '::file-selector-button': { backgroundColor: 'blue', color: 'white' } } });`,
+ },
+
+ // Combinators & compound selectors
+ {
+ category: 'Compound Selectors',
+ name: 'Pseudo-class on pseudo-element (::backdrop + condition)',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { '::backdrop': { opacity: { default: 0, ':where([data-open])::backdrop': 1 } } } });`,
+ },
+ {
+ category: 'Compound Selectors',
+ name: 'RTL context (:is([dir="rtl"] *))',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { transform: { default: 'translateX(-100%)', ':is([dir="rtl"] *)': 'translateX(100%)' } } });`,
+ },
+ {
+ category: 'Compound Selectors',
+ name: 'Nested @media + pseudo',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { color: { default: 'red', ':hover': 'blue' }, '@media (hover: hover)': { color: { ':hover': 'green' } } } });`,
+ },
+
+ // CSS features
+ {
+ category: 'CSS Values',
+ name: 'CSS variables (custom properties)',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { color: 'var(--color-primary)' } });`,
+ },
+ {
+ category: 'CSS Values',
+ name: 'calc()',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { width: 'calc(100% - 32px)' } });`,
+ },
+ {
+ category: 'CSS Values',
+ name: 'clamp()',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { fontSize: 'clamp(14px, 2vw, 18px)' } });`,
+ },
+ {
+ category: 'CSS Values',
+ name: 'light-dark()',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { color: 'light-dark(black, white)' } });`,
+ },
+ {
+ category: 'CSS Values',
+ name: 'color-mix()',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { color: 'color-mix(in srgb, red 50%, blue)' } });`,
+ },
+ {
+ category: 'CSS Values',
+ name: 'container-type',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { containerType: 'inline-size' } });`,
+ },
+ {
+ category: 'CSS Values',
+ name: 'container-name',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { containerName: 'sidebar' } });`,
+ },
+
+ // Transitions & animations
+ {
+ category: 'Transitions & Animations',
+ name: 'transition (shorthand)',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { transition: 'opacity 0.3s ease' } });`,
+ },
+ {
+ category: 'Transitions & Animations',
+ name: 'transition (individual properties)',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { transitionProperty: 'opacity', transitionDuration: '0.3s', transitionTimingFunction: 'ease' } });`,
+ },
+ {
+ category: 'Transitions & Animations',
+ name: 'transitionBehavior: allow-discrete',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { transitionBehavior: 'allow-discrete' } });`,
+ },
+ {
+ category: 'Transitions & Animations',
+ name: 'animation (shorthand)',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { animation: 'spin 1s linear infinite' } });`,
+ },
+ {
+ category: 'Transitions & Animations',
+ name: 'stylex.keyframes',
+ code: `import * as stylex from '@stylexjs/stylex';
+const spin = stylex.keyframes({ from: { transform: 'rotate(0deg)' }, to: { transform: 'rotate(360deg)' } });
+const s = stylex.create({ t: { animationName: spin } });`,
+ },
+
+ // Dynamic styles
+ {
+ category: 'Dynamic Styles',
+ name: 'Dynamic values (function in stylex.create)',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ w: (w) => ({ width: w + 'px' }) });`,
+ },
+
+ // Define variables
+ {
+ category: 'Variables',
+ name: 'stylex.defineVars',
+ code: `import * as stylex from '@stylexjs/stylex';
+export const vars = stylex.defineVars({ primary: 'blue', secondary: 'green' });`,
+ },
+ {
+ category: 'Variables',
+ name: 'stylex.createTheme',
+ code: `import * as stylex from '@stylexjs/stylex';
+export const vars = stylex.defineVars({ primary: 'blue' });
+export const theme = stylex.createTheme(vars, { primary: 'red' });`,
+ },
+
+
+
+ // stylex.when — ancestor/sibling state selectors
+ {
+ category: 'Ancestor/Sibling Selectors',
+ name: 'stylex.when.ancestor(:hover)',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { color: { default: 'red', [stylex.when.ancestor(':hover')]: 'blue' } } });`,
+ },
+ {
+ category: 'Ancestor/Sibling Selectors',
+ name: 'stylex.when.ancestor(:hover) + @media',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { color: { default: 'red', [stylex.when.ancestor(':hover')]: { '@media (hover: hover)': 'blue' } } } });`,
+ },
+ {
+ category: 'Ancestor/Sibling Selectors',
+ name: 'stylex.when.ancestor(:focus-within)',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { borderColor: { default: 'gray', [stylex.when.ancestor(':focus-within')]: 'blue' } } });`,
+ },
+ {
+ category: 'Ancestor/Sibling Selectors',
+ name: 'stylex.when.ancestor(:active)',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { transform: { default: 'none', [stylex.when.ancestor(':active')]: 'scale(0.98)' } } });`,
+ },
+ {
+ category: 'Ancestor/Sibling Selectors',
+ name: 'stylex.when.ancestor(:disabled)',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { opacity: { default: 1, [stylex.when.ancestor(':disabled')]: 0.5 } } });`,
+ },
+ {
+ category: 'Ancestor/Sibling Selectors',
+ name: 'stylex.when.ancestor([data-attr])',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { color: { default: 'red', [stylex.when.ancestor('[data-selected]')]: 'blue' } } });`,
+ },
+
+ // stylex.when — descendant and sibling selectors
+ {
+ category: 'Ancestor/Sibling Selectors',
+ name: 'stylex.when.descendant(:hover)',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { color: { default: 'red', [stylex.when.descendant(':hover')]: 'blue' } } });`,
+ },
+ {
+ category: 'Ancestor/Sibling Selectors',
+ name: 'stylex.when.siblingBefore(:checked)',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { color: { default: 'red', [stylex.when.siblingBefore(':checked')]: 'blue' } } });`,
+ },
+ {
+ category: 'Ancestor/Sibling Selectors',
+ name: 'stylex.when.siblingAfter(:checked)',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { color: { default: 'red', [stylex.when.siblingAfter(':checked')]: 'blue' } } });`,
+ },
+ {
+ category: 'Ancestor/Sibling Selectors',
+ name: 'stylex.when.anySibling(:hover)',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { opacity: { default: 1, [stylex.when.anySibling(':hover')]: 0.5 } } });`,
+ },
+
+ // stylex top-level APIs
+ {
+ category: 'StyleX APIs',
+ name: 'stylex.firstThatWorks()',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { display: stylex.firstThatWorks('grid', 'flex') } });`,
+ },
+ {
+ category: 'StyleX APIs',
+ name: 'stylex.positionTry()',
+ code: `import * as stylex from '@stylexjs/stylex';
+const pt = stylex.positionTry({ insetBlockStart: 'anchor(end)' });
+const s = stylex.create({ t: { positionTryOptions: pt } });`,
+ },
+ {
+ category: 'StyleX APIs',
+ name: 'stylex.viewTransitionClass()',
+ code: `import * as stylex from '@stylexjs/stylex';
+const vtc = stylex.viewTransitionClass();
+const s = stylex.create({ t: { viewTransitionName: vtc } });`,
+ },
+ {
+ category: 'StyleX APIs',
+ name: 'stylex.defineConsts()',
+ filename: 'test.stylex.ts',
+ code: `import * as stylex from '@stylexjs/stylex';
+export const consts = stylex.defineConsts({ maxWidth: '1200px', headerHeight: '64px' });`,
+ },
+ {
+ category: 'StyleX APIs',
+ name: 'stylex.types.color()',
+ filename: 'test.stylex.ts',
+ code: `import * as stylex from '@stylexjs/stylex';
+export const vars = stylex.defineVars({ primary: stylex.types.color('blue') });`,
+ },
+ {
+ category: 'StyleX APIs',
+ name: 'stylex.types.length()',
+ filename: 'test.stylex.ts',
+ code: `import * as stylex from '@stylexjs/stylex';
+export const vars = stylex.defineVars({ spacing: stylex.types.length('16px') });`,
+ },
+
+ // Bleeding-edge CSS features
+ {
+ category: 'Bleeding Edge',
+ name: '@scope',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { color: { default: 'red', '@scope (.card)': 'blue' } } });`,
+ },
+ {
+ category: 'Bleeding Edge',
+ name: '@property (explicit)',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { '@property --my-color': { syntax: '"<color>"', inherits: 'false', initialValue: 'red' } } });`,
+ },
+ {
+ category: 'Bleeding Edge',
+ name: '::view-transition-old',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { '::view-transition-old(root)': { animationDuration: '0.3s' } } });`,
+ },
+ {
+ category: 'Bleeding Edge',
+ name: '::view-transition-new',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { '::view-transition-new(root)': { animationDuration: '0.3s' } } });`,
+ },
+ {
+ category: 'Bleeding Edge',
+ name: ':modal',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { backgroundColor: { default: 'white', ':modal': 'white' } } });`,
+ },
+ {
+ category: 'Bleeding Edge',
+ name: 'anchor() positioning',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { top: 'anchor(--my-anchor bottom)', positionAnchor: '--my-anchor' } });`,
+ },
+ {
+ category: 'Bleeding Edge',
+ name: 'CSS nesting (&)',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { color: 'red', '& .child': { color: 'blue' } } });`,
+ },
+ {
+ category: 'Bleeding Edge',
+ name: '@media (scripting: none)',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { display: { default: 'block', '@media (scripting: none)': 'none' } } });`,
+ },
+ {
+ category: 'Bleeding Edge',
+ name: ':user-valid / :user-invalid',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { borderColor: { default: 'gray', ':user-invalid': 'red', ':user-valid': 'green' } } });`,
+ },
+ {
+ category: 'Bleeding Edge',
+ name: 'color-scheme property',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { colorScheme: 'light dark' } });`,
+ },
+ {
+ category: 'Bleeding Edge',
+ name: 'text-wrap: balance',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { textWrap: 'balance' } });`,
+ },
+ {
+ category: 'Bleeding Edge',
+ name: 'text-wrap: pretty',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { textWrap: 'pretty' } });`,
+ },
+ {
+ category: 'Bleeding Edge',
+ name: 'field-sizing: content',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { fieldSizing: 'content' } });`,
+ },
+ {
+ category: 'Bleeding Edge',
+ name: 'interpolate-size: allow-keywords',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { interpolateSize: 'allow-keywords' } });`,
+ },
+ {
+ category: 'Bleeding Edge',
+ name: 'scrollbar-gutter',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { scrollbarGutter: 'stable' } });`,
+ },
+ {
+ category: 'Bleeding Edge',
+ name: 'scrollbar-width',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { scrollbarWidth: 'thin' } });`,
+ },
+ {
+ category: 'Bleeding Edge',
+ name: 'accent-color',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { accentColor: 'blue' } });`,
+ },
+
+ // Logical properties
+ {
+ category: 'Logical Properties',
+ name: 'paddingInline / paddingBlock',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { paddingInline: 16, paddingBlock: 8 } });`,
+ },
+ {
+ category: 'Logical Properties',
+ name: 'insetInlineStart / insetInlineEnd',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { insetInlineStart: 0, insetInlineEnd: 'auto' } });`,
+ },
+ {
+ category: 'Logical Properties',
+ name: 'borderInlineStart',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { borderInlineStartWidth: 1, borderInlineStartStyle: 'solid', borderInlineStartColor: 'gray' } });`,
+ },
+ {
+ category: 'Logical Properties',
+ name: 'marginInlineStart: auto',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { marginInlineStart: 'auto' } });`,
+ },
+
+ // Modern layout
+ {
+ category: 'Layout',
+ name: 'display: grid',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 16 } });`,
+ },
+ {
+ category: 'Layout',
+ name: 'display: flex + gap',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { display: 'flex', gap: 16 } });`,
+ },
+ {
+ category: 'Layout',
+ name: 'aspect-ratio',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { aspectRatio: '16 / 9' } });`,
+ },
+ {
+ category: 'Layout',
+ name: 'overscrollBehavior',
+ code: `import * as stylex from '@stylexjs/stylex';
+const s = stylex.create({ t: { overscrollBehavior: 'contain' } });`,
+ },
+];
+
+// ============================================================================
+// Runner
+// ============================================================================
+
+function testFeature(test) {
+ if (test.skipTest) {
+ return { ...test };
+ }
+ try {
+ const result = babel.transformSync(test.code, {
+ filename: test.filename || 'test.tsx',
+ presets: ['@babel/preset-typescript'],
+ plugins: [[stylexPlugin, {dev: true, runtimeInjection: true}]],
+ });
+ // Check if StyleX actually processed it (look for inject calls)
+ const hasInject = result.code.includes('_inject');
+ const hasStylex = result.code.includes('stylex');
+ const output = result.code.split('\n').filter(l => l.includes('ltr:')).map(l => l.trim()).join('\n');
+
+ // Validate output — some features compile but produce invalid CSS
+ const invalidPatterns = [
+ // @layer used as a property value inside a class selector
+ /@layer\{[^}]*\{@layer:/,
+ // @property wrapping class selectors (should be standalone declaration)
+ /@property[^{]*\{\.x[a-z0-9]+/,
+ ];
+ const hasInvalidOutput = invalidPatterns.some(p => p.test(output));
+
+ return {
+ ...test,
+ supported: !hasInvalidOutput,
+ hasInject,
+ output,
+ ...(hasInvalidOutput ? {invalidReason: 'Compiles but produces invalid CSS output'} : {}),
+ };
+ } catch (e) {
+ return {
+ ...test,
+ supported: false,
+ error: e.message.split('\n')[0],
+ };
+ }
+}
+
+// ============================================================================
+// Main
+// ============================================================================
+
+const results = tests.map(testFeature);
+
+// Get StyleX version
+const stylexPkg = JSON.parse(
+ fs.readFileSync(
+ path.resolve(__dirname, '../../node_modules/@stylexjs/stylex/package.json'),
+ 'utf8',
+ ),
+);
+
+// Group by category
+const categories = {};
+for (const r of results) {
+ if (!categories[r.category]) categories[r.category] = [];
+ categories[r.category].push(r);
+}
+
+// Generate markdown
+let md = `# StyleX CSS Capability Reference\n\n`;
+md += `> Auto-generated by \`internal/stylex-capabilities/scan.mjs\`\n`;
+md += `> StyleX version: **${stylexPkg.version}**\n`;
+md += `> Generated: ${new Date().toISOString().split('T')[0]}\n\n`;
+
+const supported = results.filter(r => r.supported).length;
+const total = results.length;
+md += `**${supported}/${total}** features supported\n\n`;
+
+for (const [cat, items] of Object.entries(categories)) {
+ md += `## ${cat}\n\n`;
+ md += `| Feature | Status | CSS Output |\n`;
+ md += `|---------|--------|------------|\n`;
+ for (const item of items) {
+ const status = item.supported ? '✅' : '❌';
+ const output = item.supported
+ ? item.output ? `\`${item.output.slice(0, 80)}\`` : '(processed)'
+ : item.error?.slice(0, 60) || 'Error';
+ md += `| ${item.name} | ${status} | ${output} |\n`;
+ }
+ md += `\n`;
+}
+
+// Also generate a compact version for LLM context
+md += `---\n\n## Compact Reference (for LLM context)\n\n`;
+md += `StyleX v${stylexPkg.version} supports these CSS features in \`stylex.create()\`:\n\n`;
+for (const [cat, items] of Object.entries(categories)) {
+ md += `**${cat}:** `;
+ md += items.map(i => `${i.name} ${i.supported ? '✅' : '❌'}`).join(', ');
+ md += `\n\n`;
+}
+
+// Write output
+const outPath = path.resolve(__dirname, 'CAPABILITIES.md');
+fs.writeFileSync(outPath, md);
+console.log(`Written to ${outPath}`);
+console.log(`\n${supported}/${total} features supported (StyleX v${stylexPkg.version})`);
+
+// Also write JSON for programmatic use
+const jsonPath = path.resolve(__dirname, 'capabilities.json');
+fs.writeFileSync(
+ jsonPath,
+ JSON.stringify(
+ {
+ version: stylexPkg.version,
+ generatedAt: new Date().toISOString(),
+ total,
+ supported,
+ results: results.map(({code, ...r}) => r),
+ },
+ null,
+ 2,
+ ),
+);
+console.log(`JSON written to ${jsonPath}`);