-
Notifications
You must be signed in to change notification settings - Fork 208
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
Bump to vanilla-4.7.0 #13548
Bump to vanilla-4.7.0 #13548
Conversation
Demo starting at https://ubuntu-com-13548.demos.haus |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #13548 +/- ##
=======================================
Coverage 74.41% 74.41%
=======================================
Files 107 107
Lines 2838 2838
Branches 946 946
=======================================
Hits 2112 2112
Misses 702 702
Partials 24 24 |
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.
@@ -1366,20 +1366,6 @@ $color-link-dark: #69c !default; | |||
} | |||
} | |||
|
|||
// XXX: @bartaz: this will be covered in Vanilla | |||
// can be removed once https://github.com/canonical/vanilla-framework/issues/4875 is done and released | |||
.p-logo-section.has-misaligned-images { |
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 haven't finished qa'ing all the pages that use this, but it looks like the logo sections in https://ubuntu-com-13548.demos.haus/financial-services still look buggy without it compare to prod
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.
Also, this seems to just remove the comment, but not actual code. Is this intended?
@petesfrench @mtruj013 The main change in 4.7.0 was the increased padding of top navigation items. With 4.7.0 top nav items have padding equal to grid margin width (on large screens). (1.5rem vs previous 1rem). Similarly if there is a lot of elements in the nav (and meganav seems to be very packed) the $breakpoint-navigation-threshold may need to be adjusted to drop to mobile view as soon as they don't fit. If there are any issues that make the new padding too large for meganav ping me and @lyubomir-popov, as maybe we would need some exception for such dense navigation… |
2f588ef
to
1ff5d68
Compare
@bartaz @lyubomir-popov In the case of the meganav we already use a custom |
Also, 4.7.0 introduces https://vanillaframework.io/docs/examples/patterns/navigation/default |
static/sass/_pattern_navigation.scss
Outdated
@@ -200,6 +200,10 @@ $meganav-height: 3rem; | |||
} | |||
|
|||
.p-navigation__row--25-75 { | |||
.p-navigation__items:first-child { |
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.
Why is this needed? p-navigation__row--25-75
was added specifically to avoid need for custom styling to match the grid.
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.
Ah, ok, it's because you override the left padding on the nav items, so you need to compensate.
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 custom padding around the buttons (due to the chevron) means it doesn't align by default
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.
Code looks good to me (with couple comments below), but I don't know which parts are relevant for QA to make sure there are no regressions.
static/sass/_pattern_navigation.scss
Outdated
margin-right: 0; | ||
max-height: calc(100vh - 3rem); | ||
width: auto; | ||
|
||
.p-navigation__items { | ||
width: 100%; | ||
|
||
& > .p-navigation__item--dropdown-toggle > .p-navigation__link { |
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.
It's probably out of scope for this PR, as it doesn't originate here, but the way the navigation is implemented here, with A LOT of overrides of very specific Vanilla class names is quite fragile and possibly problematic whenever we update something in Vanilla.
Variants like these ideally should be implemented with different class names from Vanilla. So instead of overriding & > .p-navigation__item--dropdown-toggle > .p-navigation__link
, you would define p-navigation__link--dense
(or whatever is the purpose of this) and use this new class name instead.
But as I mentioned, it's not just this one thing in this PR, the whole navigation seems to be written this way, so I mention this as maybe a potential for future improvements/refactoring.
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.
Ok, I have made a separate issue to tackle this as not to block this work https://warthogs.atlassian.net/browse/WD-8935
I see the search button have some padding that didn't before. This might seem minor, but it is reducing the gap between "Get Ubuntu" and "All Canonical", making it barely noticeable particularly when the user is logged in. There are some alignment issues on the mobile navigation, at the left of the nav items: |
@lyubomir-popov could you give this a look please |
Elaborating a bit on this, see these screenshots: This is what it looks like in the live version: This is what it looks like in the demo: See how the gap between "Get Ubuntu" and "All Canonical" virtually disappears, making it all look like one long list instead of two, one left aligned the other right aligned. This arguably increases cognitive download and hinders the sense of hierarchy that separating them provides. @lyubomir-popov thoughts on it? |
@juanruitina @petesfrench There seems to be some additional padding in this PR on the right. What is live seems correct: search button (when hovered) should end exactly where grid ends: On the demo there is some additional "padding" that squeezes the navigation: But I can't figure out what causes this. It's not actuall padding or margin, it seems like the items in the nav are not spanning whole width of available space. |
@petesfrench I think I see what the issue is. You have all the nav items in a single But if you want to have 2 sets: one left aligned, and the other right aligned, you need two separate Compare to Vanilla home page: The misalignment is caused because the first navigation items list is shifted to the left (to align with the grid). So if it includes the right aligned items, those are shifted as well. Right aligned items need to be in separate list. |
@bartaz @juanruitina I have added a negative margin to the top nav so it aligns. The reason for having them all in my list is to simplify the JS logic that handles the navigation. Sticking to the vanilla pattern would be better but would require some refactoring of the code which I would like to avoid right now. What do you think? |
Merging without 4.8.0 as it requires more SCSS changes and would grow the scope of this PR. |
Done
QA