-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Closed
Labels
Global StylesAnything related to the broader Global Styles efforts, including Styles Engine and theme.jsonAnything related to the broader Global Styles efforts, including Styles Engine and theme.json[Priority] HighUsed to indicate top priority items that need quick attentionUsed to indicate top priority items that need quick attention[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended
Description
Description
Custom CSS is being reverted when pressing save.
Step-by-step reproduction instructions
- Make DISALLOW_UNFILTERED_HTML defined and truthy, e.g. by adding
config: { "DISALLOW_UNFILTERED_HTML": true },to the top level in .wp-env.json and starting with wp-env - Open the site editor
- Open the global styles sidebar
- Click the new 'Custom CSS' feature at the bottom of the page
- Paste some style rule in like
h1.wp-block-heading { text-decoration:underline; color: orange; } - Notice that the editor to the left now makes headings orange and underlined ✅
- Press Save and then Save again once the pre-save prompt has loaded
Screenshots, screen recording, code snippet
Screen.Capture.on.2022-12-19.at.13-09-07.mp4
The save HTTP request included the css values:
{
"id": 6,
"styles": {
"blocks": {<CUT_FOR_BREVITY>},
"color": {
"gradient": "var(--wp--preset--gradient--base-secondary-base) no-repeat"
},
"css": "h1.wp-block-heading { text-decoration:underline; color: orange; }",
"typography": {
"fontFamily": "var(--wp--preset--font-family--dm-sans)"
}
}
}
The response however did not include a "css" property.
Environment info
Using the wp-env from Gutenberg 14.8.01-rc.1, can also reproduce on current trunk (1b5994a)
With DISALLOW_UNFILTERED_HTML, or presumably admin on multisite install or using any role with edit_theme_options but w/o unfiltered_html
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
Labels
Global StylesAnything related to the broader Global Styles efforts, including Styles Engine and theme.jsonAnything related to the broader Global Styles efforts, including Styles Engine and theme.json[Priority] HighUsed to indicate top priority items that need quick attentionUsed to indicate top priority items that need quick attention[Type] BugAn existing feature does not function as intendedAn existing feature does not function as intended