Learn R Programming

⚠️There's a newer version (0.4.10) of this package.Take me there.

sass

The sass R package provides bindings to LibSass, a fast Sass 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:

install.packages("sass")

Install the latest development build from GitHub:

# 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.
  • A sass_file(), sass_import(), or sass_layer().
  • A nested list() comprising of all the above.
library(sass)
sass(input = "
  $size: 50%;
  foo { margin: $size * .33; }
")
foo {
  margin: 16.5%;
}

Learn more

See sass’s overview vignette as well as the official Sass documentation.

Ask a question

If you have a question about sass, try asking one on https://community.rstudio.com:

Copy Link

Version

Install

install.packages('sass')

Monthly Downloads

1,046,156

Version

0.2.0

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Carson Sievert

Last Published

March 18th, 2020

Functions in sass (0.2.0)

sass_options

Compiler Options for Sass
sass_cache_options

Caching Options for Sass
sass_import

Sass Import
as_sass

List to Sass converter
sass_layer

Sass layer objects
sass

Compile Sass to CSS