Debian Codegraph @

man/sass_options.Rd

raw
1 % Generated by roxygen2: do not edit by hand
2 % Please edit documentation in R/options.R
3 \name{sass_options}
4 \alias{sass_options}
5 \alias{sass_options_get}
6 \alias{sass_options_set}
7 \title{Compiler Options for Sass}
8 \usage{
9 sass_options(
10 precision = 5,
11 output_style = "expanded",
12 indented_syntax = FALSE,
13 include_path = "",
14 source_comments = FALSE,
15 indent_type = "space",
16 indent_width = 2,
17 linefeed = "lf",
18 output_path = "",
19 source_map_file = "",
20 source_map_root = "",
21 source_map_embed = FALSE,
22 source_map_contents = FALSE,
23 omit_source_map_url = FALSE
24 )
25
26 sass_options_get(...)
27
28 sass_options_set(...)
29 }
30 \arguments{
31 \item{precision}{Number of decimal places.}
32
33 \item{output_style}{Bracketing and formatting style of the CSS output.
34 Possible styles: \code{"nested"}, \code{"expanded"}, \code{"compact"}, and
35 \code{"compressed"}.}
36
37 \item{indented_syntax}{Enables the compiler to parse Sass Indented Syntax in
38 strings. Note that the compiler automatically overrides this option to
39 \code{TRUE} or \code{FALSE} for files with .sass and .scss file extensions
40 respectively.}
41
42 \item{include_path}{Vector of paths used to resolve \verb{@import}. Multiple
43 paths are possible using a character vector of paths.}
44
45 \item{source_comments}{Annotates CSS output with line and file comments from
46 Sass file for debugging.}
47
48 \item{indent_type}{Specifies the indent type as \code{"space"} or
49 \code{"tab"}.}
50
51 \item{indent_width}{Number of tabs or spaces used for indentation. Maximum
52 10.}
53
54 \item{linefeed}{Specifies how new lines should be delimited. Possible values:
55 \code{"lf"}, \code{"cr"}, \code{"lfcr"}, and \code{"crlf"}.}
56
57 \item{output_path}{Specifies the location of the output file. Note: this
58 option will not write the file on disk. It is only for internal reference
59 with the source map.}
60
61 \item{source_map_file}{Specifies the location for Sass to write the source
62 map.}
63
64 \item{source_map_root}{Value will be included as source root in the source
65 map information.}
66
67 \item{source_map_embed}{Embeds the source map as a data URI.}
68
69 \item{source_map_contents}{Includes the contents in the source map
70 information.}
71
72 \item{omit_source_map_url}{Disable the inclusion of source map information in
73 the output file. Note: must specify \code{output_path} when \code{TRUE}.}
74
75 \item{...}{arguments to \code{\link[=sass_options]{sass_options()}}. For \code{sass_options_set()}, the
76 following values are also acceptable:
77 \itemize{
78 \item \code{NULL}, clearing the global options.
79 \item Return value of \code{sass_options_get()}.
80 \item Return value of \code{sass_options_set()}.
81 }}
82 }
83 \value{
84 List of Sass compiler options to be used with \code{\link[=sass]{sass()}}. For
85 \code{sass_options_set()}, any previously set global options are returned.
86 }
87 \description{
88 Specify compiler \code{options} for \code{\link[=sass]{sass()}}. To customize options, either provide
89 \code{sass_options()} directly to a \code{\link[=sass]{sass()}} call or set options globally via
90 \code{sass_options_set()}. When \code{shiny::devmode()} is enabled,
91 \code{sass_options_get()} defaults \code{source_map_embed} and \code{source_map_contents} to
92 \code{TRUE}.
93 }
94 \examples{
95
96 x <- "foo { margin: 122px * .001; }"
97 sass(x)
98
99 # Provide options directly to sass()
100 sass(x, options = sass_options(precision = 1, output_style = "compact"))
101
102 # Or set some option(s) globally
103 old_options <- sass_options_set(precision = 1)
104 sass(x)
105
106 # Specify local options while also respecting global options
107 sass(x, options = sass_options_get(output_style = "compact"))
108
109 # Restore original state
110 sass_options_set(old_options)
111
112 }