File: as_sass.Rd

package info (click to toggle)
r-cran-sass 0.3.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 4,012 kB
  • sloc: cpp: 29,639; ansic: 962; sh: 668; makefile: 321; perl: 56
file content (67 lines) | stat: -rw-r--r-- 1,221 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/as_sass.R
\name{as_sass}
\alias{as_sass}
\title{List to Sass converter}
\usage{
as_sass(input)
}
\arguments{
\item{input}{Either a
\itemize{
\item raw Sass string
\item named list containing variable names and values
\item Sass-like file name.

}}
}
\value{
a single character value to be supplied to \code{\link{sass}}
}
\description{
Converts multiple types of inputs to a single Sass input string for
\code{\link{sass}}.
}
\details{
Note that the LibSass compiler expects .sass files to use the Sass Indented
Syntax.
}
\examples{
# 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; }"
   )
)

\donttest{
# 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)
}
}
\seealso{
Visit
\url{https://sass-lang.com/documentation/file.SASS_REFERENCE.html#import}
for more details.
}