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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions inst/builtin/bs5/shiny/_rules.scss
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ $bslib-checkbox-radio-margin-right: 0.35em !default;
line-height: 1.375rem;
}
.bslib-sidebar-layout > .sidebar {
border-top: var(--bslib-sidebar-border);
border-top: var(--bslib-sidebar-border);
}
}

Expand All @@ -125,7 +125,7 @@ $bslib-checkbox-radio-margin-right: 0.35em !default;
.bslib-page-sidebar {
--bslib-page-sidebar-title-bg: transparent;
--bslib-page-sidebar-title-color: var(--#{$prefix}body-color);

> .bslib-sidebar-layout > .main {
background-color: var(--bslib-shiny-preset-main-bg);
@include bslib-box-shadows;
Expand All @@ -139,13 +139,13 @@ $bslib-checkbox-radio-margin-right: 0.35em !default;
--bslib-navbar-inverse-bg: var(--#{$prefix}body-color);
}

> div {
> .navbar + 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;

// Case 1: page_navbar(sidebar = ...)
// Case 2: page_navbar(nav_panel(layout_sidebar()))
> .bslib-sidebar-layout,
> .bslib-sidebar-layout,
> .tab-content > .tab-pane.active.html-fill-container > .bslib-sidebar-layout.html-fill-item {
border-top: none !important; // Make sure we don't end up w/ a double border
> .main {
Expand Down Expand Up @@ -174,7 +174,7 @@ $bslib-checkbox-radio-margin-right: 0.35em !default;
}
}

// When the navbar is collapsed (or collapsing) on mobile, remove the
// When the navbar is collapsed (or collapsing) on mobile, remove the
// .nav-underline border
.navbar-collapse.show, .navbar-collapse.collapsing {
.nav-underline {
Expand Down
2 changes: 1 addition & 1 deletion inst/css-precompiled/5/bootstrap.min.css

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion inst/themer-demo/app.R
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,14 @@ shinyApp(
lapply(c("default", "message", "warning", "error"), function(x) {
X <- tools::toTitleCase(x)
observeEvent(input[[paste0("show", X)]], {
showNotification(paste(X, "notification styling"), type = x)
q <- parseQueryString(session$clientData$url_search)
if ("notification-duration" %in% names(q)) {
duration <- as.numeric(q[["notification-duration"]])
if (duration <= 0) duration <- NULL
} else {
duration <- 5
}
showNotification(paste(X, "notification styling"), type = x, duration = duration)
})
})

Expand Down