Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix icon size regression in Switcher #13767

Merged
merged 2 commits into from
Feb 13, 2019
Merged

Fix icon size regression in Switcher #13767

merged 2 commits into from
Feb 13, 2019

Commits on Feb 12, 2019

  1. Fix icon size regression in Switcher

    In #12901, a small margin was introduced to the IconButton component when text was present. This caused an issue with block icons, scaling them down when they shouldn't be. A 20x20px icon should show as 20x20, and a 24x24px icon should show as 24x24px.
    
    The additional margin was applied even when the IconButton didn't actually have text. It simply needed `children`, and in the case of the Switcher, it has a dropdown arrow. Combined with the fixed width of the switcher, that meant a 24x24 icon would be rendered as 20x24.
    
    This PR adds a length check so if your IconButton includes more than 2 letters, it's considered to have a text label. This fixes the issue. But as you can tell, maybe it's not the best way to check whether there's text or not. Suggestions most welcome.
    Joen Asmussen committed Feb 12, 2019
    Configuration menu
    Copy the full SHA
    619150f View commit details
    Browse the repository at this point in the history
  2. Address feedback.

    Props @aduth for essentially writing this PR.
    Joen Asmussen committed Feb 12, 2019
    Configuration menu
    Copy the full SHA
    773bc4e View commit details
    Browse the repository at this point in the history