Add main container with min width/height to sidebar pages #1436
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 inui.page_sidebar()
andui.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.