View Source Sass (sass_compiler v0.1.18)
Compiles SASS into CSS using a NIF for Libsass
Currently supported Sass options
- output_style
integer
- use the helpers below to assign the style - precision
integer
- decimal rounding percision - source_comments
true
orfalse
- causes the line number and file where a selector is defined to be emitted into the compiled CSS as a comment - soure_map_embed
true
orfalse
- source_map_contents
true
orfalse
- omit_source_map_url
true
orfalse
- is_indented_syntax
true
orfalse
- indent
:tab
or:space
- linefeed
:unix
or:windows
- include_paths
list
- list of directories for Sass to search for imports linked files. Example:["bower_compoents", "../node_modules"]
Link to this section Summary
Functions
Compiles a string of CSS/SCSS/Sass into CSS string
Compiles a file with CSS/SCSS/Sass into CSS string
Prints version of LibSass
Link to this section Functions
Compiles a string of CSS/SCSS/Sass into CSS string
Examples
iex> sass = "$white : #fff; a { color: $white;}"
iex> Sass.compile(sass)
{:ok, "a {\n color: #fff; }\n"}
# With options
iex> Sass.compile(sass, %{output_style: 2})
{:ok, "a { color: #fff; }\n"}
Compiles a file with CSS/SCSS/Sass into CSS string
Examples
iex> Sass.compile_file("application.scss")
{:ok, "a {\n color: #fff; }\n"}
# With options
iex> Sass.compile_file("application.scss", %{output_style: 3})
{:ok, "a{color:#fff}\n"}
Prints version of LibSass