Skip to content

fix: themed accent + flush-right dot for Toggle on-state - #27

Merged
tdody merged 2 commits into
mainfrom
thibaultdody/fix-toggle-on-state-style
Apr 19, 2026
Merged

fix: themed accent + flush-right dot for Toggle on-state#27
tdody merged 2 commits into
mainfrom
thibaultdody/fix-toggle-on-state-style

Conversation

@tdody

@tdody tdody commented Apr 19, 2026

Copy link
Copy Markdown
Owner

Problem

The Toggle primitive's "on" state filled the track with bg-ink (pure dark ink) and kept the dot at translate-x-5 (20 px — symmetric 2 px padding on both sides), which read as a heavy black pill with no visible commitment to the right side.

Changes

  • Track color when on: bg-inkbg-accent (teal in light, light teal in dark — matches the theme accent used elsewhere).
  • Dot position when on: translate-x-5translate-x-[22px]. With the track's 2 px p-0.5 inset, 22 px places the dot's right edge exactly flush with the track's right edge, so the dot visually touches the right side when checked. Off state is unchanged — the dot keeps the symmetric 2 px inset on the left.

Scope

One file (frontend/src/components/shared/Toggle.tsx), 2 class changes. Every consumer (Financing loan-type toggle, Revenue & Expenses homestead + platform-remits + seasonal-occupancy + advanced-overrides toggles, Settings density toggle, etc.) picks up the new style automatically.

Verification

  • npm run lint — clean
  • npm run build — passes

🤖 Generated with Claude Code

tdody and others added 2 commits April 19, 2026 19:33
- On-state track color: bg-ink → bg-accent so the Toggle reads as a
  themed affirmative rather than a heavy black pill.
- On-state dot position: translate-x-5 (20px) → translate-x-[22px]
  (22px) so the dot's right edge sits flush with the track's right
  edge when checked, giving the UI a visible "locked-right" feel.
  Off state keeps the original symmetric p-0.5 inset.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Previous commit pushed the checked dot to translate-x-[22px] (flush with
the track's right edge) — user feedback via screenshot shows the dot
should keep the same 2px inset on the right that the off-state has on
the left. Restoring translate-x-5 (20px) so both states look balanced.

Accent track color change (bg-ink → bg-accent) retained.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@tdody
tdody merged commit 868b996 into main Apr 19, 2026
2 checks passed
tdody added a commit that referenced this pull request Apr 20, 2026
Phase 2 PRs 1–7 all shipped under THI-45 through THI-54 before this
tracker was committed. Audit on 2026-04-19 confirmed `frontend/src/index.css`
tokens match `README.md` spec exactly (no drift, light + dark). Phase 2
PR 8 (polish pass) is in-progress with #26/#27/#28 landed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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