Skip to content

Commit 890eda9

Browse files
authored
Make sure ionrangeslider also gets sass options in build script (#1340)
1 parent 110cb00 commit 890eda9

File tree

2 files changed

+15
-369
lines changed

2 files changed

+15
-369
lines changed

scripts/htmlDependencies.R

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,14 @@ copy_from_pkg <- function(pkg_name, pkg_dir, local_dir, version_dir = fs::path_d
9292
)
9393
}
9494

95+
# Set sass compilation options
96+
local_sass_options <- withr::local_(function(x) rlang::exec(sass::sass_options_set, !!!x))
97+
local_sass_options(list(
98+
output_style = "compressed",
99+
source_comments = FALSE,
100+
source_map_embed = FALSE
101+
))
102+
95103

96104
# ------------------------------------------------------------------------------
97105
# Must come first!
@@ -170,7 +178,7 @@ withr::with_options(
170178
# Overwrite css file
171179
ion_dep_dir <- fs::path(www_shared, "ionrangeslider")
172180
fs::file_move(
173-
fs::path(temp_ion_dep_dir, "ionRangeSlider", "ionRangeSlider.css"),
181+
fs::path(temp_ion_dep_dir, "ionRangeSlider", "ionRangeSlider.min.css"),
174182
fs::path(ion_dep_dir, "css", "ion.rangeSlider.css")
175183
)
176184
# Cleanup
@@ -215,18 +223,10 @@ ignored <- lapply(woff_files, function(woff_file) {
215223

216224
# ------------------------------------------------------------------------------
217225
message("Render shiny.min.css with bs_theme()")
218-
with_sass_options <- withr::with_(function(x) rlang::exec(sass::sass_options_set, !!!x))
219226

220-
sass_opts_minify <- list(
221-
output_style = "compressed",
222-
source_comments = FALSE,
223-
source_map_embed = FALSE
224-
)
225227

226-
shiny_css_dep <- with_sass_options(
227-
sass_opts_minify,
228-
shiny:::shinyDependencyCSS(shiny_theme)
229-
)
228+
229+
shiny_css_dep <- shiny:::shinyDependencyCSS(shiny_theme)
230230
shiny_css_bslib <- fs::path(shiny_css_dep$src$file, shiny_css_dep$stylesheet)
231231
shiny_css_shared <- fs::path(www_shared, "shiny.min.css")
232232
writeLines(
@@ -238,10 +238,7 @@ writeLines(
238238
)
239239

240240
message("Render selectize.min.js with bs_theme()")
241-
selectize_css_dep <- with_sass_options(
242-
sass_opts_minify,
243-
shiny:::selectizeDependencyFunc(shiny_theme)
244-
)
241+
selectize_css_dep <- shiny:::selectizeDependencyFunc(shiny_theme)
245242
selectize_css_bslib <- fs::path(
246243
selectize_css_dep$src$file,
247244
selectize_css_dep$stylesheet
@@ -255,10 +252,7 @@ fs::file_copy(
255252
)
256253

257254
message("Render datepicker.min.css with bs_theme()")
258-
datepicker_css_dep <- with_sass_options(
259-
sass_opts_minify,
260-
shiny:::datePickerCSS(shiny_theme)
261-
)
255+
datepicker_css_dep <- shiny:::datePickerCSS(shiny_theme)
262256
datepicker_css_bslib <- fs::path(
263257
datepicker_css_dep$src$file,
264258
datepicker_css_dep$stylesheet

0 commit comments

Comments
 (0)