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

With Gutenberg 6.6, the pinned plugins menu icons are not scaled properly #17719

Closed
youknowriad opened this issue Oct 2, 2019 · 10 comments · Fixed by #17752
Closed

With Gutenberg 6.6, the pinned plugins menu icons are not scaled properly #17719

youknowriad opened this issue Oct 2, 2019 · 10 comments · Fixed by #17752
Assignees
Labels
[Feature] UI Components Impacts or related to the UI component system [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended [Type] Regression Related to a regression in the latest release

Comments

@youknowriad
Copy link
Contributor

Try installing the dropit plugin. In previous versions the icon was showing properly, it Gutenberg 6.6, the icons are not scaled down to the button height.

Capture d’écran 2019-10-02 à 3 55 45 PM

Probably due to the buttons refactoring cc @jasmussen @talldan

@youknowriad youknowriad added the [Type] Bug An existing feature does not function as intended label Oct 2, 2019
@youknowriad youknowriad added [Type] Regression Related to a regression in the latest release [Feature] UI Components Impacts or related to the UI component system labels Oct 2, 2019
@youknowriad
Copy link
Contributor Author

Same in the more menu
Capture d’écran 2019-10-02 à 3 59 51 PM

@jasmussen
Copy link
Contributor

I don't understand how this could have regressed.

Looking at 5.2 sans plugin, I see the following CSS:

Screenshot 2019-10-02 at 18 52 33

This is coming from here: http://moc.co/wp-content/plugins/dropit/scripts/sidebar/build/style.css?ver=1534242899

And if I toggle that off, the icons explode:

icons

I'm not suggesting this isn't something we should fix, it'd be nice to apply a max-width to SVGs there. But are you sure it's a regression in Gutenberg?

@youknowriad
Copy link
Contributor Author

So I noticed this as soon as I updated my blog to 6.6 and I'm pretty sure I didn't touch dropit in the meantime, I can debug deeper later though.

@youknowriad
Copy link
Contributor Author

I suspect buttons were flex aligned which also affects the size of their children and it's not the case anymore.

@jasmussen
Copy link
Contributor

Oh I know what it is now.

On 5.2 without plugin, the markup is this:

<span class="dropit-sidebar-icon is-small color-giphy"><svg width="115px" height="159px" viewBox="0 0 115 159"> ... </svg></span>

On 5.2 with plugin 6.6 enabled, the markup is this:

<span class="dropit-sidebar-icon is-24 color-giphy"><svg width="115px" height="159px" viewBox="0 0 115 159"> ... </svg></span>

So at some point, is-small became replaced by is-24.

@etoledom
Copy link
Contributor

etoledom commented Oct 3, 2019

@youknowriad - I've been checking this out following the changes on #17228.

Previous to this change:


We were passing down a Dashicon if icon was a string, or the icon object directly otherwise.
{ isString( icon ) ? <Dashicon icon={ icon } ariaPressed={ ariaPressed } /> : icon }

Now we are always passing the icon (objec or string) to the Icon component, and Icon has a default size value of 24.

Probably if we keep this logic and just change Dashicon with Icon, it will work as before:
{ isString( icon ) ? <Icon icon={ icon } /> : icon }

Did a fast test on web and mobile and it seems to work.
What do you think?

cc @Tug

@youknowriad
Copy link
Contributor Author

I'm not certain that's the issue here. Since that plugin icon is always rendered with Icon anyway (before and after). The icon there is an element not a string.

@gziolo
Copy link
Member

gziolo commented Oct 3, 2019

There is also a different margin when the pinned icon is toggled:
Screen Shot 2019-10-03 at 14 56 10
Screen Shot 2019-10-03 at 14 56 16
Screen Shot 2019-10-03 at 14 57 00

@etoledom
Copy link
Contributor

etoledom commented Oct 3, 2019

I'm not certain that's the issue here. Since that plugin icon is always rendered with Icon anyway (before and after). The icon there is an element not a string.

This change do solve the issue with the buttons though. I don't see other possible change on #17228 that could have triggered this problem

-    <Icon icon={ icon } />
+    { isString( icon ) ? <Icon icon={ icon } />  : icon }

Maybe it could at least give some lights?

Screen Shot 2019-10-03 at 2 56 07 PM

@youknowriad
Copy link
Contributor Author

ohhh, actually you're right @etoledom let's just restore the "if" then

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] UI Components Impacts or related to the UI component system [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended [Type] Regression Related to a regression in the latest release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants