Skip to content

Commit

Permalink
chore: Allow return of component dependency Sass files (#1052)
Browse files Browse the repository at this point in the history
* chore: Allow return of component dependency Sass files

* refactor: prefer functional decomposition over a new argument

* preset(shiny): remove unused Sass vars

They're `$select-` prefixed in selectize, so we weren't relying on these

* rename: component_dependency_sass_files()
  • Loading branch information
gadenbuie authored Jun 13, 2024
1 parent 9876ae4 commit c5244cf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Binary file modified R/sysdata.rda
Binary file not shown.
12 changes: 8 additions & 4 deletions R/utils-deps.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,19 @@ component_dependency_sass <- function(theme) {
}
}

component_dependency_sass_ <- function(theme) {
component_dependency_sass_files <- function() {
scss_dir <- path_inst("components", "scss")
scss_files <- c(
file.path(scss_dir, "mixins", "_mixins.scss"),
dir(scss_dir, pattern = "\\.scss$", full.names = TRUE)
)

# Although rare, it's possible for bs_dependency_defer() to pass
# along a NULL theme (e.g., renderTags(accordion())), so fallback
lapply(scss_files, sass_file)
}

component_dependency_sass_ <- function(theme) {
# Although rare, it's possible for bs_dependency_defer() to pass
# along a NULL theme (e.g., renderTags(accordion())), so fallback
# to the default theme if need be
theme <- theme %||% bs_theme()

Expand All @@ -65,7 +69,7 @@ component_dependency_sass_ <- function(theme) {
}

bs_dependency(
input = lapply(scss_files, sass_file),
input = component_dependency_sass_files(),
theme = theme,
name = "bslib-component-css",
version = get_package_version("bslib"),
Expand Down
4 changes: 0 additions & 4 deletions inst/builtin/bs5/shiny/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,5 @@ $accordion-button-active-bg: null;
$accordion-button-active-color: null;
$accordion-icon-active-color: null;

// Shiny: selectInput() and selectizeInput()
$selectize-color-dropdown-item-active: $component-active-bg !default;
$selectize-color-dropdown-item-active-text: $component-active-color !default;

// Component Variables
@import "ionrangeslider/_variables.scss";

0 comments on commit c5244cf

Please sign in to comment.