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

Using Block Inspector sidebar groups #112

Closed
bph opened this issue May 8, 2023 Discussed in #106 · 9 comments
Closed

Using Block Inspector sidebar groups #112

bph opened this issue May 8, 2023 Discussed in #106 · 9 comments

Comments

@bph
Copy link
Collaborator

bph commented May 8, 2023

Discussed in #106

Originally posted by justintadlock May 2, 2023
Sometimes, block developers need to add custom color options that are not available as the default Text, Background, and Link color supports, as shown in this screenshot:

image

This question pops up from time to time, and it'd be good to have a solid resource on how to accomplish it. I've already written code for this in a plugin of my own: https://github.com/x3p0-dev/x3p0-progress/blob/1.0/resources/js/color/panel-color.js

Some things to note:

  • You cannot add colors to the default "Color" panel. You must build a custom panel. You should be able to add custom colors to the Color panel now.
  • You can add individual colors to other custom panels.
@justintadlock
Copy link

There's a newer (and simpler) way to do this now (note that I haven't tested this method): WordPress/gutenberg#47323 (comment)

@ryanwelcher - This is the tutorial we talked about if you want to pick it up.

@bph bph moved this from To-do to In Progress in Developer Blog Content Board May 26, 2023
@ryanwelcher
Copy link

This topic is difficult to dive into fully as all of the components that are required to add custom items to the existing controls are all marked as experimental. This alone may not be an issue but the process of adding a new items is very complicated and requires a lot of explanation. @ndiego and I discussed this today while I was working through how to add a new color and we both felt that it is far too much to get into for this post.

As such, I have focused solely on how to target the different areas to put items into them rather than extending the controls. This make the post quite short and I am questioning it's value a bit.

That being said, I have a first draft in place for this for review here and would love any feedback.

@ryanwelcher ryanwelcher moved this from In Progress to Needs 1st review in Developer Blog Content Board May 31, 2023
@justintadlock
Copy link

I think the change of direction is OK, and it's worth exploring what you have.


@bph - Do we want to split this topic into two separate tickets? Since this has changed, we should probably make sure we're leaving this open for a specific post that covers color options.

@bph
Copy link
Collaborator Author

bph commented May 31, 2023

I read the draft and I think it's great to cover all the places where extenders can add controls.

I support the change in direction.

@ryanwelcher
Copy link

I've added a short conclusion and created the preview for second review - https://developer.wordpress.org/news/?p=1465&preview=1&_ppp=7d65c5a2ea

@ryanwelcher ryanwelcher moved this from Needs 1st review to Needs 2nd review in Developer Blog Content Board Jun 1, 2023
@marybaum
Copy link
Member

marybaum commented Jun 1, 2023

I've had my way with the copy in the Google doc. See what you think and move the changes you like to the P2!

@ryanwelcher
Copy link

Thanks @marybaum! I'll apply those changes today.

@ryanwelcher ryanwelcher changed the title Adding custom color options for blocks Using Block Inspector sidebar groups Jun 2, 2023
@bph
Copy link
Collaborator Author

bph commented Jun 2, 2023

Pre-publishing checklist:

  • Post Title in Sentence case
  • Are Category or Categories selected?
  • Are Tags identifies?
  • Is there an explicit Excerpt?
  • Props added?

🙌 Publish! 📗

After-publish checklist

  • add Props for reviews to #props channel in WP Slack
  • close the issue with a comment to link to the published post

@ryanwelcher
Copy link

https://developer.wordpress.org/news/2023/06/using-block-inspector-sidebar-groups/

@github-project-automation github-project-automation bot moved this from Needs 2nd review to Ready to publish in Developer Blog Content Board Jun 2, 2023
@bph bph moved this from Ready to publish to Published (Done) in Developer Blog Content Board Jun 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Published (Done)
Development

No branches or pull requests

4 participants