Skip to content

Default colors, gradients and duotones persist in the DOM after they have been disabled in theme.json #56180

@dabowman

Description

@dabowman

Description

When you use settings.color.defaultPalette, settings.color.defaultDuotone and settings.color.defaultGradients to turn off the WordPress default options for these supports the css variables still appear in the DOM on inspection. I would expect these to be removed if they've been disabled by the theme and aren't available to the user in the block editor.

Step-by-step reproduction instructions

Set settings.color.defaultPalette, settings.color.defaultDuotone and settings.color.defaultGradients to false
inspect the front-end of your application. You should see the variables for the defaults on the body element. One example I'm seeing is the default gradient --wp--preset--gradient--blush-bordeaux

Screenshots, screen recording, code snippet

No response

Environment info

WP 6.4.1
PHP 8
wp-now local environment

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Feature] ThemesQuestions or issues with incorporating or styling blocks in a theme.[Type] Help RequestHelp with setup, implementation, or "How do I?" questions.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions