-
Notifications
You must be signed in to change notification settings - Fork 4.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
Social Links: Replace CSS variables with block context approach #29330
Conversation
In stricter environments kses are stripping out the CSS variable inline style resulting in block validation errors. This changes the approach to pass the colors via block context to the inner blocks to be rendered as normal inline color & background-color styles.
Size Change: +144 B (0%) Total Size: 1.38 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the quick turnaround, Aaron! This worked well in my testing.
@noisysocks this fixes #29297 and needs to be ported to 5.7. |
Thanks for working on this. So happy we didn't need to revert this cool feature ✨ |
Anytime. Thanks for the help narrowing down the possible courses of action to fix the issue without reverting the feature 👍 |
kses are stripping out the CSS variable inline style for roles without unfiltered_html capabilities. This changes the approach to pass the colors via block context to the inner blocks to be rendered as normal inline color & background-color styles.
kses are stripping out the CSS variable inline style for roles without unfiltered_html capabilities. This changes the approach to pass the colors via block context to the inner blocks to be rendered as normal inline color & background-color styles.
Fixes: #29297
Description
The approach taken in #28084 to provide the ability to set colors on the parent social link block and have these applied to inner blocks involved CSS custom properties. This has resulted in a problem where kses strip out the CSS custom property styles resulting in invalid blocks in the editor.
This PR alters the approach to pass the current icon color values via block context down to the individual social links so they can be applied as simple
color
andbackground-color
inline styles. A deprecation has been included to handle updating the saved content for the main social links block.How has this been tested?
Manually.
Testing Instructions
Screenshots
Types of changes
Bug fix.
Checklist: