theme <- sass_layer(
defaults = sass_file(system.file("examples/variables.scss", package = "sass")),
rules = sass_file(system.file("examples/rules.scss", package = "sass"))
)
# Compile the theme
sass(theme)
# Sometimes we want to use the variables from the theme to compile other sass
my_rules <- ".someclass { background-color: $bg; color: $fg; }"
sass_partial(my_rules, theme)
Run the code above in your browser using DataLab