No flags found
Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.
e.g., #unittest #integration
#production #enterprise
#frontend #backend
874a04c
... +0 ...
293faec
Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.
e.g., #unittest #integration
#production #enterprise
#frontend #backend
200 | 200 | #' @export |
|
201 | 201 | #' @rdname html-dependencies |
|
202 | 202 | html_dependency_bttn <- function() { |
|
203 | - | htmlDependency( |
|
203 | + | bslib::bs_dependency_defer(bttnDependencyCSS) |
|
204 | + | } |
|
205 | + | ||
206 | + | ||
207 | + | #' @importFrom sass sass_file |
|
208 | + | #' @importFrom bslib bs_dependency is_bs_theme theme_version bs_get_variables bs_add_variables |
|
209 | + | bttnDependencyCSS <- function(theme) { |
|
210 | + | if (!bslib::is_bs_theme(theme)) { |
|
211 | + | return(htmlDependency( |
|
212 | + | name = "bttn", |
|
213 | + | version = "0.2.4", |
|
214 | + | src = c(href = "shinyWidgets/bttn", file = "assets/bttn"), |
|
215 | + | package = "shinyWidgets", |
|
216 | + | stylesheet = "bttn.min.css" |
|
217 | + | )) |
|
218 | + | } |
|
219 | + | ||
220 | + | if (is.na(bslib::bs_get_variables(theme, "royal"))) { |
|
221 | + | theme <- bslib::bs_add_variables(theme, royal = "#bd2df5") |
|
222 | + | } |
|
223 | + | ||
224 | + | if (identical(bslib::theme_version(theme), "3")) { |
|
225 | + | sass_vars <- list( |
|
226 | + | "bttn--color-primary" = "$brand-primary", |
|
227 | + | "bttn--color-success" = "$brand-success", |
|
228 | + | "bttn--color-warning" = "$brand-warning", |
|
229 | + | "bttn--color-danger" = "$brand-danger", |
|
230 | + | "bttn--color-royal" = "$royal" |
|
231 | + | ) |
|
232 | + | } else { |
|
233 | + | sass_vars <- list( |
|
234 | + | "bttn--color-primary" = "$primary", |
|
235 | + | "bttn--color-success" = "$success", |
|
236 | + | "bttn--color-warning" = "$warning", |
|
237 | + | "bttn--color-danger" = "$danger", |
|
238 | + | "bttn--color-royal" = "$royal" |
|
239 | + | ) |
|
240 | + | } |
|
241 | + | sass_input <- list( |
|
242 | + | sass_vars, |
|
243 | + | sass::sass_file( |
|
244 | + | system.file(package = "shinyWidgets", "assets/bttn/bttn.scss") |
|
245 | + | ) |
|
246 | + | ) |
|
247 | + | ||
248 | + | bslib::bs_dependency( |
|
249 | + | input = sass_input, |
|
250 | + | theme = theme, |
|
204 | 251 | name = "bttn", |
|
205 | 252 | version = "0.2.4", |
|
206 | - | src = c(href = "shinyWidgets/bttn", file = "assets/bttn"), |
|
207 | - | package = "shinyWidgets", |
|
208 | - | stylesheet = "bttn.min.css" |
|
253 | + | cache_key_extra = packageVersion("shinyWidgets") |
|
209 | 254 | ) |
|
210 | 255 | } |
|
211 | 256 | ||
257 | + | ||
212 | 258 | #' @export |
|
213 | 259 | #' @rdname html-dependencies |
|
214 | 260 | #' @importFrom bslib bs_dependency_defer |
Files | Coverage |
---|---|
R | -0.81% 74.03% |
Project Totals (51 files) | 74.03% |
293faec
874a04c