-
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
class is no longer added to Navigation Block when choosing orientation #36525
Comments
Agreed. I found this to be an issue too. This is a step backwards for sure. For vertical navigations I would style nav items to have a smaller gap (about .5rem), whilst now with the horizontal version I'm stuck with each navigation item having a gap around the same size as a space so it's no longer viable. This change has ruled out me using the full-site editor in the future. |
cc @tellthemachines @jasmussen. This seems like good feedback, I know there were recent changes to the way layout works, it this still a problem? |
Thanks for bringing this up! Layout doesn't output these classes because we no longer need them to hook the styles to; the CSS is added dynamically. This is meant to save themes from having to create styles for all those classnames, but as always there are unintended consequences 😅 I'm thinking this is something that could change, but it would be good to have some more concrete use cases for the classes. What problems are we absolutely not able to solve without them? What could instead be a configuration under global styles?
This is still possible by setting What I'm trying to understand is what kind of styles themes might want to customise their navigation blocks with, and if there might be any opportunities for improving global styles based on your feedback. |
One issue that the Also unless I'm mistaken I see no option to set a blockGap based on which orientation the navigation actually is, or the context of the navigation (editor area vs widget area). I'm not a fan of giving the client control of manually tweaking such a setting as it will likely break things on different breakpoints. |
Whether or not Gutenberg requires a conditional class that exposes the orientation to the front end; Gutenberg USERS need it. Seeing this CRITICAL entry-point to writing custom CSS for blocks completely overlooked because it's not "needed" to style the base-level of CSS shipping with Gutenberg is a RED FLAG. Contributors; you need to view classes like this like the body_classes() hook. WE NEED THESE CLASSES TO DEVELOP OUR THEMES. |
I'm currently trying to apply the following when navigation is set to vertical:
At the moment I need to filter for the orientation attribute value and apply it to the rendered markup, but without something like the
|
What problem does this address?
I am really disappointed in the new layout for the Navigation block. I see how the new navigation block utilizes the layout functionality, but it was nice to have a class I was able to target for CSS styling. Specifically when you select a navigation to be vertical it used to add a
.is-vertical
class to the navigation. This was great for themes where there were unique styles for the vertical and the horizontal navigation.What is your proposed solution?
Place the functionality back into the block that attaches the class back to the navigation when you select a vertical orientation layout.
The text was updated successfully, but these errors were encountered: