-
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
innerBlocks Component -> Essential markup differences -> Please Help! #29513
Comments
@CreativeDive It looks like the custom block in your example might not be using the For inner blocks there's also a One of the goals of both those APIs is to make the editor markup as close as possible to the front-end markup, so should result in improved consistency. |
@talldan this sounds good, but do you can explain it more exactly please? There are not only additional and unnecessary containers. There are some more differents between the core blocks markup:
You are sure we can solve all this with using the useBlockProps hook from (https://make.wordpress.org/core/2020/11/18/block-api-version-2/)? |
@CreativeDive
That seems like it's about as minimal as can be. |
@talldan perfect! Thank you |
Hey together,
I have opened this issue, because by using the innerBlocks Component, adds essential markup differences to the block editor output. This is a real horror show for theme developers to get the same design result for both, frontend and backend (block editor).
I'm starting to describe this issue:
WordPress core blocks with inner Blocks
All WordPress core blocks, which including inner blocks, using the following markup. It's always the same scheme:
This is the basic state of how WordPress builds blocks, including inner blocks in the case of the block editor.
Custom blocks with inner Blocks
Custom builded blocks, which including the inner blocks component, are totally different, to the basic state of the core blocks markup:
My feedback to the core blocks differences to custom builded blocks:
What does that mean?
You can see the order of the containers and the usage of the class names is totally different.
But the structure is actually exactly the same. No distinction is made here in the frontend either. But in the block editor everything is totally different.
I ask myself why? I have to say that it shouldn't be like that.
Why does this inconsistency have to be in the block editor? Why do I ask that?
Because it is very difficult for me as a theme developer to get the same design results for the frontend and backend.
I use some CSS rules to make dealing with nested (inner) blocks easier.
CSS rules like this:
However, these CSS rules cannot work in the block editor. Because the innerBlocks component has a completely different structure. But that shouldn't be the case.
I hope someone realizes this issues and will realize that if you want to design blocks for frontend and backend in the same way, it will always lead to frustration in the future.
Please find a uniform solution that makes sense.
The text was updated successfully, but these errors were encountered: