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

Add main container with min width/height to sidebar pages #1436

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

gadenbuie
Copy link
Collaborator

Brings CSS and internal changes from rstudio/bslib#1057 and rstudio/bslib#1059 to Shiny for Python.

For testing the new behavior, use the Penguins dashboard in examples/penguins/app.py.

  • Adds a main.bslib-page-main container around the main contents in ui.page_sidebar() and ui.page_navbar(sidebar=ui.sidebar()) (navbar with a top-level shared sidebar).

  • The .bslib-page-main class has min-width and min-height set to Bootstrap's small break point (576px). Min width/height are applied above the small breakpoint -- the goal is to prevent overly smooshing the main contents in the in-between sizes of a ShinyLive or IDE preview window that's bigger than a mobile screen width but still small enough that fillable layouts squish to become illegible.

  • The min width/height are controllable via --bslib-page-main-min-{width,height} CSS variables or related $bslib-page-main-min-{width,height} Sass variables (not yet applicable for Shiny for Python). Note that min width must be 576px or greater to have an affect.

  • Currently, this min width/height is only applied for pages with a page-level sidebar. In the future we might apply this in other filling layouts as well.

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.

None yet

1 participant