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

Disabled block switcher icons are blurry #15629

Closed
kjellr opened this issue May 14, 2019 · 3 comments · Fixed by #15643
Closed

Disabled block switcher icons are blurry #15629

kjellr opened this issue May 14, 2019 · 3 comments · Fixed by #15643
Assignees
Labels
[Feature] Blocks Overall functionality of blocks [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@kjellr
Copy link
Contributor

kjellr commented May 14, 2019

When the block switcher is disabled, the block icon inside of it appears smaller than it should, resulting in some blurry icons on non-retina screens. Here's the Container block icon for instance, appearing at 20px wide:

Screen Shot 2019-05-14 at 9 43 41 AM

For comparison, here's a non-disabled icon, which renders at the correct 24px wide:

Screen Shot 2019-05-14 at 9 47 24 AM

The issue appears to be that when the toolbar icon appears disabled like that, the IconButton parent gets a has-text class, which adds a 4px right margin to the child SVG. Removing that rule renders the icon at the correct size:

link

To fix, I suppose we can negate this with an extra style rule inside of editor-block-switcher__no-switcher-icon, but I'm wondering if this has-text class is needed here in the first place? Should that be removed in this case?

cc @jasmussen
Related: #13721

@kjellr kjellr added the [Type] Bug An existing feature does not function as intended label May 14, 2019
@jasmussen
Copy link
Contributor

Argh, good catch. I could swear we had this fixed :(

Yes: #13767. It echoes this comment too: #13767 (comment)

What's a good way to fix this? @gziolo my favorite person to ping, any tips?

@gziolo gziolo self-assigned this May 15, 2019
@gziolo gziolo added [Status] In Progress Tracking issues with work in progress [Feature] Blocks Overall functionality of blocks labels May 15, 2019
@gziolo
Copy link
Member

gziolo commented May 15, 2019

Is #15643 proposing the proper fix?

It looks like IconButton has a very unexpected logic for adding has-text class. It adds it when children prop is passed which was the case. However, an icon isn't really the text 🤷‍♂

@jasmussen
Copy link
Contributor

According to Kjell it does, amazing thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Blocks Overall functionality of blocks [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants