Skip to content

docs(rules): correct what the unit suite can see, and name the dead-shorthand trap - #888

Merged
isaque-bock-azion merged 3 commits into
mainfrom
docs/token-shorthand-and-test-css
Aug 12, 2026
Merged

docs(rules): correct what the unit suite can see, and name the dead-shorthand trap#888
isaque-bock-azion merged 3 commits into
mainfrom
docs/token-shorthand-and-test-css

Conversation

@gabriel-lisboa-azion

Copy link
Copy Markdown
Collaborator

Summary

  • testing.md claimed setup.ts imports @aziontech/theme/globals.css and that "styled DOM ⇒ axe contrast is real". The file loads no CSS, deliberately, because the env runs no Tailwind — so the rule was steering authors toward contrast and computed-style assertions that silently prove nothing. The CSS boundary is now stated: never assert a computed style, axe covers semantics not pixels, contrast lives in Storybook + the visual gate.
  • styling.md gains the malformed-shorthand trap — whitespace inside the parens emits nothing; an inverted [--(token)] emits a value the browser discards; a visual baseline generated from the broken render encodes the bug as correct. Names the dead-token-shorthand check that blocks it (fix(webkit): catch malformed token shorthands, and restore the popover header min-height #887) and the probe-the-class habit.

How to test

  1. Read .claude/rules/testing.md § "What a real browser does NOT give this suite: CSS" against packages/webkit/src/test/setup.ts — the rule now matches the file's own comment, including why re-adding the CSS would buy no signal.
  2. npx prettier --check .claude/rules/testing.md → passes. styling.md predates the current prettier config and still fails on main; it is left otherwise as found so the diff stays reviewable.
  3. cd packages/webkit && node --test test/standards/invariant.test.mjs → 12 pass (rule ↔ gate pairing intact), and node scripts/check-authoring-docs.mjs0 new.

Notes

…horthand trap

testing.md claimed `setup.ts` imports `@aziontech/theme/globals.css` and that a
styled DOM makes axe contrast real. The opposite is true, deliberately: the file
loads no CSS and says why, because the env runs no Tailwind. Anyone trusting the
rule would write a contrast or computed-style assertion that silently proves
nothing — the precise false positive browser mode exists to eliminate.

So the CSS boundary is now stated where it matters: never assert a computed
style (unstyled DOM returns the same value whether the style is right or
absent), axe covers semantics not pixels, and contrast lives in Storybook plus
the visual gate. The stack list now describes what `setup.ts` actually does.

styling.md gains the malformed-shorthand trap: whitespace inside the parens
emits nothing, an inverted bracket/paren form emits a value the browser
discards, and a visual baseline generated from the broken render encodes the
bug as correct. Both spellings shipped — chip's fill and popover-header's
min-height — so the section names the `dead-token-shorthand` check that now
blocks them, and points at probing the class rather than the cascade.

Only the sections touched are reformatted; styling.md predates the current
prettier config and is left otherwise as found.
@isaque-bock-azion
isaque-bock-azion merged commit a693a37 into main Aug 12, 2026
17 checks passed
@isaque-bock-azion
isaque-bock-azion deleted the docs/token-shorthand-and-test-css branch August 12, 2026 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants