sass_partial | R Documentation |
Replaces the rules for a sass_layer()
object with new rules, and compile it.
This is useful when (for example) you want to compile a set of rules using
variables derived from a theme, but you do not want the resulting CSS for the
entire theme – just the CSS for the specific rules passed in.
sass_partial(
rules,
bundle,
options = sass_options_get(),
output = NULL,
write_attachments = NA,
cache = sass_cache_get(),
cache_key_extra = NULL
)
rules |
A set of sass rules, which will be used instead of the rules
from |
bundle |
A |
options |
Compiler |
output |
Specifies path to output file for compiled CSS. May be a
character string or |
write_attachments |
If the input contains |
cache |
This can be a directory to use for the cache, a FileCache
object created by |
cache_key_extra |
additional information to considering when computing
the cache key. This should include any information that could possibly
influence the resulting CSS that isn't already captured by |
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.