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

Option to disable duotone #31764

Open
ajlende opened this issue May 12, 2021 · 1 comment
Open

Option to disable duotone #31764

ajlende opened this issue May 12, 2021 · 1 comment

Comments

@ajlende
Copy link
Contributor

@ajlende ajlende commented May 12, 2021

What problem does this address?

There should be a way to disable the duotone UI from theme.json

What is your proposed solution?

I think for colors, if you set an empty palette [] and set custom to false in theme.json the control disappears entirely, so maybe something similar could work here too

@ajlende
Copy link
Contributor Author

@ajlende ajlende commented May 14, 2021

I think for colors, if you set an empty palette [] and set custom to false in theme.json the control disappears entirely, so maybe something similar could work here too

@mtias and @youknowriad I confirmed that this doesn't actually work for colors. Setting the values in the theme.json as specified still just shows the default palette.

These are the relevant parts of the theme.json config that I have:

{
	"version": 1,
	"settings": {
		"color": {
			"custom": false,
			"customGradient": false,
			"duotone": [],
			"gradients": [],
			"link": false,
			"palette": []
		}
	}
}

And this is what I see:

color palettes showing on the user interface when the theme.json config should have them disabled

Setting gradients or palette to false causes errors just like duotone.

Since there isn't already a system for disabling block supports via theme.json, I think having a separate setting to enable and disable them makes more sense. Palettes are used outside of block supports, so it may make sense that you want the supports disabled, but you still want the color/gradient/duotone palettes in other places like for border color for examaple.

I propose adding a block-supports option directly under settings to enable or disable the supports.

{
	"version": 1,
	"settings": {
		"block-supports": {
            "alignWide": false,
			"color": {
              "__experimentalDuotone": false,
              "background": false,
              "gradients": false,
              "text": false
           }
		}
	}
}

We default to having all block supports enabled. Setting to a value of false disables the block support. The support won't be added unless both the theme and the block have it enabled.

What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants