-
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
Template part: attribute feature parity with group block #25029
Conversation
Size Change: +111 B (0%) Total Size: 1.17 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.
Tested this out and it works well minus a couple things:
- The placeholder component is now taking up full width in the editor. This is probably a result of switching to the light wrapper without adding a wrapper around the Placeholders return as well.
- I can't find a way to change the tagName? I am assuming this is something we will need to add manually.
I don't think this is supported by any blocks right now. I think you just define it in the block HTML |
Ah interesting, I think we should definitely add a way to set this in a followup... it seems like it should be necessary. 🤔 |
Yeah, true. I wonder if there are existing issues for that for the group block and others |
Added the wrapper there and it seems to be fixed ✅ |
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.
Added the wrapper there and it seems to be fixed ✅
Works for me. 😁
According to the screenshot, it seems we're missing the |
b1a52fd
to
7535c10
Compare
@youknowriad I did some investigation, and those styles are defined here in the group block, so they won't apply to template parts out of the box: I'm not sure how to solve this, since it seems there are several styles scattered around to support padding/margin for the group block. I'm not sure exactly what we should change. For example, with the theme I'm testing, it seems the group block padding is ultimately set by the theme, and the theme does not set anything for template part blocks yet. |
I've copied over the theme.scss file from the group block. So this should provide good baseline styles. but it still seems like padding/margin is primarily something themes need to code? At any rate, I'll merge what we have since it seems to work well. As always, I'm happy to address feedback in followups |
Description
Closes #20997 and resolves #22034. Adds all attributes which currently exist on the group block to the template part block. (Including light block wrapper and tagName support.)
Note: These are just block attributes at the block level. Attributes are not persisted to a template part globally. This means that a change to these block attributes only applies to where the template part block is used, likely on a template level, rather than a template part level.
How has this been tested?
Locally in edit site.
Screenshots
Screenshot shows a custom HTML tagName, custom background color, and custom text color in editor and then on the front end. The margins are a separate issue :D
Front end:
Editor:
Types of changes
Checklist: