Skip to content

fix: centre labeled toggle words beside the knob - #251

Merged
hellopablo merged 4 commits into
developfrom
feature/ez-2639-toggle-label-centering
Sep 29, 2026
Merged

hellopablo merged 4 commits into
developfrom
feature/ez-2639-toggle-label-centering

Conversation

@hellopablo

@hellopablo hellopablo commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Labeled boolean switches centre each word in the track beside the knob, not in the pill as a whole.
  • The round cap still makes a long word look pushed outward. Each label is measured and nudged toward the middle only as far as it reaches into that cap, so a short word such as Draft stays put and a longer word such as Published moves in.
  • Follow-up to EZ-2639 review on the Draft/Published control.

Test plan

  • Hard-refresh so cached admin.ui CSS and admin.plugins JS drop.
  • Published (knob on the right) sits in the green track, slightly in from the round cap.
  • Draft (knob on the left) stays centred in the flat part of the track.
  • A shorter pair such as Yes/No does not pick up the same shift as a long pair.
  • Compact unlabeled ON/OFF pills are unchanged.
  • Keyboard and click still flip the checkbox.

The previous equal inset still sat the word in the middle of the pill.
Each label now occupies the remaining column so it centres in the
space the knob is not covering.

EZ-2639
A word centred in the remaining track still looks pushed out, because
the round cap eats visual weight at the outer end. Shift each label
inward by a fraction of the radius.

EZ-2639
A fixed inset over-corrects short words and under-corrects long ones.
Measure each label and only nudge it toward the knob as it enters the
rounded end.

EZ-2639
@hellopablo
hellopablo merged commit 2eb8568 into develop Sep 29, 2026
5 checks passed
@hellopablo
hellopablo deleted the feature/ez-2639-toggle-label-centering branch September 29, 2026 21:20
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