Issue 418
enhancement: Badge, the shared label, and a category pill that passes contrast
Back to our planDone
enhancementfrontendpriority: medium
Type
enhancement
Summary
Build Badge in src/platform/ui, from the approved component set (variant: category, on-image), and fix the category pill's contrast.
Problem
- The category label on post cards, event cards and the plain event hero is a class string (
categoryPillClassName, inventory C12), not a component. - Its
text-primaryon thebg-primary/10tint fails WCAG AA: 4.20:1 on the page and 3.86:1 on a surface in light mode, and 4.39:1 on a card in dark mode. - Over photos, post and event heroes write their categories as uppercase text in their own styles (H11).
Proposed fix
One Badge with category (the pill, with primary-strong text, which is 5.7:1 or more on its tint) and on-image (for hero photos, on a scrim). Cards and heroes use it, and categoryPill.ts goes. The theme contract already checks primary-strong on the primary tint.
Acceptance criteria
- Not done: One
Badgeinsrc/platform/uiwith tests (jsdom and axe). - Not done: Post cards, event cards, the plain event hero and the photo heroes use it;
categoryPill.tsis gone. - Not done: 4.5:1 for the category badge on the page, a surface and a card in both themes.
- Not done: Screenshots of cards and heroes at the six widths in light and dark.
Area
frontend
Priority
priority: medium
Generated by Claude Code, opens in a new tab