-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[Bug]: Editor: gradient
presets cleared on save
#71009
Comments
I'm investigating this, but I'm fairly certain that those gradients are removed by the ever-overzealous Dotcom KSES. |
cc @fullofcaffeine and @david-binda |
Looks like this is a Core issue, so I created a ticket there: https://core.trac.wordpress.org/ticket/57322 |
While this is solved in Core, we can definitely add a temporary fix to WPCOM to prevent the issue in the meantime. This can be done in a similar fashion to D94491-code by hooking into Examples of such missed gradients are the ones defined by the Sherbet or the Pilgrimage style variations of the Twenty Twenty-Three theme. However, my regex skills are not that advanced and I have no idea about what is the pattern we should use to catch all the possible valid values. cc @david-binda in case you can lend a hand here. |
Yup, makes sense. I'll see if I can come up with something. |
I have followed in the core ticket with a proposed fix for the issue. If we were about to patch WPCOM, then it should be something similar to what WordPress.org is going to implement. |
Thanks @david-binda! I created D97501-code based on your patch to implement a temporary fix for WPCOM. |
Fixed by D97501-code. |
Quick summary
Custom gradients set in theme.json at
settings.color.gradients
seem to be cleared when a style variation is applied and then saved in the editor. The gradient appears correctly when the variation is chosen but then disappears when the editor is saved.This does not happen on self-hosted sites.
Steps to reproduce
What you expected to happen
The custom gradients should remain after saving the editor.
What actually happened
The custom gradients disappear after saving.
It looks like the CSS variables (e.g.
--wp--preset--gradient--dots
in Pilgrimage) are lost/cleared/deleted on save from looking at the page source, as the definitions exist when the variation is applied, and then are deleted when the variation is saved.Browser
No response
Context
No response
Platform (Simple, Atomic, or both?)
Simple, Atomic
Other notes
No console errors
Reproducibility
Consistent
Severity
Some (< 50%)
Available workarounds?
None
Workaround details
No response
The text was updated successfully, but these errors were encountered: