Repository navigation
docs(cli): the styling and typography pages state their core rules - #12857
josephfarina wants to merge 3 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
…omponent everywhere [skip ci]
There was a problem hiding this comment.
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:39showsstylex.props(isActive && styles.active), the call for your own DOM nodes, on a page about styling components; components take the condition inxstyle(for examplexstyle={[styles.tile, isActive && styles.active]}), and no guide understylingstates 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
xstylevsclassNameon shared tokens,stylex.create()-onlyxstyle, 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-graphandgolden-readspass: verified (26 tests). - Claim (description): the one
experimental-isolationfailure 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.
… arrays [skip ci]
202a6d5 to
112ca3c
Compare
There was a problem hiding this comment.
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", butpackages/cli/assets/docs/tree/typography.doc.mjs:36now says to chooselevelfrom the document outline and change the look withtypeorweight, 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 understylingshows, and for the heading rule attypography.doc.mjs:36, which contradicts theaccessibilityLeveladvice intypography-best-practicesandtype-scale; narrow that sentence, or add the state pattern tostyling-basicsand 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
xstyleorclassNameon shared tokens,stylex.create()-onlyxstyle, the hover guard, token values and one token-based example: verified againststyling-basicsandtokens-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 theaccessibilityLevelpart (typography.doc.mjs:36); the rest verified. - Claim (description): every rule repeats what a guide below already says: false for
styling.doc.mjs:39andtypography.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-graphandgolden-readspass: verified (26 tests). - Claim (description): the one
experimental-isolationfailure 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).
| '`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"]`', |
There was a problem hiding this comment.
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`", |
There was a problem hiding this comment.
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', |
There was a problem hiding this comment.
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.
- #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
|
Landed in #12992. |
Primary intent
astryx docs stylingandastryx docs typographyprint 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:xstylefor StyleX orclassNamefor Tailwind and your own CSS, all on the same tokens;xstyletakes onlystylex.create()styles; hover styles sit behind@media (hover: hover); values come from token vars; styling a state with anxstylearray 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 throughtypeorweight;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.Change and evidence
packages/cli/assets/docs/tree/styling.doc.mjs,packages/cli/assets/docs/tree/typography.doc.mjs: namespaceblocks.Testing
With
CI=1:core-doc-quality,docs-graph,golden-readspass.experimental-isolationhas one failure, "doctor reports an invalid installed set", which fails the same way on main without this change.preflight: pass 112ca3c