Skip to content

SideNav should overlay Content in UIShell #1463

Open
@theetrain

Description

@theetrain
Contributor

When observing the UIShell on a small-width display, then expanding a collapsed SideNav, the SideNav squeezes the Content container. The SideNav should overlay the Content container without impacting the Content's layout.

To reproduce the issue:

  1. Go to the React UIShell in Storybook
  2. Make browser width 400px
  3. Open SideNav
  4. Observe SideNav overlays Content
  5. Go to the Svelte UIShell demo and repeat steps 2-4
  6. Observe SideNav squeezes Content

Here's the issue in screenshots:

React:

Svelte:

This is a possible duplicate of #516

Thanks for maintaining!

Activity

blame2020

blame2020 commented on Oct 7, 2022

@blame2020
Contributor

"Content" is working by removing "bx--content" from "main".
The working https://v10.carbondesignsystem.com/ doesn't seem to have "bx--content".

The following rule prevented hiding.

.bx--side-nav.bx--side-nav--expanded ~ .bx--content {
    margin-left: 16rem;
}

But I don't know if this is the correct solution.

added a commit that references this issue on Dec 14, 2022
e9501be
linked a pull request that will close this issue on Dec 14, 2022
brunnerh

brunnerh commented on Feb 24, 2023

@brunnerh
Contributor

Actually, this possibly should be OS dependent; the paradigm on Android is overlaying the content while on iOS it would be pushing it. Certain native app frameworks already switch accordingly.

(The push should not impact the width of the content, just push some of it off screen, though.)

theetrain

theetrain commented on Feb 24, 2023

@theetrain
ContributorAuthor

The overlay versus push experience on Android and iOS is an interesting detail. However, when I tested the Carbon React UIShell on an iOS device, it didn't seem to implement a push effect:

image

I assume the flagship library tries to be consistent with OS-independent viewport-based behaviours.

brunnerh

brunnerh commented on Feb 24, 2023

@brunnerh
Contributor

If I had to choose just one behavior, I would also go with overlay. User agent/system detection code also can be messy.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Participants

      @brunnerh@theetrain@blame2020

      Issue actions

        SideNav should overlay Content in UIShell · Issue #1463 · carbon-design-system/carbon-components-svelte