-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Conversation
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
datePickerSassLayer <- function() { | ||
sass::sass_file( | ||
system_file(package = "shiny", "www/shared/datepicker/scss/build3.scss") | ||
) | ||
} |
There was a problem hiding this comment.
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()
.
There was a problem hiding this comment.
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.
This PR makes it possible to extract the Sass files prior to compilation for the following CSS:
shinyDependencySassLayer()
selectizeSassLayer()
ionRangeSliderDependencySassLayer()
datePickerSassLayer()
The naming might look inconsistent, but there's a method: I added a new function adjacent to the
____CSS()
function for each component, replacingCSS
withSassLayer
.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: