-
Notifications
You must be signed in to change notification settings - Fork 515
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
enhance(design): improve style of current item in menu #11061
base: main
Are you sure you want to change the base?
Conversation
Dark theme: 4.67 (menu) / 5.31 (curriculum module list tabs). Light theme: 4.51 (menu / curriculum module list tabs).
Active item gets darker (light theme) or brighter (dark theme) color.
This also applies to the New/Beta pills.
Adding regression on stage currently, most noticeable in dark mode. Open the profile menu on a page with a content behind the menu, like https://developer.allizom.org/en-US/docs/Web/JavaScript and then use a mouse scroll motion to navigate the page. Notice the menu's opacity is decreased and it has become see through. |
Good catch, thank you! I pushed a fix, and it's being deployed to stage now. |
@@ -1,8 +1,12 @@ | |||
.top-level-entry-container { | |||
&.active > a { | |||
&:not(.active):not(.user-menu):not(:hover) { | |||
opacity: 0.775; |
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 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 used opacity
for simplicity, because it avoids having to define two additional colors for light and dark theme, and because it also applies to the "New" pill on the Tools menu (which would require another two colors).
TIL about Firefox's accessibility inspector ignoring opacity, but technically this PR increases contrast.
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.
@LeoMcA Are you okay with merging 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.
it also applies to the "New" pill on the Tools menu (which would require another two colors)
Why does it apply the the "New" pill? Isn't the point of that pill to draw attention? Why are we then making it stand out less?
but technically this PR increases contrast.
Does it? It decreases the contrast of the majority of links in the header. Taking a screenshot and colour picking the colour (#757575
), then putting it in https://webaim.org/resources/contrastchecker/ shows we fail AAA contrast, which I don't think is good enough for some of the most prominent text on our site:
Co-authored-by: Leo McArdle <[email protected]>
682bd04
to
6415c73
Compare
I don't want to bikeshed here, but I don't like this design: it doesn't make sense to me. I can't think of any other site which shows the active section of the site by making the links to the other sections lower contrast. The active section should be shown with an underline, or some other distinguishing feature, not by making the rest of the links hard to see. |
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.
Contrast too low, design doesn't make sense
Summary
(MP-1103)
Problem
Solution
Inverse the menu highlighting, reducing the opacity of the inactive items using
opacity: 0.775
, and increasing the contrast of the active item by switching from--text-secondary
to--text-primary
, which is the same color used for the MDN logo.Note: Also removes the
--text-active
variable, which is no longer used.Screenshots
How did you test this change?
Ran
yarn dev
and compared http://localhost:3000/en-US/docs/Learn locally against https://developer.mozilla.org/en-US/docs/Learn.