fix: address 6 low-severity findings from typography token code review

- Replace mislabeled sidebar title 10px with var(--text-2xs) (F-001)
- Replace font-size: small with var(--text-sm) in app-shell (F-002)
- Annotate @media heading overrides as potentially redundant with clamp() (F-003)
- Correct type scale comment to "approximate major-third ratio" (F-004)
- Differentiate h5 (--text-sm) from h4 (--text-base) (F-005)
- Tighten contract test to flag bare normal/bold keywords (F-006)

Task run: UI-TYPOGRAPHY-SCALE-002

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-22 15:56:58 +01:00
parent e145b7d089
commit fc2ebe9314
4 changed files with 10 additions and 7 deletions

View File

@@ -50,7 +50,7 @@ class TypographyTokenContractTest extends TestCase
public function testFontSizeUsesTokens(): void
{
$violations = $this->scanForRawValues(
'/font-size\s*:\s*+(?!var\(--text-|var\(--app-|inherit|unset|initial|revert|small\b|0[;\s])/',
'/font-size\s*:\s*+(?!var\(--text-|var\(--app-|inherit|unset|initial|revert|0[;\s])/',
self::EXCEPTION_MARKERS,
);
@@ -86,7 +86,7 @@ class TypographyTokenContractTest extends TestCase
public function testFontWeightUsesTokens(): void
{
$violations = $this->scanForRawValues(
'/font-weight\s*:\s*+(?!var\(--font-|var\(--app-font-weight\)|var\(--app-form-label-font-weight|inherit|unset|initial|revert|normal|bold\b|bolder|lighter)/',
'/font-weight\s*:\s*+(?!var\(--font-|var\(--app-font-weight\)|var\(--app-form-label-font-weight|inherit|unset|initial|revert|bolder|lighter)/',
self::EXCEPTION_MARKERS,
);