Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/rstudio/sass

Sass compiler package for R
https://github.com/rstudio/sass

Last synced: 6 days ago
JSON representation

Sass compiler package for R

Awesome Lists containing this project

README

        

---
output:
github_document
---

# sass

[![R build status](https://github.com/rstudio/sass/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/rstudio/sass/actions)
[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/sass)](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 :

[![RStudio Ask a question: sass](https://img.shields.io/badge/Ask%20a%20question-sass-75aadb.svg?style=popout&logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR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C0wLjcwNzEgMC43MDcxIDAuNzA3MSAtMTI3LjkyNjUgMzE3LjAzMTcpIiBjbGFzcz0ic3QwIiBjeD0iMzE4LjciIGN5PSIzMTIuOSIgcng9IjMwOS44IiByeT0iMzA5LjgiLz4KCQk8Zz4KCQkJPHBhdGggY2xhc3M9InN0MiIgZD0iTTQyNC43LDQxMS44aDMzLjZ2MjYuMWgtNTEuM0wzMjIsMzEwLjVoLTQ1LjN2MTAxLjNoNDQuM3YyNi4xSDIwOS41di0yNi4xaDM4LjNWMTg3LjNsLTM4LjMtNC43di0yNC43ICAgICBjMTQuNSwzLjMsMjcuMSw1LjYsNDIuOSw1LjZjMjMuOCwwLDQ4LjEtNS42LDcxLjktNS42YzQ2LjIsMCw4OS4xLDIxLDg5LjEsNzIuM2MwLDM5LjctMjMuOCw2NC45LTYwLjcsNzUuNkw0MjQuNyw0MTEuOHogICAgICBNMjc2LjcsMjg1LjNsMjQuMywwLjVjNTkuMywwLjksODIuMS0yMS45LDgyLjEtNTIuM2MwLTM1LjUtMjUuNy00OS41LTU4LjMtNDkuNWMtMTUuNCwwLTMxLjMsMS40LTQ4LjEsMy4zVjI4NS4zeiIvPgoJCTwvZz4KCTwvZz4KPC9nPgo8ZyBpZD0iV2hpdGVfTGV0dGVycyI+CjwvZz4KPGcgaWQ9IlJfQmFsbCI+CjwvZz4KPC9zdmc+)](https://community.rstudio.com/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)