bslib::value_box - custom color?

Hello,

Is it correct that the argument theme_color of bslib::value_box doesn't support custom colors?

Help says: A theme color to use for the background color. Should match a name in the Bootstrap Sass variable `⁠$theme-colors⁠` (e.g., `"secondary"` , `"success"` , `"danger"` , etc).

is there a way to define my own custom theme-colors?

I want to place a value_box to show how many items have status x, and as status x has a certain green color tone in my application, I would like to have this color as background for this value_box (and the value_box for status y should have a certain purple color tone, etc.).


Referred here by rstudio/bslib

No one knows that? :slight_smile:

Using css/html you can use custom colours within the value box using "style", just note, you do have to put !important in there to override the default colour scheme


value_box(
            style = 'background-color: #5092D0!important;',
            title = "Stock", 
            value = 924,
            p( paste( Sys.Date() ) )
          )

Oh, I'm ashamed. Many thanks :slight_smile:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.