Skip to content

docs(richtext): the README shows Core's, the theme's and richtext's prebuilt stylesheets - #7582

Merged
cixzhang merged 2 commits into
mainfrom
richtext/readme-prebuilt-css
Oct 15, 2026
Merged

cixzhang merged 2 commits into
mainfrom
richtext/readme-prebuilt-css

Conversation

@cixzhang

@cixzhang cixzhang commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Reader impact

A product engineer installing the newly stable @astryxdesign/richtext follows its README, which is also the package's docsite page. The README showed Core's astryx.css and richtext.css but no theme stylesheet, and didn't say the package ships prebuilt CSS. A reader could leave the theme out, or try to set up StyleX to compile the package's source, which Astryx packages never need.

Change

  • The install section says RichText ships prebuilt CSS and JS like Core, so its source is never compiled.
  • It shows the stylesheet imports in Core's order: @astryxdesign/core/reset.css first, then @astryxdesign/core/astryx.css, the theme's CSS, and @astryxdesign/richtext/richtext.css.
  • It says richtext.css emits into @layer astryx-base, so the theme's @layer astryx-theme overrides win as long as reset.css (or a @layer reset, astryx-base, astryx-theme; line, for an app with its own reset) loads first. Without that, the theme's layer-order line appends reset above astryx-base, and its prose defaults override component styles.
  • The package's CLI integration header no longer calls it canary-only.
  • Docs Changeset for @astryxdesign/richtext.

Evidence

From a fresh pnpm build of packages/core and packages/richtext on main:

  • dist/richtext.css holds exactly one layer block, @layer astryx-base { … }, the same layer dist/astryx.css opens.
  • Class names: 183 in richtext.css, 2124 in astryx.css. The 125 they share are StyleX atomic classes, and each carries the identical rule in both files (0 differ), so loading both changes nothing.
  • Every token richtext.css reads is defined by Core or set at runtime: the --x-* dynamic properties, plus --color-syntax-comment, which Core's CodeBlock reads the same way.

Scope

  • Documentation only; no behavior change.
  • Public text and artifacts contain no internal Meta context.

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

vercel Bot commented Oct 15, 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 15, 2026 3:20pm UTC

Request Review

@astracat-bot

astracat-bot Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Oct 15, 2026, 3:40 PM UTC

@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR

🧪 Sandbox Preview

View Sandbox for this PR

No new or modified components detected.

Bundle Size Summary

No component packages changed.

Accessibility Audit

Status: No accessibility violations detected.

Visual Regression

38 of 474 shot(s) changed.

A change here is a question, not a failure: check whether the after is the
picture you intended. Record that review on the PR. Baseline maintenance is an
explicit dispatch of CI; this report never rewrites the baseline or adds a release gate.

component story theme mode pixels
Selector Indicator Space Bottom Sheet Narrow End RTL neutral light 754,077
Selector Indicator Space Bottom Sheet Wide Start neutral light 740,188
Chat Full AI Chat probe light 238,087
Chat Full AI Chat probe dark 237,060
Collapsible Dividers probe dark 66,445
Collapsible Dividers probe light 66,445
Chat Default neutral dark 33,205
Chat Default neutral light 32,876
Chat Empty State probe light 23,531
Chat Empty State probe dark 22,622
ChatAutoScroll Scroll Behavior Comparison neutral dark 15,378
ChatAutoScroll Scroll Behavior Comparison neutral light 14,107
Chat With Attachments probe light 13,406
Chat With Attachments probe dark 11,232
ProgressBar With Target Mark probe dark 7,895
ProgressBar With Target Mark probe light 7,895
TableRowExpansion Detail Panel neutral dark 5,150
TableRowExpansion Detail Panel neutral light 4,068
SideNav Resizable in AppShell probe dark 3,846
SideNav Resizable in AppShell probe light 3,846

and 18 more.


Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Changes requested: the new RichText stylesheet setup loads astryx.css before anything declares the reset layer, so the theme stylesheet's own @layer reset, astryx-base, astryx-theme; line places reset above astryx-base and the theme's prose defaults (:where(p), :where(h1, …, h6), :where(code, pre) and so on) override component styles. In a browser check with this branch's built CSS, a RichText table-header paragraph rendered at normal weight in the primary text color instead of the header cell's semibold secondary style; loading Core's reset.css first, as Core's README does, fixed it. Please add import '@astryxdesign/core/reset.css'; as the first import (apps with their own reset can declare the layer order instead), reword "as long as astryx.css comes first" to name that first import, and update the Changeset's "full stylesheet setup" sentence to match.

[Automated review]

Comment on lines 61 to 63
import '@astryxdesign/core/astryx.css';
import '@astryxdesign/theme-neutral/theme.css'; // or your theme's CSS
import '@astryxdesign/richtext/richtext.css';

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Loading astryx.css first declares astryx-base before anything declares reset, so the theme stylesheet's @layer reset, astryx-base, astryx-theme; appends reset above astryx-base, and the theme's prose defaults (:where(p), :where(h1, …, h6), :where(code, pre)) then beat component styles. With this branch's built CSS in Chromium, a RichText table-header paragraph rendered at weight 400 in the primary text color instead of the header cell's semibold secondary style. Core's README loads reset.css first, which keeps reset < astryx-base < astryx-theme:

import '@astryxdesign/core/reset.css';
import '@astryxdesign/core/astryx.css';
import '@astryxdesign/theme-neutral/theme.css'; // or your theme's CSS
import '@astryxdesign/richtext/richtext.css';

Comment thread packages/richtext/README.md Outdated
Comment on lines +66 to +68
`richtext.css` emits into `@layer astryx-base`, the layer `astryx.css` opens,
so your theme's token overrides (`@layer astryx-theme`) win over it whatever
the import order, as long as `astryx.css` comes first.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The theme-over-astryx-base part holds in any order, because every theme stylesheet registers the layer order. The condition is what needs to change: if astryx.css loads before reset.css (or nothing declares reset first), reset lands above astryx-base. Something like "…as long as Core's reset.css (or a @layer reset, astryx-base, astryx-theme; line) loads first" would keep the guarantee true.

'@astryxdesign/richtext': patch
---

[docs] The `@astryxdesign/richtext` README shows the full stylesheet setup: Core's `astryx.css`, your theme's CSS, and `richtext.css`. It says the package ships prebuilt CSS, so you never compile its source, and that `richtext.css` sits in `@layer astryx-base`, so theme overrides win.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Once the snippet imports Core's reset.css, this "full stylesheet setup" list should name it too.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This looks ready: the RichText README now imports Core's reset.css first, so the documented setup keeps the reset < astryx-base < astryx-theme layer order, and a browser check with this branch's built CSS shows RichText table-header text keeping its semibold, secondary style. The prebuilt-CSS note, the @layer astryx-base explanation, the Changeset and the integration-header cleanup all match the shipped packages, so nothing else is needed.

[Automated review]

@cixzhang
cixzhang merged commit 2366a58 into main Oct 15, 2026
56 checks passed

This branch was successfully deployed

1 active deployment
Preview — 59c3749f Deployed Oct 15, 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.

2 participants