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

Allow duotone support control within theme.json #35931

Closed
colorful-tones opened this issue Oct 25, 2021 · 1 comment
Closed

Allow duotone support control within theme.json #35931

colorful-tones opened this issue Oct 25, 2021 · 1 comment
Labels
Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json

Comments

@colorful-tones
Copy link
Member

colorful-tones commented Oct 25, 2021

What problem does this address?

I noticed that my block theme outputs a series of <svg> elements in the footer of my theme, and then I realized that they're all coming from duotone. So, I thought maybe I can disable all duotone from theme.json with this:

{
	"version": 1,
	"settings": {
		"color": {
			"customDuotone": false,
			"duotone": []
                }
        }
}

However, all of the <svg> are still there. This is not ideal for performance. I would prefer to have the ability to not have all those superfluous <svg> output if I do not want/need them.

What is your proposed solution?

If the two keys exists in the theme.json then disable all duotone support and do not output <svg> with add_filter( 'render_block', 'gutenberg_render_duotone_support', 10, 2 );

I'm currently running WordPress 5.8.1 and Gutenberg plugin 11.7.1

@colorful-tones colorful-tones added the Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json label Oct 25, 2021
@colorful-tones colorful-tones changed the title Allow duotone support within theme.json Allow duotone support control within theme.json Oct 25, 2021
@colorful-tones
Copy link
Member Author

It seems that this will actually disable the <svg> from being output and was just a user error on my end:

{
	"version": 1,
	"settings": {
		"color": {
			"duotone": null
                }
        }
}

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
Projects
None yet
Development

No branches or pull requests

1 participant