StackExchange / StackExchange/Stacks

Checkbox mis-alignment on mobile views

Open
#955 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
672
Forks
107
Avg merge
2d 12h
Merged PRs (30d)
26

Description

Describe the bug
Checkbox mis-alignment on mobile views

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://stackoverflow.design/product/components/checkbox
  2. Resize viewport to less than 640px

Expected behavior
Checkboxes to be aligned with their labels

Screenshots

Example Checkboxes on Medium vs Small Screens

Example Checkboxes on Medium vs Small Screens

Zoomed in example of checkboxes with alignment lines

Zoomed in example of checkboxes with alignment lines

Example of checkbox itself being resized on small displays

Example of checkbox itself being resized on small displays

Some important styling rules impacting this currently

Some important styling rules impacting this currently

Desktop (please complete the following information):

  • OS: Windows
  • Browser Chrome
  • Version 101

Additional context

The culprit looks like it's the fact that we shrink the font to 11px for all screens under 640px

Worth noting that the main site actually has an additional edge case here. The checkbox inherits it's font from its parent, so if it's not nested in something with an explicit font, it'll get downsized 2px as well from 11px to 9px- this doesn't show up on stacks demo page, because the example panels set thefont-size` explicitly.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open the checkbox component at https://stackoverflow.design/product/components/checkbox and reproduce the issue with a viewport below 640px. Inspect the styling associated with the small-screen font size and checkbox dimensions; it is done when the checkbox remains aligned with its label and does not resize unexpectedly on small displays.

Written by the indexing model from the issue text.

Assessment

Tech stack
css
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.