rstudio / htmltools

Tools for HTML generation and output
https://rstudio.github.io/htmltools/
215 stars 68 forks source link

Is it possible to use css string or read scss file for htmlDependency? #323

Open rrchai opened 2 years ago

rrchai commented 2 years ago

Thanks for the package. I would like to add dependency based on a scss file. For a minimal example:

// custom.scss
$color: red;

To be able to use htmlDependency, I have to convert custom.scss to custom.min.css first and:

htmltools::htmlDependency(
    name = "example",
    version = "v1"
    package = "example",
    src = "www",
    stylesheet = "custom.min.css",
    all_files = FALSE
  )

I wonder if currently it is possible to read sass file directly for stylesheet of htmltools::htmlDependency? If not, can we add a feature to read "css" string (I can use sass package to achieve so) ?