Open inc2734 opened 7 months ago
@mikachan @MaggieCabrera As folks who have worked extensively on Themes, can you speak to the impact of this?
To be clear, it is entirely valid that the editor and the front of the site do not have to have the exact same markup. That is an established convention. However, it is helpful if the same structure and classnames exist between the two in order to make it easier to consistently style the block.
I understand the concern about the disparity, and I would encourage aligning them when possible and sensible, but we'd have to:
+1 to @MaggieCabrera's comment above. I think ideally it would be great to align at least the class names in both the Editor and the front end, but we need to be really careful about breaking existing sites. I wonder if there's a way we could incrementally align the class names to help bring parity to the styling of this block.
https://github.com/WordPress/gutenberg/pull/67169 also modifies the way classes are applied. We could make the changes early in this release cycle and start alerting folks to the impact early.
That said, I don't feel this is top-most priority out of all the issues we could be focusing on.
Description
HTML structure of navigation blocks differs between editor and front.
This makes it difficult to adjust the CSS so that it looks the same in both HTML versions when it is attempted to be overridden.
Since the HTML structure in the editor feels more straightforward, it seems to me that it would be better to adapt the front end to it as well.
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
Editor
Front
.is-responsive
.items-justified-right
.wp-block-navigation
and other outermost classes are added to.wp-block-navigation__container
, but but not in the editor.wp-block-navigation__container
is adiv
, but in the front it is aul
..wp-block-navigation__container
, but not in the front if there are buttons (they go in.wp-block-navigation__responsive-container-content
)..has-block-overlay
on the front page..wp-block-page-list__submenu-icon
on front.wp-block-navigation-item__content
in the editor, but not in the frontEnvironment info
It was the same whether Gutenberg 18.2.0 was installed or not.
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes