Erlang library to compile SCSS files.
Uses the libsass project.
Add stylish
to your rebar deps (or mix deps if you are running Elixir).
% with default options
stylish:compile(<<"path/to/anything.scss">>)
% with options
stylish:compile(<<>>"path/to/anything.scss">>, [<<"style">>, <<"compressed">>])
-
For string output, if compilation is a success:
{ok, CompiledCss}
-
For file output (file path passed to
output
option), if compilation is a success:ok
-
If there is a compile error, then
{error, Error}
The following options can be passed in the second argument. All options must be binaries
-
line_numbers
-false
(default) ortrue
. Displays line numbers. -
compress
-false
(default) or true. -
load_paths
- an array of paths to use as load paths for SASS imports. All paths must be erlang binaries. -
output
- If you want the resulting CSS written to a file, then pass a path (as a binary). By default a string is returned. -
source_map
-false
(default) ortrue
. Generates source maps ifoutput
option is set.