-
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
Fix issue with missing styles for Page List in navigation. #31368
Conversation
Size Change: -161 B (0%) Total Size: 1.31 MB
ℹ️ View Unchanged
|
The Page List block can be added outside of Navigation. I wasn't able to reproduce the unstyled behavior you described in Looking at the diff it looks like you're moving the styles from Navigation Link to Navigation. I suspect I'm being naive, but can this be moved to Page List? |
Yep, the Page List when used on its own is supposed to just be a list. It's only when it's used inside the Navigation block that it should emulate menu items. That's also why the styles are intentionally not in the Page List block. By the way this issue might be specifick to block themes, i.e. try with TT1 blocks. I think it might be related to #31309. |
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.
I was able to repro on TT1 Blocks and the fix works as expected. I also confirmed that the Page List block still renders as a list outside of Navigation.
Description
Something recently changed in trunk, so that if you have a Navigation block that contains only a Page List block inside, styles aren't output on the frontend. As soon as you add a "custom" menu item, it starts working.
To an extent, this makes sense. The CSS styles that styled menu items in both the Page List and custom page links lived inside the
navigation-link
block style. This PR moves those menu item styles to live in thenavigation
block, so they get output regardless of your contents:It feels a teensy bit wrong to me to move menu item styles to the navigation block itself, however one could argue that it is the job of the Navigation block to make sure menu items look and behave correctly.
Mostly I would prefer to avoid the alternative: duplicating 1-1 the CSS that lives in the Navigation Link into the Page List block. If we had to do that, it would also be output twice if you included both a Page List and a Menu Item link.
How has this been tested?
Insert a Navigation block with ONLY a Page List inside (click "add all pages" in the placeholder). On this branch, menu items and submenus should still be styled correctly.
Checklist:
*.native.js
files for terms that need renaming or removal).