fix(forms): paint checkbox checkmark on :checked (PMS-577) #387
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/PMS-577-checkbox-checkmark"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Clicking the timesheet certify and billable checkboxes toggled the state but showed no checkmark: the box drew only the accent focus ring, never a check. Reported under PMS-577 (and the earlier PMS-571 / PMS-552 billable reports stem from the same cause).
Root cause
The bug is in the shared
Checkboxcomponent, so every checkbox in the app is affected. The component setbg-surfaceon the<input>. The @tailwindcss/forms base layer paints a checked box as a white checkmark SVG over acurrentColor(accent) background-color. Thebg-surfaceutility outranks that base:checkedrule and pinned the background to the theme surface color. In light mode--surfaceis#ffffff, so the white checkmark rendered white-on-white and was invisible. In dark mode (--surface#1e293b) it happened to show, which is why this slipped through.Confirmed empirically: a throwaway
use_effectdiagnostic showed thecertifiedsignal committingtrue/falsecorrectly on each click, so state and reactivity were never broken. Only the checked visual was missing. The diagnostics were removed before this commit.Fix
Re-assert the accent fill and drop the border on
:checked(checked:bg-accent checked:border-transparent) so the white checkmark has contrast in both themes. One-line change in the shared component fixes all checkboxes at once.Test
Submit Timesheet -> click the certify checkbox: the box fills accent with a visible white check and Submit for Approval enables. Same for the billable checkboxes on the time-entry create and edit forms.
🤖 Generated with Claude Code
Pull request closed