You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
With Gutenberg 6.6, the pinned plugins menu icons are not scaled properly #17719
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.
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?
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?
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.
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
Activity
youknowriad commentedon Oct 2, 2019
Same in the more menu

jasmussen commentedon Oct 2, 2019
I don't understand how this could have regressed.
Looking at 5.2 sans plugin, I see the following CSS:
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:
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 commentedon Oct 2, 2019
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 commentedon Oct 2, 2019
I suspect buttons were flex aligned which also affects the size of their children and it's not the case anymore.
jasmussen commentedon Oct 2, 2019
Oh I know what it is now.
On 5.2 without plugin, the markup is this:
On 5.2 with plugin 6.6 enabled, the markup is this:
So at some point,
is-smallbecame replaced byis-24.Add max-width to pinned icon SVGs.
etoledom commentedon Oct 3, 2019
@youknowriad - I've been checking this out following the changes on #17228.
Previous to this change:
gutenberg/packages/components/src/icon-button/index.js
Line 58 in eb3a82f
We were passing down a
Dashiconif 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
Iconhas 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 commentedon Oct 3, 2019
I'm not certain that's the issue here. Since that plugin icon is always rendered with
Iconanyway (before and after). The icon there is an element not a string.gziolo commentedon Oct 3, 2019
There is also a different margin when the pinned icon is toggled:



etoledom commentedon Oct 3, 2019
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
Maybe it could at least give some lights?
youknowriad commentedon Oct 3, 2019
ohhh, actually you're right @etoledom let's just restore the "if" then
Add max-width to pinned icon SVGs. (#17722)