From ce0d2f04856142b6e9729e61112b52a30900f124 Mon Sep 17 00:00:00 2001 From: Garrick Aden-Buie Date: Tue, 19 Nov 2024 09:22:47 -0500 Subject: [PATCH] fix(shiny-preset): Don't get in the way of navbar sass vars For page_navbar(), don't set CSS vars holding the default background colors if the user gave us $navbar-bg and $navbar-{light,dark}-bg sass vars. For page_sidebar(), don't set navbar colors if the user is relying on $navbar-bg --- inst/builtin/bs5/shiny/_rules.scss | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/inst/builtin/bs5/shiny/_rules.scss b/inst/builtin/bs5/shiny/_rules.scss index 46022bb56..62415440b 100644 --- a/inst/builtin/bs5/shiny/_rules.scss +++ b/inst/builtin/bs5/shiny/_rules.scss @@ -178,8 +178,12 @@ $bslib-checkbox-radio-margin-right: 0.35em !default; .bslib-page-navbar, .bslib-page-dashboard { > .navbar { - --bslib-navbar-default-bg: var(--#{$prefix}body-bg); - --bslib-navbar-inverse-bg: var(--#{$prefix}body-color); + @if not $navbar-light-bg and not $navbar-bg { + --bslib-navbar-default-bg: var(--#{$prefix}body-bg); + } + @if not $navbar-dark-bg and not $navbar-bg { + --bslib-navbar-inverse-bg: var(--#{$prefix}body-color); + } } > .navbar + div { @@ -196,8 +200,10 @@ $bslib-checkbox-radio-margin-right: 0.35em !default; } .bslib-page-sidebar { - --bslib-page-sidebar-title-bg: var(--#{$prefix}body-bg); - --bslib-page-sidebar-title-color: var(--#{$prefix}body-color); + @if not $navbar-bg { + --bslib-page-sidebar-title-bg: var(--#{$prefix}body-bg); + --bslib-page-sidebar-title-color: var(--#{$prefix}body-color); + } .bslib-page-title { border-color: var(--#{$prefix}border-color-translucent);