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

fix(shiny-preset): Fix page dashboard class for page_sidebar/navbar #917

Merged
merged 4 commits into from
Nov 22, 2023

Conversation

gadenbuie
Copy link
Member

Fixes the .bslib-page-dashboard class in two cases:

  • page_sidebar(class = "bslib-page-dashboard") adds the class to the main content area of the global sidebar, same for layout_sidebar(class = "bslib-page-dashboard"). We now set the --_main-bg private CSS variable in these cases, rather than just setting background-color, since the latter is set via a rule with higher specificity.

  • page_navbar(nav_panel(class = "bslib-page-dashboard")) now works as intended when a global sidebar is used. This requires a :has() selector to set the background color of the main tab content area, rather than just the main area of the nav panel (there's padding added by the outer layout sidebar that the user can't control).

@gadenbuie gadenbuie marked this pull request as ready for review November 22, 2023 19:24
@gadenbuie gadenbuie requested a review from cpsievert November 22, 2023 19:24
@gadenbuie gadenbuie self-assigned this Nov 22, 2023
@gadenbuie gadenbuie merged commit 6bfcef8 into main Nov 22, 2023
12 checks passed
@gadenbuie gadenbuie deleted the fix/page-dashboard-class-rules branch November 22, 2023 19:34
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.

2 participants