Skip to content

chore(navigation-menu): style and text updates to condense menu - #1710

Open
brysonbw wants to merge 3 commits into
mdn:mainfrom
brysonbw:condense-compact-menu-1436
Open

brysonbw wants to merge 3 commits into
mdn:mainfrom
brysonbw:condense-compact-menu-1436

Conversation

@brysonbw

@brysonbw brysonbw commented Jul 11, 2026 •

Copy link
Copy Markdown
Contributor

Description

Changes

  • Remove Learn/Tools icons
  • Update Web APIs text/verbiage to APIs
  • Applied updated search input styling for the --screen-menu-compact breakpoint
  • Updated the @Custom-Media definition for --screen-menu-compact

Screen recordings

Before

1436-before.mov

After

1436-after.mov

Related issues and pull requests

@brysonbw
brysonbw requested a review from a team as a code owner July 11, 2026 11:25
@brysonbw
brysonbw requested a review from caugner July 11, 2026 11:25
Comment thread components/search-button/element.js Outdated
@github-actions

github-actions Bot commented Jul 11, 2026 •

Copy link
Copy Markdown
Contributor

c7d6c76 was deployed to: https://fred-pr1710.review.mdn.allizom.net/

@brysonbw
brysonbw force-pushed the condense-compact-menu-1436 branch from d1df5bf to 403c432 Compare July 13, 2026 12:52
@caugner caugner changed the title refactor(navigation-menu): style and text updates to condense menu chore(navigation-menu): style and text updates to condense menu Jul 14, 2026
Comment thread components/menu/tabs.json Outdated
Comment thread components/search-button/element.css Outdated
@pepelsbey

pepelsbey commented Jul 15, 2026 •

Copy link
Copy Markdown
Member

Remove Learn/Tools icons

The issue suggested hiding icons at narrow viewports, not removing them.

I fully understand that the linked issue is pretty brief, but there's something that's been misunderstood in this PR: the changes proposed in the issue are adaptive (depending on the available space), not static (for all viewports).

It means, for example, that icons are there on desktop and on mobile viewports, but are hidden on narrow viewports, just before mobile. The same for Web APIs turning to APIs, etc.

@brysonbw

brysonbw commented Jul 15, 2026 •

Copy link
Copy Markdown
Contributor Author

Remove Learn/Tools icons

The issue suggested hiding icons at narrow viewports, not removing them.

I fully understand that the linked issue is pretty brief, but there's something that's been misunderstood in this PR: the changes proposed in the issue are adaptive (depending on the available space), not static (for all viewports).

It means, for example, that icons are there on desktop and on mobile viewports, but are hidden on narrow viewports, just before mobile. The same for Web APIs turning to APIs, etc.

Thanks for clarifying. Would using the --screen-small-and-narrower CSS variable in a media query target the viewport mentioned or --screen-medium-and-narrower variable or --screen-menu-compact @caugner?

@LeoMcA
LeoMcA self-requested a review July 20, 2026 11:52

@LeoMcA LeoMcA left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would using the --screen-small-and-narrower CSS variable in a media query target the viewport mentioned or --screen-medium-and-narrower variable or --screen-menu-compact

@brysonbw Almost, for the menu we use a specific set of breakpoints, independent of the general breakpoints: the main breakpoint is at 1044px: wider than that is the "desktop menu" (--screen-menu-full), narrower than that is the "mobile menu" (--screen-menu-hamburger).

Within the "desktop menu" we have a compact mode (between 1044px and 1104px, though the --screen-menu-compact currently covers all of "less than 1104px"). It's this compact mode we want to hide icons etc. on

Comment thread components/menu/base.css Outdated
Comment thread components/search-button/element.css Outdated
Comment thread components/button/server.css Outdated
Comment thread components/search-button/element.js Outdated
@brysonbw
brysonbw requested a review from LeoMcA July 25, 2026 08:48

@LeoMcA LeoMcA left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good stuff! You were right to convert to mdn-button - apologies for leading your astray - let's make that change again, so styles are pretty default for the search button within the compact range, and then we build the mocked input styles on top.

Also, now that we've condensed the menu a bunch, let's update that 1044px breakpoint to be smaller - get it as small as you can without a horizontal scrollbar appearing - there should be an e2e test which catches that happening.

light-dark(var(--color-blue-50), var(--color-blue-80));
}

@media (--screen-menu-compact) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I think your original instincts to turn this into a mdn-button were right: we're missing a few things here relative to the adjacent login/out button (the background hover colour, the icon centering, etc.).

I reckon it would be safer to start with the default mdn-button styling, then build the fake input styling on top of that with a @media not (--screen-menu-compact) query.

@brysonbw brysonbw Jul 31, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this something we are looking to achieve @LeoMcA?

Here in video: @custom-media --screen-menu-compact (960px < width <= 1104px);

1436-1-after.mov

@LeoMcA LeoMcA Aug 10, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brysonbw on the right track, but can we style the "fake input" again over the top of the mdn-button for the full width and mobile menus (i.e. where your video starts and ends), so resizing wide to narrow we go: "fake input", normal button, "fake input" again?

I think we can go more aggressive with that breakpoint too: the buttons and menu should nearly touch before we collapse to the compact menu, and then again before we collapse to the hamburger

@brysonbw

brysonbw commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor Author

Good stuff! You were right to convert to mdn-button - apologies for leading your astray - let's make that change again, so styles are pretty default for the search button within the compact range, and then we build the mocked input styles on top.

Also, now that we've condensed the menu a bunch, let's update that 1044px breakpoint to be smaller - get it as small as you can without a horizontal scrollbar appearing - there should be an e2e test which catches that happening.

All good brother. Thanks for the feedback

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants