README
sass
The sass
R package is a CSS preprocessor, letting R developers use
variables, inheritance, and functions to generate dynamic style sheets.
sass
uses the Sass CSS extension language.
Sass is stable, powerful, and CSS compatiable.
sass
is an R wrapper for LibSass, a
fast Sass compiler written in C++.
Installation
Install the released version of sass
from CRAN:
install.packages("sass")
Install the latest development build from GitHub:
# install.packages("devtools")
devtools::install_github("rstudio/sass")
Getting Started
The Sass language syntax is similar to CSS, but allows functions and variables, and it can do arbitrary computations.
library(sass)
sass("
$size: 50%;
foo { margin: $size * .33; }
")
#> /* CSS */
#> foo {
#> margin: 16.5%;
#> }
For an overview of the major features of Sass such as variables, nesting, and imports check out the official Sass Basics.
Examples
- Sass Vignette
- Background color
- https://gallery.shinyapps.io/sass-color
shiny::runApp(system.file("sass-color", package = "sass"))
- Font Color
- https://gallery.shinyapps.io/sass-font
shiny::runApp(system.file("sass-font", package = "sass"))
- Sizing
- https://gallery.shinyapps.io/sass-size
shiny::runApp(system.file("sass-size", package = "sass"))
- Themes
- https://gallery.shinyapps.io/sass-theme
shiny::runApp(system.file("sass-theme", package = "sass"))