-
Notifications
You must be signed in to change notification settings - Fork 56
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
feat(sidebar): Improve collapsible sidebars on mobile #1084
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If you have one readily available, it'd be great to have an app that you've been using for testing in the commentary |
Yeah, try the app from #1055. You can add an extra card into the card(
card_header("Layout sidebar (sets main-bg)"),
layout_sidebar(
sidebar = sidebar(
width = "25%",
style = htmltools::css(min_width="100px", max_width="250px"),
lorem::ipsum(1, 1, 3)
),
bg = "blue",
lorem::ipsum(1, 1, 6)
)
) |
cpsievert
approved these changes
Jul 10, 2024
* feat: Put collapse toggle in header grid row when collapsible on mobile * feat: Remove unused sidebar toggle gutter from page-sidebar on <= lg screens For lg or smaller screens, screen real-estate is limited and we don't need padding on both sides of the main content area, only on the side with the collapse toggle button. * feat: Avoid main area under the collapse toggle * feat: Also remove unused sidebar gutter for page_navbar() * fix: Apply bslib-page-dashboard bg correctly on mobile Need to set `--_main-bg` at the layout container and reset `background-color` rather than `--_main-bg` at the `.main` level
gadenbuie
commented
Jul 15, 2024
-webkit-
prefix for backdrop-filter
(Take 2)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This PR started as a second-take on #1080 but then related changes from #1085 required a few changes on top of the approach in this PR. The end result is that we no longer attempt the "see-through" sidebar overlay on mobile with collapsible sidebars -- that approach was too subtle by default to be worth the effort. For the effect to work well, sidebars should be opaque with a small amount of transparency. We can't, in general, create that scenario as a default.
In the end, this PR is mostly #1085, please see that description for a full changelog.
Background
This PR started as a second-take on #1080:
Summarizing some of the conversation in #1080, we're stuck with transparent sidebars -- it's better as a default to let the underlying colors pass through than to set a fixed opaque color for the sidebar. This creates issues when the sidebar is collapsible on mobile because the open sidebar is overlaid on the main container. Previously we used a blur effect, but were missing the
-webkit-
prefix to support Safari.In #1080 I explored using
color-mix()
but it greatly increased the complexity with very littly benefit. Because we don't always know (i.e. have available as a CSS property) the background color of the containers underneath the sidebar container, we still rely on transparency and we end up having the same problems as listed above.I also explored using a backdrop element below the expanded sidebar, but we again run into problems with needing to know the background color underneath the sidebar layout.