-
Notifications
You must be signed in to change notification settings - Fork 12
OEL-4185: Improved mega menu. #702
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
base: development
Are you sure you want to change the base?
Conversation
|
🚀 Deployed on https://preview-702--oelibrary.netlify.app |
donquixote
left a comment
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 am submitting the review now so it is not lost.
@tibi2303 already told me he is working on some changes.
| </div> | ||
| </div> | ||
| {% endif %} | ||
|
|
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.
Does this removal have any impact on websites?
-> I think not, there is no pattern for header.
However, I assume that we will do a similar change in oe_whitelabel.
It seems the goal is to remove stuff from the <header> element that would otherwise conflict with the CSS.
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.
no, the pattern is not used.. i just make it somehow closer to what we have now on oesa
| <div | ||
| aria-labelledby="custom-trigger-mm-1" | ||
| class="bcl-mega-menu__submenu __level-2" | ||
| hidden="true" |
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.
This looks wrong. The hidden attribute should not have a value, at least not in its default usage.
https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/hidden
(see below, I will also comment in the respective template)
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.
fixed it by extending the drupal attributes, have a look now.. multiple test snapshots are updated because of this
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.
in test snapshot are like this: hidden="" but in html of storybook is just hidden
| {% set submenu_attributes = create_attribute() | ||
| .setAttribute('id', _panel_id) | ||
| .setAttribute('hidden', '') | ||
| .setAttribute('hidden', 'true') |
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.
The effect of this seems wrong, I see hidden="true" in the snapshots.
I think .setAttribute() is different tech in Drupal vs BCL twig, and I am not sure what is the correct way to set a value-less attribute. Maybe '' works in Drupal but not here? That would be bad.
| return Promise.resolve(resolved); | ||
| };`, | ||
| ); | ||
|
|
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.
This looks magical.
Can we add a comment explaining what we are doing here?
If you are not sure what to write, start by explaining it to me (here or in chat).
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 added the comments to be more clear
d3d6c2e to
bd3e523
Compare
13babdc to
fb37098
Compare
032b4f9 to
cbc9570
Compare
| margin: 0; | ||
| padding-inline-start: 0; | ||
| // Add a scrollbar in desktop viewport. | ||
| .see-all-button { |
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 don't agree with this selector hierarchy ul.bcl-mega-menu__items .see-all-button.
Yes, the .see-all-button happens to be inside of a .bcl-mega-menu__items, but that is actually the item list of the parent level. Too far removed.
More logical would be .bcl-mega-menu__submenu > .__body > .__see_all > .see-all-button, or .bcl-mega-menu__submenu > .__body > .__see_all > a or just .bcl-mega-menu__submenu .see-all-button.
Or there could be a dedicated namespaced class instead of .__see-all, so we could do .bcl-mega-menu__submenu-see-all > a.
| } | ||
| @include media-breakpoint-up(lg) { | ||
| > .__body { | ||
| background: $primary-bg-subtle; |
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.
This is not needed, the parent already has this background.
| icon_path: _icon_path, | ||
| level: _level, | ||
| } only %} | ||
| <div class="__body"> |
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.
Is this __body wrapper actually necessary?
It seems that it would be simpler without.
| .see-all-button { | ||
| @include mm-item-padding(); | ||
| // Use flex for icon spacing. | ||
| display: flex; |
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.
Note:
This used to have justify-content: space-between, which pushed the icon to the right.
By dropping that rule, we align closer with Figma.
-> good :)
donquixote
left a comment
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.
@tibi2303 I left some comments but also pushed some commits.
Let me know if you agree with these.
| } | ||
| } | ||
| } | ||
| } |
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 can see why we want to do this: We want to hide links in the parent menu, when a submenu is revealed.
But I do have questions:
- Is this for display, or for focus trapping, or to control the size of the scrollable area?
(I think the answer is to control height of scrollable area) - Did we not need it before, or did we just forget to add it?
But, I guess it is ok.
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.
there was a bug where submenu level 2 was bigger than first menu, we would have a white page scroll, so that's why was it added
No description provided.