Skip to content

docs(cli): the styling and typography pages state their core rules - #12857

Closed
josephfarina wants to merge 3 commits into
mainfrom
josephfarina/styling-typography-rules
Closed

josephfarina wants to merge 3 commits into
mainfrom
josephfarina/styling-typography-rules

Conversation

@josephfarina

@josephfarina josephfarina commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Primary intent

astryx docs styling and astryx docs typography print only a list of the guides below them. This change puts each area's core rules and one short example on the namespace page, so one read is enough to start. Documentation change.

User impact

  • astryx docs styling: xstyle for StyleX or className for Tailwind and your own CSS, all on the same tokens; xstyle takes only stylex.create() styles; hover styles sit behind @media (hover: hover); values come from token vars; styling a state with an xstyle array or, from external CSS, a component's class and data attributes; restyling a component everywhere through defineTheme overrides; one token-based override example.
  • astryx docs typography: Heading for headings and Text for the rest, never raw sizes, line heights or numeric weights; heading levels chosen from the document outline, never for size, with looks changed through type or weight; type="supporting" for metadata; display types only for a hero or a data callout; denser or roomier text through the scale's base and ratio; one example.
  • Every rule repeats what a guide below already says. Guide lists, routes and keywords stay as they are.

Change and evidence

  • packages/cli/assets/docs/tree/styling.doc.mjs, packages/cli/assets/docs/tree/typography.doc.mjs: namespace blocks.
  • Guide reads judged against real requests (two blind judges; a read is good only when both agree), on the integration head 56b9349 with and without this change: styling-page reads 0/7 -> 4/7 good, typography-page reads 0/4 -> 2/4; all 528 reads 50.8% -> 51.9% (held-out half 50.8% -> 51.9%). No read got worse.

Testing

With CI=1: core-doc-quality, docs-graph, golden-reads pass. experimental-isolation has one failure, "doctor reports an invalid installed set", which fails the same way on main without this change.

preflight: pass 112ca3c

@vercel

vercel Bot commented Nov 19, 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 Nov 19, 2026 9:36am UTC

Request Review

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

astracat-bot Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟡 Reviewed (for maintainers only) Nov 19, 2026, 9:47 AM UTC

@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.

Changes requested: one rule on the new astryx docs styling page points readers at the wrong styling API.

  • The state rule at packages/cli/assets/docs/tree/styling.doc.mjs:39 shows stylex.props(isActive && styles.active), the call for your own DOM nodes, on a page about styling components; components take the condition in xstyle (for example xstyle={[styles.tile, isActive && styles.active]}), and no guide under styling states this rule, so the description's "every rule repeats what a guide below already says" does not hold for it.

The other styling rules, the typography page and the release note match the guides and the CLI output, and the docs tests pass. Two optional notes: astryx search accessibilityLevel now leads with the typography page instead of the guides that hold the rule, and color="secondary" in the typography example restates the default of type="supporting".

Claims and files checked

Review mode: full; reason: no-earlier-review

  • Claim (release note): both pages state their core rules with one short example each and still point to their guides: verified in the head CLI reads.
  • Claim (title): the styling and typography pages state their core rules: verified.
  • Claim (description): before this change both pages printed only a guide list: verified in the base CLI reads.
  • Claim (description): the styling page covers xstyle vs className on shared tokens, stylex.create()-only xstyle, hover behind @media (hover: hover), token values, and one token-based example: verified, each backed by styling-basics or tokens-and-setup.
  • Claim (description): the typography page covers Heading and Text, heading order with accessibilityLevel, type="supporting", display types only for a hero or callout, and base and ratio: verified against typography-best-practices and the Heading and Text props.
  • Claim (description): every rule repeats what a guide below already says: false for the state rule at styling.doc.mjs:39.
  • Claim (description): guide lists, routes and keywords stay as they are: verified (slots, placements and declared keywords unchanged; the docs-tree golden read passes).
  • Claim (description): core-doc-quality, docs-graph and golden-reads pass: verified (26 tests).
  • Claim (description): the one experimental-isolation failure is not caused by this change: verified; the test passes on both the base and the head.
  • File .changeset/styling-typography-rules.md: clear.
  • File packages/cli/assets/docs/tree/styling.doc.mjs: one blocking finding (line 39).
  • File packages/cli/assets/docs/tree/typography.doc.mjs: clear, with two optional notes.

Automated review (maintainer link)

@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.

Changes requested: the description no longer matches what the two pages say.

  • The description's User impact bullet still says the typography page covers "heading levels in order with accessibilityLevel", but packages/cli/assets/docs/tree/typography.doc.mjs:36 now says to choose level from the document outline and change the look with type or weight, so that bullet needs updating.
  • "Every rule repeats what a guide below already says" is false for the state rule at styling.doc.mjs:39, which no guide under styling shows, and for the heading rule at typography.doc.mjs:36, which contradicts the accessibilityLevel advice in typography-best-practices and type-scale; narrow that sentence, or add the state pattern to styling-basics and align those two guides with the outline-first heading rule.

The xstyle state rule, the dropped color="secondary" and the accessibilityLevel search result are fixed, and the docs tests pass. One optional note: on typography.doc.mjs:38, "for a page title" reads as permission to use a display type on any page title; "for a hero title" matches the best-practices guide.

Claims and files checked

Review mode: incremental; reason: none

  • Claim (release note): both pages state their core rules with one short example each and still point to their guides: verified in the head CLI reads.
  • Claim (title): the styling and typography pages state their core rules: verified.
  • Claim (description): before this change both pages printed only a guide list: verified in the base CLI reads.
  • Claim (description): the styling page covers xstyle or className on shared tokens, stylex.create()-only xstyle, the hover guard, token values and one token-based example: verified against styling-basics and tokens-and-setup.
  • Claim (description): the typography page covers Heading and Text with no hand-set size, line height or weight, heading order with accessibilityLevel, type="supporting", display types only for a hero or callout, base and ratio, and one example: false for the accessibilityLevel part (typography.doc.mjs:36); the rest verified.
  • Claim (description): every rule repeats what a guide below already says: false for styling.doc.mjs:39 and typography.doc.mjs:36.
  • Claim (description): guide lists, routes and keywords stay as they are: verified (slots, placements and declared keywords unchanged; golden reads pass).
  • Claim (description): core-doc-quality, docs-graph and golden-reads pass: verified (26 tests).
  • Claim (description): the one experimental-isolation failure is not caused by this change: verified; the whole file passes at the head (54 tests).
  • File .changeset/styling-typography-rules.md: clear.
  • File packages/cli/assets/docs/tree/styling.doc.mjs: one blocking finding (line 39, description claim).
  • File packages/cli/assets/docs/tree/typography.doc.mjs: one blocking finding (line 36, description claims) and one optional note (line 38).

Automated review (maintainer link)

'`xstyle` takes only styles made with `stylex.create()`: never an inline object or a class string',
'Put every hover style behind `@media (hover: hover)`, so a touch screen does not keep it after a tap',
'Take spacing, color, radius and shadow values from token vars, never from raw px or hex',
'Style a state with a conditional style, `xstyle={[styles.tile, isActive && styles.active]}`, not by toggling class names; external CSS targets a component by its class and data attributes, such as `.astryx-button[data-variant="primary"]`',

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.

This rule now uses the right API. It is still not in any guide under styling: the "Pseudo-classes and conditional styles" example in styling-basics shows only a :hover value, so the description's "Every rule repeats what a guide below already says" does not hold here. Either add a conditional xstyle array to the styling-basics xstyle section, or narrow that sentence in the description.

type: 'list',
style: 'unordered',
items: [
"Choose each heading's `level` from the document outline, never for its size; change how it looks with a visual `type` or `weight`",

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.

This matches the outline-first heading guidance, but the guides this page sends readers to for detail say the opposite: typography-best-practices ("Use accessibilityLevel on Heading when the visual hierarchy doesn't match the document outline") and the type-scale example <Heading level={2} accessibilityLevel={3}>. The description also still says this page covers "heading levels in order with accessibilityLevel". Please update the description, and either align those two guides with this rule or narrow the "every rule repeats a guide" sentence.

items: [
"Choose each heading's `level` from the document outline, never for its size; change how it looks with a visual `type` or `weight`",
'Put timestamps, helper text and captions in `type="supporting"`',
'Keep display types for a hero or a large data callout, never for body text: `<Heading level={1} type="display-1">` for a page title, `<Text type="display-2">` for a big number',

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.

Optional: "for a page title" reads as a display type for any page title, while the best-practices guide keeps display types to hero, marketing and data-callout contexts, and this page's own example titles a page with a plain <Heading level={1}>. "for a hero title" fits both.

@josephfarina
josephfarina marked this pull request as ready for review November 19, 2026 10:50
josephfarina added a commit that referenced this pull request Nov 19, 2026
josephfarina added a commit that referenced this pull request Nov 19, 2026
josephfarina added a commit that referenced this pull request Nov 19, 2026
josephfarina added a commit that referenced this pull request Nov 19, 2026
josephfarina added a commit that referenced this pull request Nov 19, 2026
- #12941 fix(Table): the default cell renderer shows an Invalid Date as an empty cell
  Author: @josephfarina
- #12886 docs(core): the README setup loads the theme's fonts
  Author: @josephfarina
- #12887 fix(cli): doctor --built reads the setup stylesheet as wiring, not page styling
  Author: @josephfarina
- #12456 fix(cli): a doc may leave out a value the code deprecates everywhere
  Author: @josephfarina
- #12857 docs(cli): the styling and typography pages state their core rules
  Author: @josephfarina
- #12994 test(cli): the doctor golden leaves out a check only some computers report
  Author: @josephfarina
- #13001 test(cli): the swizzle proof renders Lab's MediaPlayer with its required label
  Author: @josephfarina
@josephfarina

Copy link
Copy Markdown
Contributor Author

Landed in #12992.

@github-actions
github-actions Bot deleted the josephfarina/styling-typography-rules branch November 20, 2026 06:05

This branch was successfully deployed

1 active deployment
Preview — 112ca3ca Deployed Nov 19, 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