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

Add all color palettes to select from editor panel #65148

Open
wants to merge 7 commits into
base: trunk
Choose a base branch
from

Conversation

AKSHAT2802
Copy link
Contributor

@AKSHAT2802 AKSHAT2802 commented Sep 9, 2024

Closes: #64857
Closes: #64734

What?

This PR Adds all the available colors in the list of editor color panel ( default, theme, custom ) so that the user can any predefined color in the editor.

Why?

When selecting a color we should have a list of all the predefined options for a user instead of only custom-defined options.

How?

Modified with-color-context.js file to list all the color instead of only custom colors.

Screenshots or screencast

Before

Screenshot 2024-09-09 at 5 07 46 PM

After

Screen.Recording.2024-09-09.at.5.02.51.PM.mov

Copy link

github-actions bot commented Sep 9, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Unlinked Accounts

The following contributors have not linked their GitHub and WordPress.org accounts: @EddyBoels, @burnuser.

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Unlinked contributors: EddyBoels, burnuser.

Co-authored-by: AKSHAT2802 <[email protected]>
Co-authored-by: richtabor <[email protected]>
Co-authored-by: t-hamano <[email protected]>
Co-authored-by: ndiego <[email protected]>
Co-authored-by: rohitmathur-7 <[email protected]>
Co-authored-by: javiercasares <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions github-actions bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Sep 9, 2024
Copy link

github-actions bot commented Sep 9, 2024

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @AKSHAT2802! In case you missed it, we'd love to have you join us in our Slack community.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

@shail-mehta shail-mehta added [Type] Bug An existing feature does not function as intended [Package] Editor /packages/editor [Package] Block editor /packages/block-editor and removed [Package] Editor /packages/editor labels Sep 9, 2024
@ndiego
Copy link
Member

ndiego commented Oct 25, 2024

Thanks for working on this @AKSHAT2802. However, I don't think we should display the default color palette as well, only the theme color palette in addition to any custom options set by the user. Using the Twenty Twenty-Four theme as an example, this is what it should look like.

There are no custom colors The user has added custom colors
image image

@richtabor richtabor self-requested a review November 7, 2024 14:19
Copy link
Member

@richtabor richtabor left a comment

Choose a reason for hiding this comment

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

Two notes:

  1. I should only see the palettes which I have enabled. If I don't have the default palette enabled via theme.json, then I should not see that palette here.

  2. I'd expect the colors in the same order as the color palette elsewhere, with theme colors first, then custom colors. In the screenshot below I'd expect to see my theme colors, then the custom red color:
    CleanShot 2024-11-07 at 09 19 10

@AKSHAT2802
Copy link
Contributor Author

Hii @richtabor & @ndiego
Thanks for the review
Updated the PR

Sample Images

1] Theme palette with custom colors
image

2] Changed theme palette with no custom colors
image

3] Changed theme palette and added custom colors
image

@t-hamano t-hamano self-requested a review November 13, 2024 11:50
Copy link
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

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

I think the default palette should not be disabled all the time, but only when settings.color.defaultPalette is false, otherwise it won't match other color palettes. Moreover, the order is "Theme" > "Default" > "Custom":

Current

image

Expected

image

Additionally, don't forget to test the inline text highlighting palette in this PR:

image

@richtabor
Copy link
Member

I think the default palette should not be disabled all the time, but only when settings.color.defaultPalette is false, otherwise it won't match other color palettes. Moreover, the order is "Theme" > "Default" > "Custom":

+1

@AKSHAT2802
Copy link
Contributor Author

Thanks, @t-hamano for the update.
I have changed the code according to the requirements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository [Package] Block editor /packages/block-editor [Type] Bug An existing feature does not function as intended
Projects
None yet
5 participants