Skip to content

Add max-width to pinned icon SVGs. - #17722

Merged
gziolo merged 1 commit into
masterfrom
try/pinned-menu-item-maxwidth
Oct 10, 2019
Merged

gziolo merged 1 commit into
masterfrom
try/pinned-menu-item-maxwidth

Conversation

@jasmussen

Copy link
Copy Markdown
Contributor

Mitigates #17719.

Screenshot 2019-10-02 at 19 41 24

It's not perfect, because those drop-it icons aren't designed with any clearance. But at least it's a last-defence failsafe.

In #17719 (comment) we figured out the cause of the regression. This regression should be fixed separately. But this PR could serve as an addition to that.

@jasmussen
jasmussen requested a review from youknowriad October 2, 2019 17:43
@jasmussen
jasmussen requested a review from talldan as a code owner October 2, 2019 17:43
@jasmussen jasmussen self-assigned this Oct 2, 2019
@jasmussen jasmussen added the [Type] Bug An existing feature does not function as intended label Oct 2, 2019
@gziolo

gziolo commented Oct 4, 2019

Copy link
Copy Markdown
Member

It looks like #17752 attempts to resolve the same issue differently.

@gziolo gziolo added [Package] Plugins /packages/plugins [Type] Regression Related to a regression in the latest release labels Oct 4, 2019
@jasmussen

Copy link
Copy Markdown
Contributor Author

Yes indeed! As noted, there needs to be a proper fix, which is what #17752 appears to be, and this PR is then a fallback. Right now we do not provide ANY boundaries to SVGs, so plugins can throw in a giant SVG and it will happen again. This PR doesn't look at what dimensions the icon comes with, it simply applies maximum dimensions.

This one is not urgent if the other has been merged, and might even need feedback: should plugin developers be able to provide icons bigger than 24x24? (it doesn't fit) But I think it'd be good to have some fallback.

@gziolo

gziolo commented Oct 4, 2019

Copy link
Copy Markdown
Member

So the question is whether we should enforce those limits more broadly? There are more places where we would benefit from it:

  • dropdown menu
  • block toolbar
  • header in general

@jasmussen

Copy link
Copy Markdown
Contributor Author

I used to be very strict about this, by my personal opinion has changed a little bit.

I think it's important that the icon is no bigger than 24x24.

I think it's okay for an icon to have color, I used to think we should enforce all gray.

Ideally it's also ONLY 24x24, designed for it, and using only a single color. But we can't enforce this bit.

But all of that is maybe a separate discussion.

@gziolo gziolo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine with me as is :)

@etoledom

etoledom commented Oct 8, 2019

Copy link
Copy Markdown
Contributor

Since #17752 was merged, do we still need the changes on this PR?

@jasmussen

Copy link
Copy Markdown
Contributor Author

@etoledom yes as noted in #17722 (comment), I believe there needs to be an additional fallback to catch situations where a plugin developer adds a big SVG icon and does not provide proper width/height to go with that.

@gziolo
gziolo merged commit 70aa7c9 into master Oct 10, 2019
@gziolo
gziolo deleted the try/pinned-menu-item-maxwidth branch October 10, 2019 10:30
@youknowriad youknowriad added this to the Gutenberg 6.7 milestone Oct 14, 2019
@youknowriad youknowriad added [Type] Enhancement A suggestion for improvement. and removed [Type] Bug An existing feature does not function as intended [Type] Regression Related to a regression in the latest release labels Oct 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Plugins /packages/plugins [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants