Skip to content

release: v0.3.5 — fix MenuButton caret in forced-colors mode#174

Merged
masuP9 merged 1 commit into
mainfrom
release/v0.3.5
May 13, 2026
Merged

release: v0.3.5 — fix MenuButton caret in forced-colors mode#174
masuP9 merged 1 commit into
mainfrom
release/v0.3.5

Conversation

@masuP9
Copy link
Copy Markdown
Owner

@masuP9 masuP9 commented May 13, 2026

Summary

  • Fix MenuButton caret (▼/▲) being rendered as a solid rectangle in Windows High Contrast Mode, making expand/collapse direction unreadable.
  • Root cause: the caret is a CSS triangle (width:0; height:0; + border-left/right: transparent; border-top: currentColor). In forced-colors mode, browsers substitute transparent with a system color, so the "triangle" becomes a filled 8×4 box.
  • Fix: add forced-color-adjust: none to .apg-menu-button-trigger::after. Transparent borders stay transparent; currentColor still inherits the trigger's ButtonText, so the top border renders and the 180° rotate on [aria-expanded='true'] works as intended.
  • Bumps version to 0.3.5 (patch).

Test plan

  • Open /patterns/menu-button/{react,vue,svelte,astro}/ with Playwright emulateMedia({ forcedColors: 'active', colorScheme: 'dark' }):
    • Trigger collapsed: caret is a ▼ triangle (not a rectangle). getComputedStyle(trigger, '::after') shows borderLeftColor/borderRightColor = rgba(0,0,0,0) and borderTopColor = ButtonText.
    • Click trigger to expand: caret rotates to ▲ via transform: matrix(-1, 0, 0, -1, 0, 0) (= 180°).
  • forced-colors OFF (normal light/dark): no visual regression — caret still renders as a small triangle in currentColor.
  • npm run test:e2e:pattern --pattern=menu-button passes.
  • npm run lint passes.

🤖 Generated with Claude Code

The dropdown caret on `.apg-menu-button-trigger::after` is drawn with the
classic CSS triangle hack (width:0, height:0, transparent left/right
borders, colored top border). In Windows High Contrast Mode, browsers
substitute `transparent` with a system color, so left/right borders fill
in and the triangle becomes a solid 8x4 rectangle — the expand/collapse
direction is no longer readable.

Add `forced-color-adjust: none` to the `::after` so transparent stays
transparent. `currentColor` still inherits the trigger's `color:
ButtonText`, so the top border renders correctly and the 180deg rotate
on `[aria-expanded='true']` is visible again.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying apg-patterns-examples with  Cloudflare Pages  Cloudflare Pages

Latest commit: 65bf4de
Status: ✅  Deploy successful!
Preview URL: https://1dcc45ff.apg-patterns-examples.pages.dev
Branch Preview URL: https://release-v0-3-5.apg-patterns-examples.pages.dev

View logs

@masuP9 masuP9 merged commit f0479ad into main May 13, 2026
17 checks passed
@masuP9 masuP9 deleted the release/v0.3.5 branch May 13, 2026 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant