Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン
#20,102 コメント 4 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@brianjhanson がすでに取り組んでいます。

2026年10月26日 から。

評価

この issue はまだ評価されていません。

説明

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
主要言語
PHP
スター
3.6k
フォーク
710
平均マージ
11時間 15分
マージ済み PR(30日)
277

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

craftcms/cms のほかの issue

craftcms/cms の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。