-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
The margin-top property should not use px units.
When visiting your CSS generator at https://range-input-css.netlify.app/, we see this CSS declaration:
margin-top: -4px; /* Centers thumb on the track */When using rem units for the track or thumb heights, this margin will remain the same when a user selects a non-default font-size. The thumb won't be vertically centered.
So it seems that calc should be used for margin-top:
margin-top: calc((var(--track-height) - var(--thumb-height)) / 2); /* Centers thumb on the track */Metadata
Metadata
Assignees
Labels
No labels