Skip to content

fix: use custom properties for radio button and checkbox sizing and spacing - #2746

Merged
web-padawan merged 2 commits into
masterfrom
fix/radio-button-checkbox-sizing-and-spacing
Oct 5, 2021
Merged

web-padawan merged 2 commits into
masterfrom
fix/radio-button-checkbox-sizing-and-spacing

Conversation

@jouni

@jouni jouni commented Oct 5, 2021

Copy link
Copy Markdown
Member

Description

Use Lumo custom properties for sizing and spacing radio button and checkbox and related group components.

Additionally:

  • Set font properties on the host (don't rely on inheritance)
  • Add previously missing imports

Fixes #743
Fixes #717
Fixes #660

Type of change

  • Bugfix

Checklist

  • I have read the contribution guide: https://vaadin.com/docs-beta/latest/guide/contributing/overview/
  • I have added a description following the guideline.
  • The issue is created in the corresponding repository and I have referenced it.
  • I have added tests to ensure my change is effective and works as intended.
  • New and existing tests are passing locally with my change.
  • I have performed self-review and corrected misspellings.

jouni and others added 2 commits October 5, 2021 14:57
…pacing

Set font properties on the host (don't rely on inheritance).

Add missing imports.
@sonarqubecloud

sonarqubecloud Bot commented Oct 5, 2021

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@web-padawan
web-padawan merged commit e6e505a into master Oct 5, 2021
@web-padawan
web-padawan deleted the fix/radio-button-checkbox-sizing-and-spacing branch October 5, 2021 13:45
@jouni

jouni commented Oct 5, 2021

Copy link
Copy Markdown
Member Author

I didn't have the chance to continue on this until now. I was still reviewing the screenshots, and I noticed that the vertical alignment of the label compared to the input is slightly off in them (the text is not centered with the input). It looks fine when running locally, so it’s probably something related to the way OS renders text. I’m going to check it on Windows, see if the alignment is different there.

@jouni

jouni commented Oct 5, 2021 •

Copy link
Copy Markdown
Member Author

Hmm, apparently the same issue has been present in the previous implementation as well. So not a regression, at least. But not ideal either, that on Windows the text does not appear to be visually centered with the input:
Screen Shot 2021-10-05 at 20 57 11

Seems like the font family plays a big role (Segoe UI on Windows). Using sans-serif improves the alignment:
Screen Shot 2021-10-05 at 21 01 59

For the curious: https://core.trac.wordpress.org/ticket/48423

Basically, Segoe UI is intentionally not vertically centered within its "line height". Most typefaces use the same value for the top and bottom "half leading". Segoe UI doesn't and the top half leading is greater than the bottom one.

@vaadin-bot

Copy link
Copy Markdown
Collaborator

This ticket/PR has been released with platform 22.0.0.alpha7 and is also targeting the upcoming stable 22.0.0 version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

3 participants