Repository navigation
Conversation
… shared layers (AST-080, draft)
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis ReportView Storybook for this PR · View Sandbox for this PR
Generated by PR Enrichment workflow | View current CI run |
|
/approve-spec ba087a4 |
|
That The gate only accepts the exact current head, so post this instead: A new commit invalidates the command, so repeat it after any push. |
|
/approve-spec c851e35 |
There was a problem hiding this comment.
Requesting one wording fix before this record lands: the Current-state impact says non-Core stylesheets already omit the Core variable groups they read, but lab.css carries Core's data-token group because astryx.css omits it, as spec:AST-066 FR3 requires. Please qualify that bullet, FR2's last sentence, and FR2's failure row so they cover only groups astryx.css declares; read literally, they would let a follow-up strip the group and leave Lab's candlestick colors undeclared. It would also help to name both source-compiling getting-started examples (Next.js Source and Vite) and Charts' README in the Current-state impact.
[Automated review]
| - Core, Lab, Rich Text, and Charts already export one stylesheet each with every | ||
| rule inside `@layer astryx-base`; non-Core stylesheets already omit the Core | ||
| variable groups they read. |
There was a problem hiding this comment.
lab.css does not omit every Core variable group it reads: built at this head it declares all 56 of Core's --color-data-* defaults, because only Lab's ChartCandlestick reads dataVars and astryx.css omits the group. That is what spec:AST-066 FR3 requires. Suggest: "non-Core stylesheets omit the Core variable groups astryx.css declares; Lab's keeps Core's data-token group, which astryx.css omits (spec:AST-066 FR3)."
| the package supports, with no StyleX compiler in the product's build. A non-Core | ||
| stylesheet relies on `astryx.css` only for the Core definitions its modules | ||
| read, such as variable groups and keyframes, and does not repeat them. |
There was a problem hiding this comment.
Read literally, this says a non-Core stylesheet takes Core variable groups from astryx.css and never carries one. Lab must carry Core's data-token group (spec:AST-066 FR3), or its candlestick colors are undeclared in a prebuilt setup. Suggest ending with "…and does not repeat a definition astryx.css declares."
| | Contract | Verification | Representative states | Mutation or failure expectation | | ||
| | -------- | ---------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | | ||
| | FR1 | package manifest and stylesheet build tests | every published package with styled modules; a module's rules in its package stylesheet | a styled published package has no `.css` export; a rule a module uses is missing | | ||
| | FR2 | real-browser computed styles with no StyleX compiler | a representative component from each package; default, hover, focus, disabled, dark, and right-to-left | removing the package stylesheet changes a computed style; a non-Core stylesheet repeats a Core group | |
There was a problem hiding this comment.
Same qualifier here: "a non-Core stylesheet repeats a Core group" would fail today's lab.css, which correctly carries the data-token group. Suggest "a non-Core stylesheet repeats a group astryx.css declares".
| - The styling overview's "StyleX from source" path tells a product to omit | ||
| `astryx.css` and compile component styles from source, and the getting-started | ||
| examples list a setup that imports Astryx from source. Both conflict with FR5; | ||
| the setup becomes "load `astryx.css`; compile only your own code." |
There was a problem hiding this comment.
Optional: the getting-started list has two source-compiling setups, Next.js Source and Vite; both compile Core source through @astryxdesign/build and load no astryx.css. Naming both keeps the follow-up from missing the Vite example.
|
/approve-spec c78ee8a |
Exact decision needed
Should Astryx record, as one system contract, how it distributes component CSS: every published package ships one prebuilt stylesheet, every package stylesheet sits in the same
astryx-baselayer under the same layer order, and every documented setup loads those files instead of compiling Astryx source?Who it affects: anyone building a product on Astryx. Today the setup docs offer a path that compiles Astryx source and drops
astryx.css. Mixed with a prebuilt stylesheet, that path emits a second copy of component rules that outranks theme overrides, so a themed component shows its base colors. Example: a theme that restyles the destructive Button as a light red fill with dark red text instead renders the base solid red with white text.Existing authority searched
spec:AST-066(current) owns StyleX data-token ownership. FR3 already makes package CSS extraction dependency-aware, and FR7 requires theme output to register@layer reset, astryx-base, astryx-theme;. It does not own package stylesheets as a distribution surface, and its non-goals exclude source-build composition.architecture:theme-compilationandarchitecture:theme-applicationown theme CSS, not component stylesheets.architecture:component-style-authoringowns how component styles are written, not how they ship.architecture:cli-surfaceINV19 requires integration theme packages to keep CSS side effectful; that is the precedent for FR4, scoped to themes.scripts/build-css.mjs(each package stylesheet wraps every rule in@layer astryx-base; non-Core stylesheets omit Core groups), packageexports/sideEffects,reset.css, the styling overview, getting started, migration setup, package READMEs, and the example apps.No current record owns this fact, so this is a new record rather than an amendment. Folding it into AST-066 would stretch a data-token record into a packaging contract.
Decision
AST-080 (
authority: current, ownercixzhang, approved 2026-10-15):@astryxdesign/*package with styled modules exports one prebuilt stylesheet (astryx.css,lab.css,richtext.css, andcharts.cssfrom its first published release; any future package ships one with its first styled release).astryx.cssplus a theme styles everything the package renders with no StyleX compiler in the product.reset.csskeeps all rules in its one Astryx layer and begins with@layer reset, astryx-base, astryx-theme;, so theme overrides win across packages in any load order.sideEffectscovers it.Rejected alternatives
Claim scope and non-goals
Only how Astryx distributes component CSS. Not covered: how a product configures its own compiler (including StyleX settings for its own code or ejected components), theme stylesheet contents, which variable groups a stylesheet holds (AST-066 FR3), subsets, minification, and the
@astryxdesign/buildsource-build package. This PR does not decide that package's future.Evidence and implementation relationship
Spec only; no implementation here. Conflicts with the current state that a follow-up implementation PR would fix:
reset.csscarries the FR3 order registration. Loadingreset.cssafter a package stylesheet without the product's own registration line placesresetaboveastryx-base.sideEffects: false, which does not cover their stylesheets (FR4).astryx.cssand compile component styles from source, and the getting-started examples list a "Next.js Source" setup that imports Astryx from source (FR5).The repository's StyleX example app already follows FR5: it loads
astryx.cssand compiles only its own code.Writing rubric results
Scope
Validation
pnpm check:knowledge: alignedgit diff --check: clean