-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Adds auxiliary class names for editor styles in the widgets editor #33388
Conversation
Size Change: +21 B (0%) Total Size: 1.07 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 working on this! I left some small comments and requests.
Just linking to the original issue: #33370. |
I updated it to work with data-* attributes. |
I updated this slightly:
Still, I'm not particularly comfortable with including this in 5.8 as it will not receive adequate testing before the final release next week. I'd prefer we add the issue to #33242, think the API through more thoroughly, and include a fix in 5.8.1. What do you think @desrosj? |
Oh, also, I thought about making this change in the Customizer as well but I think it's unnecessary as there are already class names containing the widget area ID in the Customizer. |
There will be an unplanned RC4 on Thursday because a few additional regressions were discovered. Does that change your opinion at all @noisysocks? |
Aha gotcha. In that case so long as this PR gets some good testing (@talldan? 😀) I'm OK with landing it in RC 4. |
@noisysocks I'm not sure about this—the widget area panel feels like it should be editor UI and outside the reach of the theme. It's also worth considering that this editor UI might change dependent on the result of #33254, so I think the data attribute should be as close to the content as possible. |
f1cec5c
to
397218c
Compare
@talldan: OK 🙂 I've moved it back to |
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.
LGTM. I think this makes sense as this is the editor-styles-wrapper
that the theme styles are applied to, so a themer can just do something like:
[data-widget-area-id="my-footer"] {
background-color: cornflowerblue;
color: paleturquoise;
}
…33388) Co-authored-by: Andrei Draganescu <[email protected]> Co-authored-by: Robert Anderson <[email protected]>
…33388) Co-authored-by: Andrei Draganescu <[email protected]> Co-authored-by: Robert Anderson <[email protected]>
…33388) Co-authored-by: Andrei Draganescu <[email protected]> Co-authored-by: Robert Anderson <[email protected]>
Description
This PR adds some classes in the widgets editor so that themes can style them individually. If this works probably the same idea in the customizer could work.
How has this been tested?
Tested locally
Screenshots
Widget area classes
Widget preview classes
Types of changes
Non breaking change. Added area name and widget name as classes to widget area block and the legacy widget preview wrapper.