RFC + PoC: Component Style Spec DSL - #36745
Draft
Dmytro Kirpa (dmytrokirpa) wants to merge 8 commits into
Draft
Dmytro Kirpa (dmytrokirpa) wants to merge 8 commits into
Dmytro Kirpa (dmytrokirpa) wants to merge 8 commits into
Conversation
Introduce a framework-agnostic ComponentStyleSpec JSON DSL with @fluentui/style-spec, Badge/Divider/Button specs, and compilers that deterministically emit Griffel, web-components CSS, and CSS Modules. Side-by-side PoC only — no edits to shipped component packages. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previous Behavior
Component styles for v9 React (Griffel), web components (FAST
css), and headless CSS Modules are authored independently. The same design decisions (slots, variant axes, states, token references) are re-implemented by hand on each surface, which invites drift and blocks a machine-readable style contract for downstream / headless wrappers.New Behavior
Adds an RFC and a side-by-side PoC for a framework-agnostic Component Style Spec DSL:
docs/react-v9/contributing/rfcs/shared/component-style-spec.md@fluentui/style-spec— JSON-shaped types, validate, normalize→IR, JSON schema (private PoC package)@fluentui/component-style-specs— Badge / Divider / Button specs transcribed from current v9 Griffel styles@fluentui/style-spec-compilers— deterministic Griffel / web-components CSS / CSS Modules emitters + CLI--check, fixtures, parity testsNo edits to shipped
react-badge/react-button/react-divider/web-components/ headless sources. Packages remainprivate: trueuntil RFC acceptance.Verification
All of the above pass locally (51 unit tests across the three packages).
Related Issue(s)
Made with Cursor