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

Specify a color palette is to be used for background colors only (or text colors only) #28146

Open
paaljoachim opened this issue Jan 12, 2021 · 11 comments
Labels
Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Type] Feature New feature to highlight in changelogs.

Comments

@paaljoachim
Copy link
Contributor

paaljoachim commented Jan 12, 2021

Being able to show different default colors for text and background separately.

The question came up here:
Defining separate colors for backgrounds and text

https://wordpress.org/support/topic/defining-separate-colors-for-backgrounds-and-text/

@JustinyAhin
Copy link
Member

Looking at the code starting by https://github.com/WordPress/wordpress-develop/blob/master/src/wp-includes/theme.php#L3689, it doesn't seem like this feature exists.

May worth opening a feature request on Trac

@paaljoachim
Copy link
Contributor Author

I assume you mean a feature request issue here on the Gutenberg repo.

@JustinyAhin
Copy link
Member

Huh 🤔, I guess we will need to register features for text color palette and background color palette and initialize the editor with it: https://gist.github.com/3a7cfd18695133af58d207bebbf0100f.git. This should normally happen on Trac.

@mkaz
Copy link
Member

mkaz commented Jan 22, 2021

Justin, I think Paal (and the original question) were looking for documentation on how a user might set default colors using the block editor not for the documentation site. The snippet of code you included is correct, here is the documentation page for color palettes.

I think it still requires effort made on the theme side and not yet possible for a user to switch the defaults globally. So I'm not positive it is just a documentation issue. I've tagged it global styles and we can let someone from that team respond, there is also likely already a ticket for this somewhere.

@mkaz mkaz added the Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json label Jan 22, 2021
@paaljoachim
Copy link
Contributor Author

Ahhh.....
Yes. I was talking about the Gutenberg plugin support question:
https://wordpress.org/support/topic/defining-separate-colors-for-backgrounds-and-text/

"In the theme 2021, functions.PHP adds support for editor-color-palette as well as editor-gradient-presets. Is there a way to specify defaults for text colors separate from background colors? I want to define an array of text colors and a different array of background colors."

@matthewmcvickar
Copy link

I would love to be able to set two separate palettes for the 'Text Color' and 'Background Color' color settings. Is that what this ticket is tracking? I can't quite figure out what's going on in this ticket or the linked 'custom colors' ticket (#6941). Has there been any movement on this feature?

@paaljoachim
Copy link
Contributor Author

paaljoachim commented Jul 15, 2021

Hey @matthewmcvickar

I mentioned this:

Is there a way to specify defaults for text colors separate from background colors?

I found the initial support request intriguing. As it feels natural to have one color palette for the text colors and another set of colors - color palette for the background color. I noticed you linked in:
Core Component: Allow Saving Custom Colors to the Color Palette
#6941
I also noticed that 6941 links in many other issues as well.

I assume that this issue actually can be closed, as it is still a feature that needs to be worked on, and when merged it will be natural to extend the color palettes documentation.

@cr0ybot
Copy link
Contributor

cr0ybot commented Aug 26, 2021

#6941 was closed due to the introduction of theme.json, which does not address different palettes for background vs text.

I have been digging into the button block code for a few hours now to figure out if it is in any way possible to alter or remove the background color palette while leaving the text color palette alone, and I'm just not seeing a viable path. Maybe I'm missing something obvious, but I don't think this is about documentation, and I don't think this issue should be closed.

@paaljoachim
Copy link
Contributor Author

Hey @cr0ybot

I made this issue:
Allow Saving Custom Colors to the unique Color Palette for color og background (Might need to be renamed)
#34445

@mkaz mkaz changed the title Documentation: How to specify defaults for text colors separate from background colors? Specify a color palette is to be used for background colors only (or text colors only) Sep 4, 2021
@mkaz mkaz added [Type] Feature New feature to highlight in changelogs. and removed [Type] Developer Documentation Documentation for developers developer-docs labels Sep 4, 2021
@mkaz
Copy link
Member

mkaz commented Sep 4, 2021

I updated the ticket to clarify that it is not just a documentation change but a feature to allow for specifying a palette is specific for background only colors, or text only colors.

@andreawetzel
Copy link

A came across this Issue while trying to find a way to specify a palette specific to link colors. We would like our editors see Blue in the palette for link colors, but not for text and background colors.

Screenshot 2024-09-17 at 11 27 48 AM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Type] Feature New feature to highlight in changelogs.
Projects
None yet
Development

No branches or pull requests

6 participants