-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Block API: Support custom icons for blocks #1870
Conversation
editor/block-icon/index.js
Outdated
@@ -0,0 +1,19 @@ | |||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting; why did you choose to put it in "editor"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting; why did you choose to put it in "editor"?
It's the editor using it. My thinking is: components in blocks
are used in block implementations, components in editor
are specific to editor rendering (like here), and components in components
are shared between contexts.
Where did you have in mind?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is on the boundary that I'd probably consider to be block specific (since it is defined as block API). I'd consider the inserter to be editor, but the block icon to be part of blocks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved in c1b98ed
c1b98ed
to
701e104
Compare
Oops, this is because the component was moved from
I believe this is due to the branch's old age. This was an issue in #1897, resolved in #1920. I've confirmed it in this branch and then fixed upon rebase. |
Closes #1327
This pull request seeks to enhance the block
icon
property to support custom icons, not limiting block implementer to the icons include in the Dashicons set. With these changes, an icon can now be assigned as an element or component.Testing instructions:
Verify tests pass:
There is currently no usage of custom icons, but you can apply changes locally and observe effect if you choose. For example: