Description
Would it be possible to clarify the solution to use only what is needed and not load/write
- color
- gradients
- duotone
- CSS variables (:root)
This was mentioned here #43385, #40183, #56180
I think it's not very clear today, in the theme.json, for example, set settings.color.defaultPalette to false doesn't prevent the generation of css variables and CSS .has-** helpers, just like "settings.color.defaultGradients": false or "settings.color.defaultDuotone" : false.
Currently, the only solution I've found is this one
add_filter('wp_theme_json_data_default', function ($theme_json)
{
$data = $theme_json->get_data();
$data['settings']['color']['palette']['default'] = [];
$data['settings']['color']['duotone']['default'] = [];
$data['settings']['color']['gradients']['default'] = [];
$theme_json->update_with($data);
return $theme_json;
});
Step-by-step reproduction instructions
1 Add theme.jon
2 Add settings.color.defaultPalette, settings.color.defaultGradients, settings.color.defaultDuotone to false
3 Inspect DOM
Screenshots, screen recording, code snippet
No response
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Please confirm which theme type you used for testing.
Description
Would it be possible to clarify the solution to use only what is needed and not load/write
This was mentioned here #43385, #40183, #56180
I think it's not very clear today, in the theme.json, for example, set
settings.color.defaultPaletteto false doesn't prevent the generation of css variables and CSS.has-**helpers, just like"settings.color.defaultGradients": falseor"settings.color.defaultDuotone" : false.Currently, the only solution I've found is this one
Step-by-step reproduction instructions
1 Add theme.jon
2 Add settings.color.defaultPalette, settings.color.defaultGradients, settings.color.defaultDuotone to false
3 Inspect DOM
Screenshots, screen recording, code snippet
No response
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Please confirm which theme type you used for testing.