Review nits: rst-sr-only passes as a class, fails as an attribute open
On branch chore/review-nits
Why. Astra's review of #24 flagged a gap. TestEveryTemplateAttributeIsInTheDesignSystem exempted the bare word rst-sr-only, so <p rst-sr-only> passed along with the class="rst-sr-only" the exemption was written for. tokens.css styles only .rst-sr-only, which means the attribute spelling puts the hidden text on screen.
Change (e5c19d9, test-only)
classOnlyUtilities(rst-sr-only) are stripped fromclass="…"/class='…'values before the scan, and from nowhere else. The class passes, and any attribute use fails like every other unstyled name.- The per-template scan moved into
attrNames, withattrSelectors,designCSS,templateExemptandtemplateUnstyledhoisted, so a test can drive it. The gate's behaviour is otherwise unchanged.
Test. TestClassOnlyUtilityPassesOnlyAsAClass. Four class spellings must pass. Five attribute or misplaced spellings must each report rst-sr-only: <p rst-sr-only>, rst-sr-only="", before and after a class attribute, and inside another attribute's value. It also asserts the stylesheets have no [rst-sr-only] selector.
- Red first: after the refactor and before the fix, all five bad cases failed with "the gate reports [], want [rst-sr-only]".
- Mutation on the real templates: rewriting index.html's label as
<label for="q" rst-sr-only>turns TestEveryTemplateAttributeIsInTheDesignSystem red ("index.html writes \"rst-sr-only\", which no stylesheet mentions").
Gate. make ci is green (GOTOOLCHAIN go1.26.5). Nothing ships: the change is test-only, so no release or deploy is needed.