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

Don't display paragraph block colors if support is disabled and palette is empty array #5447

Closed
maxxwv opened this issue Mar 6, 2018 · 1 comment
Assignees
Labels
[Feature] Block API API that allows to express the block paradigm. [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.

Comments

@maxxwv
Copy link

maxxwv commented Mar 6, 2018

Issue Overview

As of now we can opt to turn off the custom color picker using 'disable-custom-colors' theme support option, as well as being able to define specific color chips to override the defaults. This is great, and thank you! However, this:

add_theme_support('editor-color-palette', array(
	'colors' => [], //also tried false, just in case...
));
add_theme_support('disable-custom-colors');

yields this:

color-picker-gutenberg

Seems to me from an user experience perspective it'd be better not to display the option areas at all if the editor can't actually make a choice there.

@mtias mtias added [Type] Enhancement A suggestion for improvement. [Feature] Block API API that allows to express the block paradigm. labels Mar 6, 2018
@jorgefilipecosta jorgefilipecosta self-assigned this Mar 9, 2018
@jorgefilipecosta jorgefilipecosta added the [Status] In Progress Tracking issues with work in progress label Mar 12, 2018
@webmandesign
Copy link
Contributor

Hi,

Your code will actually not work as you are passing an array argument to add_theme_support( 'editor-color-palette', $argument ), which is not possible currently (I've logged an issue for that: #6425).

If you want to get rid of all the colors, this seems to work for me (using Gutenberg 2.6.0):

add_theme_support( 'editor-color-palette' );
add_theme_support( 'disable-custom-colors' );

However, please note that this will not remove the color option areas from Gutenberg block settings.
And also feels like a bug in declaring the theme support for color palette (→ to whom this may concern).

Regards,

Oliver

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Block API API that allows to express the block paradigm. [Status] In Progress Tracking issues with work in progress [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

4 participants