Skip to content

Unable to reset Additional CSS to theme.json defaults #60673

@jovilog

Description

@jovilog

Description

Custom CSS from a theme.json file à la "styles": { "css": "..." } populates the Additional CSS textarea in the Site Editor.
Any edit to this field (even emptying it) is (rightfully) considered an intentional modification and decouples the field from theme.json defaults.
Whether this is a bug or a feature request, I don't know, but I think there should be a way to go back to theme.json defaults without resetting all other style changes.

Step-by-step reproduction instructions

  1. Activate a Block theme with custom CSS à la "styles": { "css": "..." } in its theme.json file.
  2. Open Site Editor, go to Styles.
  3. Custom CSS from theme.json file shows up in the Additional CSS field.
  4. Once edited and saved, there is no logical way to restore the theme.json styles other than resetting all style changes.

Screenshots, screen recording, code snippet

No response

Environment info

  • WordPress 6.5.2

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

    Global StylesAnything related to the broader Global Styles efforts, including Styles Engine and theme.json[Type] EnhancementA suggestion for improvement.

    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