https://github.com/rstudio/sass
Sass compiler package for R
https://github.com/rstudio/sass
Last synced: 2 days ago
JSON representation
Sass compiler package for R
- Host: GitHub
- URL: https://github.com/rstudio/sass
- Owner: rstudio
- License: other
- Created: 2018-08-14T17:02:58.000Z (over 6 years ago)
- Default Branch: main
- Last Pushed: 2025-04-03T02:22:24.000Z (12 days ago)
- Last Synced: 2025-04-05T13:45:19.713Z (10 days ago)
- Language: C++
- Homepage: https://rstudio.github.io/sass/
- Size: 9.45 MB
- Stars: 100
- Watchers: 13
- Forks: 18
- Open Issues: 20
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - rstudio/sass - Sass compiler package for R (C++)
README
---
output:
github_document
---[](https://github.com/rstudio/sass/actions)
[](https://cran.r-project.org/package=sass)pre {
border: 1px solid #eee;
}pre.r {
background-color: #ffffff;
}pre.r code {
background-color: #ffffff;
}pre.css {
margin-top: -1.25rem;
background-color: #f8f8f8;
border-radius: 0;
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
}```{r setup, include=FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
message = FALSE,
out.width = "100%",
class.output = "css",
comment = ""
)
```
The `sass` R package provides bindings to [LibSass](https://github.com/sass/libsass), a fast [Sass](https://sass-lang.com/) compiler written in C++. Sass is a mature and stable CSS extension language that makes styling modern websites less complex and more composable.
### Installation
Install the released version of `sass` from CRAN:
```r
install.packages("sass")
```Install the latest development build from GitHub:
```r
# install.packages("remotes")
remotes::install_github("rstudio/sass")
```### Basic usage
To compile Sass into CSS, provide Sass to the `input` argument of the `sass()` function. `input` can be any of the following:
* An R string (as in the example below).
* A named `list()` defining [Sass variables](https://rstudio.github.io/sass/articles/sass.html#variables).
* A `sass_file()`, `sass_import()`, or `sass_layer()`.
* A nested `list()` comprising of all the above.```{r}
library(sass)
sass(input = "
$size: 50%;
foo { margin: $size * .33; }
")
```### Learn more
See **sass**'s [overview vignette](https://rstudio.github.io/sass/articles/sass.html) as well as the official [Sass documentation](https://sass-lang.com/documentation/).
### Ask a question
If you have a question about **sass**, try asking one on :
[](https://forum.posit.co/new-topic?title=&category_id=10&tags=sass&body=%0A%0A%0A%20%20--------%0A%20%20%0A%20%20%3Csup%3EReferred%20here%20by%20%60sass%60%27s%20README%3C/sup%3E%0A&u=rich_i)