Compile Sass/Scss implemented as Erlang NIF using libsass 3.5.1.
- Ubuntu 17.10
- Ubuntu 16.04
- Fedora 27
- Windows 10 x64 (Compile via MinGW gcc) See usage on Windows section below
- gcc
- g++
Please note that that Windows is only supported with Erlang/OTP 21.0 and higher. Since this release the folder containing the nif's dll is automatically added to the dll search path (OTP-14666). Erlsass uses this functionality to load it's depencency. Should you require Erlsass on Windows with a Erlang version lower than 21 feel free to use release 1.1.0.
Please note on fedora and possibly other linux distro's that use yum as package manger the g++ compiler is called gcc-c++
Simply add erlsass
to the rebar.config
file of your application and add to your application.src
file.
Default compilation style is compressed see compile/4 for options.
erlsass:compile ( file, "foo/bar/style.scss" ).
>> {ok, "body{color:#000;}"}
Style options:
- Compact
- Compressed
- Expanded
- Nested
erlsass:compile ( file, "foo/bar/style.scss", "compressed" ).
>> {ok, "body{color:#000;}"}
erlsass:compile_write ( file, "foo/bar/style.scss", "foo/bar/style.css", "compressed" ).
>> ok
erlsass:compile_write ( file, "foo/bar/style.scss", "foo/bar/style.css").
>> ok
erlsass:version().
>> {ok, "Erlsass:x.x.x;Libsass:x.x.x"}
To build erlsass on Windows 64bit you need to provide GNU gcc and g++ compilers. Follow the steps below:
-
Download MinGW64 for Windows 64bit , and unzip to
C:\mingw64
. -
Add
C:\mingw64\bin
to your Path environment variable. ( On Windows 10: Open the Start menu, typeenvironment
in the results click onEdit environment variables for your account
. Select thePath
entry and click onEdit
. ) -
Open CMD or Powershell and execute
gcc --version
. It should show you the gcc version that is present. Do the same for g++. You are now done, please see the section Install to continue. -
Note that the latest version of Erlsass on Windows is only compatible with Erlang/OTP 21 or higher.