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): Add border and styles to page main area only #883

Merged
merged 4 commits into from
Nov 1, 2023

Conversation

gadenbuie
Copy link
Member

@gadenbuie gadenbuie commented Nov 1, 2023

page_navbar() shiny preset dashboard styles adds border-top to the main area, but the selector matches any div directly below the page container.

.bslib-page-navbar {
> .navbar {
--bslib-navbar-default-bg: transparent;
--bslib-navbar-inverse-bg: var(--#{$prefix}body-color);
}
> div {
// Since we're using a transparent navbar, we need to (generally) add a border-top
border-top: $card-border-width solid $card-border-color;

This ends up matching the shiny notification center div that's added when a notification is shown.

I've updated the selector to use .navbar + div, which more specifically targets the page content area.

While here, I also modified the themer app so that you can use a query string ?notification-duration=0 to disable notifications, or you can use any numeric value to pick a non-default duration. This is helpful for testing, otherwise the notifications are hard to pin down for styling.

@gadenbuie gadenbuie requested a review from cpsievert November 1, 2023 20:12
Copy link
Collaborator

@cpsievert cpsievert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@cpsievert cpsievert merged commit 596e8ad into main Nov 1, 2023
@cpsievert cpsievert deleted the fix/shiny-preset-page-navbar branch November 1, 2023 21:14
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