Skip to content

Commit

Permalink
Merge pull request #1786 from hashicorp/alex-ju/sidenav-scroll
Browse files Browse the repository at this point in the history
Fix visible scrollbar in SideNav when collapsed
  • Loading branch information
alex-ju committed Nov 9, 2023
2 parents 52f3d9e + 19bc91f commit 86548a8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/shy-impalas-float.md
@@ -0,0 +1,5 @@
---
"@hashicorp/design-system-components": patch
---

`SideNav` - Fixed visible scrollbar in collapsed SideNav when scroll bar is set to be always visible
Expand Up @@ -16,6 +16,14 @@
// we use this trick (increasing the container size here, and reducing it at single panel level)
// to have the panels width match the sidebar extended width (it's used in the animated sliding of the panels)
margin: 0 calc(var(--token-side-nav-wrapper-padding-horizontal) * -1);

// we hide the content when the SideNav is collapsed to prevent the vertical scrollbar from being visible
// when the scrollbar is set to be always visible or a mouse or trackpad force it to be always visible.
// ideally we would use `display: none` but doing so would disable the fade-in transition when expanding
.hds-side-nav--is-minimized & {
height: 0;
overflow: hidden;
}
}

.hds-side-nav__content-panels {
Expand Down

2 comments on commit 86548a8

@vercel
Copy link

@vercel vercel bot commented on 86548a8 Nov 9, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

hds-showcase – ./packages/components

hds-components-hashicorp.vercel.app
hds-showcase.vercel.app
hds-showcase-git-main-hashicorp.vercel.app
hds-showcase-hashicorp.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 86548a8 Nov 9, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.