Skip to content

spec(AST-071): every styling input works from every styling system - #7277

Merged
cixzhang merged 2 commits into
mainfrom
spec-styling-library-compat
Oct 11, 2026
Merged

cixzhang merged 2 commits into
mainfrom
spec-styling-library-compat

Conversation

@cixzhang

Copy link
Copy Markdown
Contributor

Exact decision needed

Whether a component may accept a StyleX styling input for one of its parts (popoverXstyle, contentXstyle, triggerXstyle) without matching class-name and inline-style inputs for the same element.

Existing authority searched

  • architecture:public-component-api: INV5 and INV6 say the root's xstyle, className and style reach the contract element and compose. Neither says anything about elements other than the root.
  • spec:AST-002/DEC-1: admission of a new prop. It decides whether a part input may exist, not what shape it takes.
  • architecture:component-style-authoring and architecture:theme-tokens: StyleX inside components, and token access for non-StyleX consumers. Neither covers component styling props.
  • Exported props typed with StyleX styles, inventoried across packages/core/src. Three conform to neither rule: ComplexSelector.contentXstyle, ContextMenu.triggerXstyle, BaseTypeahead.inputXStyle. An internal triggerXstyle in the Table context menu is not reachable and is out of scope.
  • Open work: feat(DropdownMenu): popoverXstyle styles the popover surface that paints the menu #7202 adds popoverXstyle alone and is the prompt for this decision.

No current claim settles it, which is why one-off part xstyle props keep being added and then cited as precedent.

Decision

spec:AST-071/DEC-1, decided by @cixzhang: every styling input works from every styling system.

  • FR1: a styling input for a non-root element comes as <part>Xstyle, <part>ClassName and <part>Style. All three reach the same element and compose the way the root's three do.
  • FR2: no public prop accepts StyleX styles for an element that cannot also take a class name and inline styles.

architecture:public-component-api gains INV15, a verification row, and the deciding-spec entry.

Rejected alternatives

  • Admitting a part xstyle alone and adding its counterparts on request. Callers who don't use StyleX stay locked out until someone asks, and every unpaired prop becomes the precedent for the next one.

Claim scope and non-goals

  • Governs the shape of part styling inputs and StyleX-typed styling props only.
  • It does not admit any part input. That stays with spec:AST-002/DEC-1, so this record does not make popoverXstyle acceptable even with counterparts.
  • It does not settle composition order (INV6) or theming.
  • OQ1 leaves open how the three known gaps reach conformance.

Evidence and implementation relationship

There is no implementation in this PR. The prop inventory above is the evidence that the gap exists.

Writing rubric results

  • R1 narration: none. Both records are in the present tense; the known gaps are stated as current facts.
  • R2 research in the record: none. The inventory is here, not in the record.
  • R3 evidence naming a change: none. Verification cites the declaration inventory and render tests.
  • R4 rejected alternatives over one line or outside a decision: one alternative, one line, inside DEC-1.
  • R5 pull request or issue references remaining: none in either record.
  • R6 ruled open questions still listing options: none. OQ1 is unruled and lists no options.

Scope

  • This PR contains specification records only.
  • It records observable behavior and preserves equivalent internal implementations.
  • Any named internal mechanism is intentionally public, names its dependent caller/system, and explains why an equivalent implementation would not satisfy the contract.
  • Verification states the evidence layer and failure signal without prescribing CI job/workflow topology.
  • It records one intentional durable decision, not a rescue for a separable tagalong.
  • The canonical knowledge owner, affected current claims, and overlapping open work are named; any ownership collision is resolved or called out for human decision.
  • Adjacent API, visual, accessibility, composition, and implementation facts remain outside scope unless this exact decision depends on them.
  • Public text and artifacts contain no internal Meta context.

Validation

  • pnpm check:knowledge: aligned
  • Prettier: applied
  • git diff --check: clean

A part's styling input is the full set the root already takes —
<part>Xstyle, <part>ClassName and <part>Style on the same element — or it is
not admitted, so a product that styles with class names or inline styles can
reach every part StyleX can. public-component-api gains the invariant; the
three released props that do not conform are named as known gaps, not
precedent.
@vercel

vercel Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Oct 11, 2026 5:17pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 10, 2026
@astracat-bot

astracat-bot Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🔄 In progress (for maintainers only) Oct 11, 2026, 5:12 PM UTC

@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Oct 10, 2026
@github-actions

github-actions Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

Previews ready: Storybook and Sandbox were built with this PR's docsite. CI evidence will be added when available.

View Storybook for this PR · View Sandbox for this PR

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for framing this as one explicit decision. The direction is coherent: a part that can only be reached through StyleX leaves class-name and inline-style users locked out, and each unpaired part prop becomes precedent for the next.

Approval needs a maintainer decision before this can land as governing policy. Current public-API authority settles the root xstyle / className / style set, but it does not settle part styling inputs, so a maintainer needs to ratify the new rule as the governing spec for <part>Xstyle / <part>ClassName / <part>Style and for disallowing StyleX-only styling props. That decision should also make the authority form explicit, since the new spec is still marked draft/proposed while the shared record it updates is current.

One correction is also needed in the record itself: BaseTypeahead.inputXStyle does not fit the other two listed gaps as written, because its input already receives the root className and style alongside both StyleX inputs. Please remove or qualify that entry as a legacy alias case, or tighten the rule wording if same-prefix counterparts are intended even when the root set reaches the same element.

The other two listed gaps do match the StyleX-only part pattern, and the change correctly leaves admission of any specific part prop, composition order, and theming with their existing owners.

[Automated review]

@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec aa45fec

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Oct 11, 2026
@astracat-bot

astracat-bot Bot commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

Advisory; the owner approves. Spec-only and clean: the knowledge check and Prettier pass, it merges cleanly onto today's main, and the known-gaps list is still exact — ComplexSelector.contentXstyle, ContextMenu.triggerXstyle and BaseTypeahead.inputXStyle remain the only public StyleX-only part inputs on main, each still without a class-name or inline-style sibling; the other StyleX-typed part props in core are internal. Nothing landed since 10/10 adds a part input (the TopNavMegaMenuItem change adds root styling as a full set). The INV15 addition edits a current record, so the owner's /approve-spec on this head is the remaining gate.

[Automated review]

Approved by cixzhang on 2026-10-11.
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 6da2e06

@cixzhang
cixzhang enabled auto-merge (squash) October 11, 2026 17:12
@cixzhang
cixzhang merged commit e3c1cfd into main Oct 11, 2026
41 checks passed
@github-actions
github-actions Bot deleted the spec-styling-library-compat branch October 12, 2026 06:35

This branch was successfully deployed

1 active deployment
Preview — 6da2e060 Deployed Oct 11, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant