Skip to content
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

Collapsed side nav causes main content to have extra left margin #7909

Closed
2 of 3 tasks
JacobReynolds opened this issue Feb 26, 2021 · 2 comments
Closed
2 of 3 tasks

Comments

@JacobReynolds
Copy link

JacobReynolds commented Feb 26, 2021

Collapsed side nav causes main content to have extra left margin

What package(s) are you using?

  • carbon-components
  • carbon-components-react
  • carbon-components-svelte

Detailed description

When following the UIShell examples, a collapsed side navigation bar causes extra margin to be present on the main content of the page. The responsible class seems to be

. I will use Svelte in my examples, but this appears to affect all packages.

Steps to reproduce the issue

  1. Open the following example https://carbon-svelte.vercel.app/framed/UIShell/PersistedHamburgerMenu?theme=g100
  2. Notice there is an extra 3rem of margin-left on the main content causing it to be misaligned on the page
  3. Open a developer panel and delete the <nav> element (notice that the nav is already collapsed, so this shouldn't affect anything)
  4. Notice the main content has now had the margin removed when the side nav is not present and is properly centered.
@emyarod
Copy link
Member

emyarod commented Feb 26, 2021

this may be a carbon-components-svelte specific issue, since from what I understand, the side nav should not be collapsed at wide viewport sizes. the margin exists so that there is space between the expanded side nav and the main content

image

@joshblack
Copy link
Contributor

Hi there! Going to close this one out due to inactivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants