-
Notifications
You must be signed in to change notification settings - Fork 285
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
Quarto dashboard value boxes doesn't adhere to theme changes #9453
Comments
Sam as your other issue: Could you try with at least the latest stable version? You are a little bit behind, i.e., the current is 1.4.553 (1.4.526 was a pre-release from last December). (In current 1.5 pre-release, there are no changes made regarding Dashboard.) |
Oh my bad I thought my system auto-updates. In any case I tried this now with |
It turns out Quarto doesn't use the original flatly danger color for value boxes with What's happeningThis gives a hint at what's happening: Quarto overrides the default colors for value boxes of certain Bootswatch themes, one of which is flatly. In the value box Sass Quarto sets quarto-cli/src/resources/formats/dashboard/quarto-dashboard.scss Lines 342 to 345 in 466d959
It then creates an array of value box colors quarto-cli/src/resources/formats/dashboard/quarto-dashboard.scss Lines 354 to 360 in 466d959
Where
The goal of this function is to use the theme override value for The end result is that both SolutionsI have two thoughts on how to fix this. The first would be to move the theme override call into the variable defintion - $valuebox-bg-primary: $primary !default;
+ $valuebox-bg-primary: theme-override-value($theme-name, "valuebox-bg-primary", $primary) !default; In flatly, the /*-- scss:defaults --*/
$primary: #4CAF50 !default;
$valuebox-bg-primary: #4CAF50 !default; The second option would be to update $valuebox-bg-primary: null !default;
$valuebox-colors: (
"primary": theme-override-value($theme-name, "valuebox-bg-primary", $valuebox-bg-primary, $primary).
// ...
); In this scenario, @cscheid I'd be happy to contribute a fix if either of the above sound good to you. |
several hours later 🤦 my two suggestions are functionally equivalent – both require that the user set |
Thanks for all of that work @gadenbuie 🎉 Just a short question: Is |
I don't think they are. There are only a couple of dashboard-related variables (see here). Seems like Dashboard theming - Sass variables would be a good place for these to be documented. |
Bug description
It seems like the value boxes do not understand it when a theme preset like
flatly
is modified with an additionalscss
file. In the example below, you will see that on top of theflatly
theme I add ascss
file that overwrites thedanger
color to green (obviously a bad danger color but it's just for demo purposes).Using elements with
.bg-danger
class manually uses this new green color but usingcolor = "danger"
in thelist()
to create a value box uses the originalflatly
danger color. Commenting out theflatly
theme does the correct thing, though.Steps to reproduce
And the content of the scss file:
Expected behavior
Actual behavior
Your environment
Quarto check output
The text was updated successfully, but these errors were encountered: