-
Notifications
You must be signed in to change notification settings - Fork 167
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
Full width dropdowns for Vanilla "meganav" navigation #5213
Conversation
6c67176
to
c030f3a
Compare
templates/docs/examples/patterns/navigation/_full-width-dropdown.jinja
Outdated
Show resolved
Hide resolved
One other comment I'll keep separate from my review, since it seems possibly out of scope - I notice there are some minor wrapping issues at specific screen sizes, particularly while desktop nav is displayed: At the very least, maybe we should keep the Sign In and Search blocks grouped together for wrapping purposes, since the Search icon wrapped by itself looks a bit strange, since it doesn't have a label? |
templates/docs/examples/patterns/navigation/dropdown-full-width.html
Outdated
Show resolved
Hide resolved
Thanks @pastelcyborg. Yes, the wrapping is kind of known issue that would not happen in real use case. We have a This example we have here has a lot more than usual navigations and I don't want to adjust the Vanilla default to accomodate that. The problem is, we can't easly have this setting adjusted per example, because it's part of compile step, so we would need a separate Vanilla build for this specific example. |
Since the component requires JS anyway, it might be nice to move to a model where we calculate the metrics of the nav discreetly and apply |
Responsive breakpoints are built on compile-time using the SCSS variables. We can't change that from JS. To move responsiveness to JS we would have to rework how mobile/desktop styles are applied, as it would have to happen not via media queries, but via JS (class name change?). Definitely out of scope . |
I just realised I messed up something in JS and sliding navigation only works for first level of nested menu, but not for second one. Need to dig out of it. |
and rename `closeAll` to `closeAllDropdowns` as a drive-by.
… and "full-width" versions
8214435
to
7466ae5
Compare
7466ae5
to
5561a20
Compare
Good catch @petesfrench. I think I managed to address it (it turned out to be a bit more complicated than your fix, but it was a good direction). I also introduced the |
@bartaz Interesting, I have done the same thing. It might be worth doing a review of the code I write and the code in Vanilla to see if we can align them. So you everything can work together out the box as it does on c.com. |
Thanks everyone for reviews and tips! |
Done
This PR adds a new style of top navigation dropdowns that are full-width containers.
Mobile version still uses the same "sliding" navigation lists of items, but desktop dropdowns will contain a separate content, with full support for grid and Vanilla components or any custom HTML.
NOTE: this feature is part of bigger work in progress for upstreaming meganav styling and is only meant to be used in the context of meganav on canonical.com or other websites.
Fixes https://warthogs.atlassian.net/browse/WD-12784
QA
NOTE: the functionality is only about dropdown container, the content of the dropdown is not part of this feature. For demo we have some test content that uses grid.
https://vanilla-framework-5213.demos.haus/docs/examples/patterns/navigation/dropdown-full-width?theme=light
https://vanilla-framework-5213.demos.haus/docs/examples/patterns/navigation/reduced?theme=light
Check if PR is ready for release
If this PR contains Vanilla SCSS code changes, it should contain the following changes to make sure it's ready for the release:
Feature 🎁
,Breaking Change 💣
,Bug 🐛
,Documentation 📝
,Maintenance 🔨
.package.json
should be updated relative to the most recent release, following semver convention:Screenshots