rstudio/bslib

Shiny preset masks `$bslib-sidebar-bg` with a custom property in dashboard mode

Closed this issue · 0 comments

The Shiny preset sets --bslib-sidebar-bg

--bslib-sidebar-bg: RGBA(var(--#{$prefix}body-bg-rgb), 0.05);

but this masks $bslib-sidebar-bg if set

$bslib-sidebar-bg: rgba(var(--bs-emphasis-color-rgb, 0,0,0), 0.05) !default;

because .bslib-sidebar-layout will always consult the CSS variable before falling back to the default color

--_sidebar-bg: var(--bslib-sidebar-bg, #{$bslib-sidebar-bg});

Generally speaking the Shiny preset _rules.scss comes before sidebar.scss (or even in a separate Sass compilation), but I think we can safely assume that if $bslib-sidebar-bg exists we should use that value instead of our default.