Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[6.x]: Checkmark in an enabled lightswitch looks slightly up and to the left of center (minor, cosmetic)

Chiusa
#20,102 4 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@brianjhanson ci sta già lavorando.

Dal 26/10/2026.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

bug repo:cms
What happened?

Description

Very minor cosmetic issue. The checkmark inside the thumb of an enabled lightswitch is centered by its bounding box. A check carries its visual weight in the long upper-right stroke, so it looks about half a pixel too far up and to the left.

Spotting this "flaw" is borderline OCD on my part, but, as the saying goes, "once you see it..."

Steps to reproduce

  1. Open any screen with a lightswitch, e.g. an entry edit page.
  2. Turn a lightswitch on.
  3. Look closely at the checkmark in the thumb. It is easiest to see zoomed in, on the small and default sizes.

Expected behavior

The checkmark looks centered in the thumb.

Actual behavior

The mark sits at the geometric center of the thumb, but looks slightly high and to the left.

Before / after screenshots:

Image Image

Suggested nudge

--_checkmark-offset in the checked :after rule of craft-switch-button centers the mark's bounding box:

(var(--c-switch-thumb-height) - var(--_checkmark-size)) / 2 - 1px

Adding a small optical correction to that value fixes it by eye:

(var(--c-switch-thumb-height) - var(--_checkmark-size)) / 2 - 1px + 0.04em

Both inset-block-start and inset-inline-start read the same property, so the mark moves right and down together, and RTL follows inset-inline-start with no extra rule.

0.04em is about 0.55px at 14px text. I used em because a share of the mark's size gave small switches a sub-pixel shift that was invisible. The optical error comes from the shape of the check, so it is about the same on both switch sizes.

Version: craftcms/cms 6.x-dev @ 16a41b5e99, Chrome. Checked on the small and default switch sizes. Not checked in RTL or in Firefox/Safari.

Craft CMS version

6.x-dev @ 16a41b5e99

PHP version

No response

Operating system and version

No response

Database type and version

No response

Image driver and version

No response

Installed plugins and versions
Lingua principale
PHP
Stelle
3.6k
Fork
710
Merge medio
12h 19m
PR unite (30g)
293

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di craftcms/cms

Tutte le issue di craftcms/cms

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.