Skip to content

Commit

Permalink
fix: Call color-contrast only if type-of() == "color"
Browse files Browse the repository at this point in the history
  • Loading branch information
gadenbuie committed Nov 19, 2024
1 parent 2355424 commit 514ad80
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion inst/builtin/bs5/shiny/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ $bslib-sidebar-fg: null !default;
@if $bslib-sidebar-bg == null {
// if sidebar-bg not set by user, default to body background
$bslib-sidebar-bg: RGBA(var(--#{$prefix}body-bg-rgb), 0.05);
} @else if $bslib-sidebar-fg == null {
} @else if $bslib-sidebar-fg == null and type-of($bslib-sidebar-bg) == "color" {
// if sidebar-bg but not -fg set by the user, find a contrasting color
$bslib-sidebar-fg: color-contrast($bslib-sidebar-bg);
}
Expand Down
2 changes: 1 addition & 1 deletion inst/components/scss/sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ $bslib-sidebar-fg: null !default;
@if $bslib-sidebar-bg == null {
// sidebar bg not set by the user
$bslib-sidebar-bg: rgba(var(--bs-emphasis-color-rgb, 0,0,0), 0.05);
} @else if $bslib-sidebar-fg == null {
} @else if $bslib-sidebar-fg == null and type-of($bslib-sidebar-bg) == "color" {
// sidebar bg set, fg unset
$bslib-sidebar-fg: color-contrast($bslib-sidebar-bg);
}
Expand Down

0 comments on commit 514ad80

Please sign in to comment.