Skip to content

Improve UX of sidenav#13483

Merged
parlough merged 10 commits into
flutter:mainfrom
Anderson-Andre-P:feat/improve_ux_nav_menu
Jul 22, 2026
Merged

Improve UX of sidenav#13483
parlough merged 10 commits into
flutter:mainfrom
Anderson-Andre-P:feat/improve_ux_nav_menu

Conversation

@Anderson-Andre-P

Copy link
Copy Markdown
Contributor

Improves the sidebar navigation UX with two visual changes:

  1. Increased indentation of nested nav items — the margin-left of collapsed sub-lists was too small, making the
    hierarchy hard to read. Increased from 0.675rem to 1.75rem for clearer visual nesting.
  2. Active page highlight — the previously active item had only a very subtle background (4% opacity black/white) that
    was hard to notice. The li containing the current page now receives a light blue background (color-mix with the site
    primary color at 12% opacity) and a 3px solid blue left border, making it immediately clear which page the user is
    on.

Both changes use existing CSS variables (--site-primary-color) to respect light and dark mode automatically.


Issues fixed by this PR (if any):

None.


PRs or commits this PR depends on (if any):

None.

@Anderson-Andre-P
Anderson-Andre-P requested review from a team and sfshaza2 as code owners June 9, 2026 22:50

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates the sidebar styling to highlight active navigation links and increases the indentation of nested lists. The review feedback points out a visual hover bug, layout shift, and browser compatibility issues introduced by using :has() on the container, suggesting styling the anchor tag directly instead. Additionally, it recommends replacing margin-left with margin-inline-start to ensure proper RTL layout support.

Comment thread sites/docs/lib/_sass/components/_sidebar.scss
Comment thread sites/docs/lib/_sass/components/_sidebar.scss Outdated
Anderson-Andre-P and others added 2 commits June 9, 2026 21:08
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

@Anderson-Andre-P Anderson-Andre-P left a comment

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.

Fixed. Moved background, border, and padding directly to the a tag, removing the :has() block. Added padding-inline-start: calc(0.4rem - 3px) to compensate for the border width and keep text aligned with inactive items.

@flutter-website-bot

flutter-website-bot commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Staged preview of the updated docs.flutter.dev site (updated for commit d5c7c24):

https://flutter-docs-prod--docs-pr13483-feat-improve-ux-nav-me-8en9npve.web.app

@flutter-website-bot

flutter-website-bot commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Staged preview of the updated flutter.dev site (updated for commit d5c7c24):

https://flutter-dev-230821--www-pr13483-feat-improve-ux-nav-me-xld6rhx1.web.app

@parlough
parlough self-requested a review June 10, 2026 21:00
@parlough

Copy link
Copy Markdown
Member

/gcbrun

@parlough parlough 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.

Thanks for thinking to improve this and sorry about the delay on the review!

I have two comments/suggestions. Let me know your thoughts :)

Comment thread sites/docs/lib/_sass/components/_sidebar.scss Outdated
Comment thread sites/docs/lib/_sass/components/_sidebar.scss Outdated
@parlough parlough changed the title Feat/improve ux nav menu Improve UX of sidenav Jul 21, 2026

@Anderson-Andre-P Anderson-Andre-P left a comment

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.

New submission for review.

@parlough parlough 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.

Thanks for those adjustments! Looks good to me.

Comment thread sites/docs/lib/_sass/components/_sidebar.scss Outdated
@parlough
parlough merged commit 2c9e1d9 into flutter:main Jul 22, 2026
14 checks passed
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.

3 participants