
<!-- README.md is generated from README.Rmd. Please edit that file -->

# sass <a href='https://rstudio.github.io/sass/'><img src='man/figures/logo.svg' align="right" height="139" /></a>

[![R build status](https://github.com/rstudio/sass/workflows/R-CMD-check/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)

<style>
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;
}
</style>

<br>

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 composible.

### 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.

<!-- end list -->

``` r
library(sass)
sass(input = "
  $size: 50%;
  foo { margin: $size * .33; }
")
```

``` css
foo {
  margin: 16.5%;
}
```

### 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://community.rstudio.com>:

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