-
Notifications
You must be signed in to change notification settings - Fork 813
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Import material icons from library #11901
Comments
Ah, looks like Gutenberg has just been inlining them as needed. It looks like Gutenberg has a custom SVG wrapper for a11y concerns. Rather than pulling into one of those third party components, which has it's own set of opinions, would it make sense to add a new icons package to Gutenberg and expose the icons that way? @material-ui/icons returns a ReactElement with their custom wrapper |
Yep! Gutenberg SVG primitives add these three attributes for better accessibility:
We should try to PR these to upstream to a library we choose to use so that it benefits everyone, not just us. Creating our own might indeed make us faster and in future allow us putting WordPress specific icons there, too. |
Noting that Gutenberg's SVG wrapper is not only for a11y concerns but also to make SVGs compatible with React Native: |
This came up at the Core, too: WordPress/gutenberg#9647 |
Might change in future: WordPress/gutenberg#14628 |
Relevant work over in Calypso: Automattic/wp-calypso#32172 |
We now have internal NPM package where we can pull from https://github.com/Automattic/wp-calypso/tree/3e69a83a497e8e2c0708d074311398cd98037df0/packages/material-design-icons |
We now also have |
Since we decided using Material icons on our Gutenberg blocks (Automattic/wp-calypso#28519, Automattic/wp-calypso#28500), we'll have plenty more of these coming up.
Would be great to be able to import these directly from a library instead of manually copying them over like we're doing now.
We'll need the actual SVG contents, not just image path and image copied with bundle like we do for the rest of the images:
https://github.com/Automattic/wp-calypso/blob/70d34aeda7ed952d929269bf60b9cf60e6dad5db/client/gutenberg/extensions/simple-payments/editor.js#L29-L34
Some candidate source libraries:
(via Automattic/wp-calypso#28501 (comment))
The text was updated successfully, but these errors were encountered: