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

A way to add classes to custom icon libraries #27

Open
nick-novak opened this issue Mar 1, 2023 · 2 comments
Open

A way to add classes to custom icon libraries #27

nick-novak opened this issue Mar 1, 2023 · 2 comments
Labels
Enhancement New enhancement or feature request.

Comments

@nick-novak
Copy link

Hey,
I think it would be great if when creating a custom icon to the block that certain icons or categories could have custom classes.

example
{ isDefault: true, name: 'bookmark', title: __( 'Bookmark', 'icon-block' ), icon: '<svg width="24px" height="24px" viewBox="0 0 24 24"><path d="M15.5,4.25 L9,4.25 C7.48121644,4.25 6.25,5.48121644 6.25,7 L6.25,19.5 L6.25678483,19.6039817 C6.33269168,20.17682 7.02861659,20.4632798 7.48809353,20.0694425 L12.25,15.988 L17.0119065,20.0694425 C17.4984115,20.4864467 18.25,20.1407649 18.25,19.5 L18.25,7 C18.25,5.48120782 17.0188049,4.25 15.5,4.25 Z M15.5,5.75 L15.6278083,5.75645347 C16.2581415,5.82046462 16.75,6.3527795 16.75,7 L16.75,17.869 L12.7380935,14.4305575 L12.63989,14.3592262 C12.3667749,14.1927863 12.0115663,14.2165634 11.7619065,14.4305575 L7.75,17.868 L7.75,7 C7.75,6.30964356 8.30964356,5.75 9,5.75 L15.5,5.75 Z"></path></svg>', categories: [ 'category-one', 'category-two' ], class: ['custom-class'] },

@ndiego ndiego added the Enhancement New enhancement or feature request. label Mar 1, 2023
@ndiego
Copy link
Owner

ndiego commented Mar 1, 2023

Hey Nick, thanks for logging this issue. Do you imagine these classes would get added as "Additional CSS Classes" on icon insertion?

image

@nick-novak
Copy link
Author

nick-novak commented Jun 22, 2023

That would be fine in the editor. Easy enough and follows the similarities of WP.

In the example I gave it's more in the custom icon file. It might be nice to add them to icons like you do when you add categories to them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New enhancement or feature request.
Projects
None yet
Development

No branches or pull requests

2 participants