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

bug: Nested sidebar collapse toggle position on mobile #967

Open
gadenbuie opened this issue Jan 17, 2024 · 1 comment · May be fixed by #996
Open

bug: Nested sidebar collapse toggle position on mobile #967

gadenbuie opened this issue Jan 17, 2024 · 1 comment · May be fixed by #996
Assignees

Comments

@gadenbuie
Copy link
Member

In the following app, the second and third nested sidebar toggle buttons have a little too much inline padding on mobile screens:

library(shiny)
library(bslib)

ui <- page_sidebar(
    sidebar = sidebar("Sidebar 1", bg = "#f8f8f8"),
    layout_sidebar(
        sidebar = sidebar("Sidebar 2", bg = "#f8f8f8"),
        class = "p-0",
        layout_sidebar(
            sidebar = sidebar("Sidebar 2", bg = "#f8f8f8"),
            "Main content"
        )
    ),
    padding = 0
  )

server <- function(input, output, session) {
  # Server logic goes here
}

shinyApp(ui, server)
Desktop Mobile
image image
@gadenbuie gadenbuie self-assigned this Jan 17, 2024
@gadenbuie
Copy link
Member Author

gadenbuie commented Jan 17, 2024

The problem is that the outer sidebar is a page-level sidebar and we tweak the icon position slightly

> .collapse-toggle {
left: calc(var(--_icon-size) / 2);
}

That was done in #908 and IIRC the intention was for the mobile collapse toggle button to have consistent spacing with the rest of the page:

With adjustment Without
image image

Example shinylive app

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 a pull request may close this issue.

1 participant