Sass.ex v1.0.11 Sass

Compiles SASS into CSS using a NIF for Libsass

Currently supported Sass options

  • output_style Use the helpers below to assign the style
  • precision integer - decimal rounding percision
  • source_comments true or false - Causes the line number and file where a selector is defined to be emitted into the compiled CSS as a comment
  • souremapembed true or false
  • sourcemapcontents true or false
  • omitsourcemap_url true or false
  • isindentedsyntax true or false
  • indent :tab or :space
  • linefeed :unix or :windows
  • include_paths list of directorys for Sass to search for imports ex.

    ["bower_compoents", "../node_modules"]

Summary

Functions

Compiles a string of SASS into a string of CSS

Compiles a file of SASS into a string of CSS

Sass option value for sass output style compact

Sass option value for sass output style compressed

Sass option value for sass output style expanded

Sass option value for sass output style nested

Functions

compile(string, options \\ %{output_style: sass_style_nested})

Compiles a string of SASS into a string of CSS

Parameters

  • string: Sass String.
  • options: Map of sass options as defined above

Examples

Sass.compile("$white : #fff; a { color: $white;}")
#=> "a { color: #fff; }"
# With Options
Sass.compile("$white : #fff; a { color: $white;}", %{output_style: Sass.sass_style_compressed})
#=> "a{color:#fff;}"
compile_file(path, options \\ %{output_style: sass_style_nested})

Compiles a file of SASS into a string of CSS

Parameters

  • path: Path to sass file to compile.
  • options: Map of sass options as defined above

Examples

Sass.compile_file("application.scss")
#=> "a { color: #fff; }"
# With Options
Sass.compile_file("application.scss", %{output_style: Sass.sass_style_compressed})
#=> "a{color:#fff;}"
sass_style_compact()

Sass option value for sass output style compact

sass_style_compressed()

Sass option value for sass output style compressed

sass_style_expanded()

Sass option value for sass output style expanded

sass_style_nested()

Sass option value for sass output style nested