insightsengineering / teal

Exploratory Web Apps for Analyzing Clinical Trial Data
https://insightsengineering.github.io/teal/
Other
181 stars 39 forks source link

Enhance vignette for Bootstrap when using `run_with_themer` and `bs_theme_update` #738

Closed donyunardi closed 1 year ago

donyunardi commented 2 years ago
    As a user of the themes, I would hope to also have another example run with `bslib::bs_theme_update()` - once I explored with `bslib::run_with_themer()` and choose my own colors/themes, an example of how to update the app with the previously chosen theme would be helpful.

_Originally posted by @kumamiao in https://github.com/insightsengineering/teal/pull/727#discussion_r981686873_

donyunardi commented 2 years ago

Hi @kumamiao

Currently, as you browse with bslib::run_with_themer, you get an output like this:

####  Update your bs_theme() R code with:  #####
bs_theme_update(theme, bootswatch = "lux")

I think the idea is that you would copy bootswatch = "lux" and add it to the current bs_theme argument in your options statement.

options("teal.bs_theme" = bslib::bs_theme(version = "5", bootswatch = "lux"))

We don't really use bs_theme_update independently, outside of bslib::run_with_themer.

Is this what your question is about? If so, perhaps we need to provide detail instruction on which one to copy from run_with_themer output during exploring in the vignette? Or, maybe I misunderstood the question?

kumamiao commented 2 years ago

We don't really use bs_theme_update independently, outside of bslib::run_with_themer.

Is this what your question is about? If so, perhaps we need to provide detail instruction on which one to copy from run_with_themer output during exploring in the vignette?

Yes exactly. In this part of the vignette we actually did provide both ways of running the options (bslib::bs_theme_update() in addition to bslib:: bs_theme()).

After user gets the bs_theme_update(...) output after exploring different themes and color changes, the natural thing to do might be to plug it directly - we could either showcase both options as examples, or provide detailed instruction on plugging in the results into bslib:: bs_theme() if that's recommended instead.

pawelru commented 1 year ago

As a separate request within this task - please include some figures / screen-shots.

donyunardi commented 1 year ago

Acceptance Criteria