Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Enable return of dependency CSS as Sass files #4044

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

gadenbuie
Copy link
Member

This PR makes it possible to extract the Sass files prior to compilation for the following CSS:

  • shiny - shinyDependencySassLayer()
  • selectize - selectizeSassLayer()
  • ionrangeslider - ionRangeSliderDependencySassLayer()
  • daterange picker - datePickerSassLayer()

The naming might look inconsistent, but there's a method: I added a new function adjacent to the ____CSS() function for each component, replacing CSS with SassLayer.

This is an internal-facing refactor to support dynamic theming in Shiny for Python, where we need access to the pre-compiled Sass files for each dependency.

Pairs with:

Makes it possible to extract the Sass files prior to compilation for the following CSS:

* shiny
* selectize
* ionrangeslider
* daterange picker
R/input-date.R Outdated
Comment on lines 156 to 160
datePickerSassLayer <- function() {
sass::sass_file(
system_file(package = "shiny", "www/shared/datepicker/scss/build3.scss")
)
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'd prefer Layer to not be in the name since I'd expect it to return a sass::sass_layer().

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. I used that because 1. It's not clear to me what exactly a sass layer is and 2. in bslib we already had component_dependency_sass() which compiles Sass but actually returns an HTMLDependency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants