as_sass

0th

Percentile

List to Sass converter

Converts multiple types of inputs to a single Sass input string for sass.

Usage
as_sass(input)
Arguments
input

Either a

  • raw Sass string

  • named list containing variable names and values

  • Sass-like file name.

Details

Note that the LibSass compiler expects .sass files to use the Sass Indented Syntax.

Value

a single character value to be supplied to sass

See Also

Visit https://sass-lang.com/documentation/file.SASS_REFERENCE.html#import for more details.

Aliases
  • as_sass
Examples
# NOT RUN {
# Example of regular Sass input
as_sass("body { color: \"blue\"; }")

# There is support for adding variables
as_sass(
  list(
    list(color = "blue"),
   "body { color: $color; }"
   )
)

# }
# NOT RUN {
# Add a file name
someFile <- tempfile("variables")

# Overwrite color to red
write("$color: \"red\";", someFile)

input <-
  as_sass(
    list(
      list(color = "blue"),
      sass_file(someFile),
      "body { color: $color; }"
      )
   )

input

# The final body color is red
sass(input)
# }
Documentation reproduced from package sass, version 0.1.1, License: MIT + file LICENSE

Community examples

Looks like there are no examples yet.