A pure Java\+Script implementation of \href{https://sass-lang.com/}{\texttt{ Sass}}. {\bfseries{Sass makes CSS fun again}}.

\tabulinesep=1mm
\begin{longtabu}spread 0pt [c]{*{3}{|X[-1]}|}
\hline
  &\href{https://www.npmjs.com/package/sass}{\texttt{ }}  &\href{https://travis-ci.org/sass/dart-sass}{\texttt{ }} ~\newline
 \href{https://ci.appveyor.com/project/nex3/dart-sass}{\texttt{ }}   \\\cline{1-3}
\end{longtabu}


This package is a distribution of \href{https://github.com/sass/dart-sass}{\texttt{ Dart Sass}}, compiled to pure Java\+Script with no native code or external dependencies. It provides a command-\/line {\ttfamily sass} executable and a Node.\+js API.


\begin{DoxyItemize}
\item \href{\#usage}{\texttt{ Usage}}
\item \href{\#api}{\texttt{ API}}
\item \href{\#see-also}{\texttt{ See Also}}
\item \href{\#behavioral-differences-from-ruby-sass}{\texttt{ Behavioral Differences from Ruby Sass}}
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_sass_README_autotoc_md26106}{}\doxysubsection{Usage}\label{md_sfcode_node_modules_sass_README_autotoc_md26106}
You can install Sass globally using {\ttfamily npm install -\/g sass} which will provide access to the {\ttfamily sass} executable. You can also add it to your project using {\ttfamily npm install -\/-\/save-\/dev sass}. This provides the executable as well as a library\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{var sass = require('sass');}
\DoxyCodeLine{}
\DoxyCodeLine{sass.render(\{file: scss\_filename\}, function(err, result) \{ /* ... */ \});}
\DoxyCodeLine{}
\DoxyCodeLine{// OR}
\DoxyCodeLine{}
\DoxyCodeLine{var result = sass.renderSync(\{file: scss\_filename\}); }

\end{DoxyCode}


\href{\#api}{\texttt{ See below}} for details on Dart Sass\textquotesingle{}s Java\+Script API.\hypertarget{md_sfcode_node_modules_sass_README_autotoc_md26107}{}\doxysubsection{API}\label{md_sfcode_node_modules_sass_README_autotoc_md26107}
When installed via npm, Dart Sass supports a Java\+Script API that\textquotesingle{}s fully compatible with \href{https://github.com/sass/node-sass}{\texttt{ Node Sass}} (with a few exceptions listed below), with support for both the {\ttfamily render()} and {\ttfamily render\+Sync()} functions. See \href{https://sass-lang.com/documentation/js-api}{\texttt{ the Sass website}} for full API documentation!

Note however that by default, $\ast$$\ast${\ttfamily render\+Sync()} is more than twice as fast as {\ttfamily render()}$\ast$$\ast$ due to the overhead of asynchronous callbacks. To avoid this performance hit, {\ttfamily render()} can use the \href{https://www.npmjs.com/package/fibers}{\texttt{ {\ttfamily fibers}}} package to call asynchronous importers from the synchronous code path. To enable this, pass the {\ttfamily Fiber} class to the {\ttfamily fiber} option\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{var sass = require("{}sass"{});}
\DoxyCodeLine{var Fiber = require("{}fibers"{});}
\DoxyCodeLine{}
\DoxyCodeLine{sass.render(\{}
\DoxyCodeLine{  file: "{}input.scss"{},}
\DoxyCodeLine{  importer: function(url, prev, done) \{}
\DoxyCodeLine{    // ...}
\DoxyCodeLine{  \},}
\DoxyCodeLine{  fiber: Fiber}
\DoxyCodeLine{\}, function(err, result) \{}
\DoxyCodeLine{  // ...}
\DoxyCodeLine{\}); }

\end{DoxyCode}


Both {\ttfamily render()} and {\ttfamily render\+Sync()} support the following options\+:


\begin{DoxyItemize}
\item \href{https://github.com/sass/node-sass\#data}{\texttt{ {\ttfamily data}}}
\item \href{https://github.com/sass/node-sass\#file}{\texttt{ {\ttfamily file}}}
\item \href{https://github.com/sass/node-sass\#functions--v300---experimental}{\texttt{ {\ttfamily functions}}}
\item \href{https://github.com/sass/node-sass\#importer--v200---experimental}{\texttt{ {\ttfamily importer}}}
\item \href{https://github.com/sass/node-sass\#includepaths}{\texttt{ {\ttfamily include\+Paths}}}
\item \href{https://github.com/sass/node-sass\#indenttype}{\texttt{ {\ttfamily indent\+Type}}}
\item \href{https://github.com/sass/node-sass\#indentwidth}{\texttt{ {\ttfamily indent\+Width}}}
\item \href{https://github.com/sass/node-sass\#indentedsyntax}{\texttt{ {\ttfamily indented\+Syntax}}}
\item \href{https://github.com/sass/node-sass\#linefeed}{\texttt{ {\ttfamily linefeed}}}
\item \href{https://github.com/sass/node-sass\#omitsourcemapurl}{\texttt{ {\ttfamily omit\+Source\+Map\+Url}}}
\item \href{https://github.com/sass/node-sass\#outfile}{\texttt{ {\ttfamily out\+File}}}
\item \href{https://github.com/sass/node-sass\#sourcemapcontents}{\texttt{ {\ttfamily source\+Map\+Contents}}}
\item \href{https://github.com/sass/node-sass\#sourcemapembed}{\texttt{ {\ttfamily source\+Map\+Embed}}}
\item \href{https://github.com/sass/node-sass\#sourcemaproot}{\texttt{ {\ttfamily source\+Map\+Root}}}
\item \href{https://github.com/sass/node-sass\#sourcemap}{\texttt{ {\ttfamily source\+Map}}}
\item Only the {\ttfamily \char`\"{}expanded\char`\"{}} and {\ttfamily \char`\"{}compressed\char`\"{}} values of \href{https://github.com/sass/node-sass\#outputstyle}{\texttt{ {\ttfamily output\+Style}}} are supported.
\end{DoxyItemize}

No support is intended for the following options\+:


\begin{DoxyItemize}
\item \href{https://github.com/sass/node-sass\#precision}{\texttt{ {\ttfamily precision}}}. Dart Sass defaults to a sufficiently high precision for all existing browsers, and making this customizable would make the code substantially less efficient.
\item \href{https://github.com/sass/node-sass\#sourcecomments}{\texttt{ {\ttfamily source\+Comments}}}. Source maps are the recommended way of locating the origin of generated selectors.
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_sass_README_autotoc_md26108}{}\doxysubsection{See Also}\label{md_sfcode_node_modules_sass_README_autotoc_md26108}

\begin{DoxyItemize}
\item \href{https://github.com/sass/dart-sass}{\texttt{ Dart Sass}}, from which this package is compiled, can be used either as a stand-\/alone executable or as a Dart library. Running Dart Sass on the Dart VM is substantially faster than running the pure Java\+Script version, so this may be appropriate for performance-\/sensitive applications. The Dart API is also (currently) more user-\/friendly than the Java\+Script API. See \href{https://github.com/sass/dart-sass\#using-dart-sass}{\texttt{ the Dart Sass README}} for details on how to use it.
\item \href{https://github.com/sass/node-sass}{\texttt{ Node Sass}}, which is a wrapper around \href{https://sass-lang.com/libsass}{\texttt{ Lib\+Sass}}, the C++ implementation of Sass. Node Sass supports the same API as this package and is also faster (although it\textquotesingle{}s usually a little slower than Dart Sass). However, it requires a native library which may be difficult to install, and it\textquotesingle{}s generally slower to add features and fix bugs.
\end{DoxyItemize}\hypertarget{md_sfcode_node_modules_sass_README_autotoc_md26109}{}\doxysubsection{Behavioral Differences from Ruby Sass}\label{md_sfcode_node_modules_sass_README_autotoc_md26109}
There are a few intentional behavioral differences between Dart Sass and Ruby Sass. These are generally places where Ruby Sass has an undesired behavior, and it\textquotesingle{}s substantially easier to implement the correct behavior than it would be to implement compatible behavior. These should all have tracking bugs against Ruby Sass to update the reference behavior.


\begin{DoxyEnumerate}
\item {\ttfamily @extend} only accepts simple selectors, as does the second argument of {\ttfamily selector-\/extend()}. See \href{https://github.com/sass/sass/issues/1599}{\texttt{ issue 1599}}.
\item Subject selectors are not supported. See \href{https://github.com/sass/sass/issues/1126}{\texttt{ issue 1126}}.
\item Pseudo selector arguments are parsed as {\ttfamily $<$declaration-\/value$>$}s rather than having a more limited custom parsing. See \href{https://github.com/sass/sass/issues/2120}{\texttt{ issue 2120}}.
\item The numeric precision is set to 10. See \href{https://github.com/sass/sass/issues/1122}{\texttt{ issue 1122}}.
\item The indented syntax parser is more flexible\+: it doesn\textquotesingle{}t require consistent indentation across the whole document. See \href{https://github.com/sass/sass/issues/2176}{\texttt{ issue 2176}}.
\item Colors do not support channel-\/by-\/channel arithmetic. See \href{https://github.com/sass/sass/issues/2144}{\texttt{ issue 2144}}.
\item Unitless numbers aren\textquotesingle{}t {\ttfamily ==} to unit numbers with the same value. In addition, map keys follow the same logic as {\ttfamily ==}-\/equality. See \href{https://github.com/sass/sass/issues/1496}{\texttt{ issue 1496}}.
\item {\ttfamily rgba()} and {\ttfamily hsla()} alpha values with percentage units are interpreted as percentages. Other units are forbidden. See \href{https://github.com/sass/sass/issues/1525}{\texttt{ issue 1525}}.
\item Too many variable arguments passed to a function is an error. See \href{https://github.com/sass/sass/issues/1408}{\texttt{ issue 1408}}.
\item Allow {\ttfamily @extend} to reach outside a media query if there\textquotesingle{}s an identical {\ttfamily @extend} defined outside that query. This isn\textquotesingle{}t tracked explicitly, because it\textquotesingle{}ll be irrelevant when \href{https://github.com/sass/sass/issues/1050}{\texttt{ issue 1050}} is fixed.
\item Some selector pseudos containing placeholder selectors will be compiled where they wouldn\textquotesingle{}t be in Ruby Sass. This better matches the semantics of the selectors in question, and is more efficient. See \href{https://github.com/sass/sass/issues/2228}{\texttt{ issue 2228}}.
\item The old-\/style {\ttfamily \+:property value} syntax is not supported in the indented syntax. See \href{https://github.com/sass/sass/issues/2245}{\texttt{ issue 2245}}.
\item The reference combinator is not supported. See \href{https://github.com/sass/sass/issues/303}{\texttt{ issue 303}}.
\item Universal selector unification is symmetrical. See \href{https://github.com/sass/sass/issues/2247}{\texttt{ issue 2247}}.
\item {\ttfamily @extend} doesn\textquotesingle{}t produce an error if it matches but fails to unify. See \href{https://github.com/sass/sass/issues/2250}{\texttt{ issue 2250}}.
\item Dart Sass currently only supports UTF-\/8 documents. We\textquotesingle{}d like to support more, but Dart currently doesn\textquotesingle{}t support them. See \href{https://github.com/dart-lang/sdk/issues/11744}{\texttt{ dart-\/lang/sdk\#11744}}, for example.
\end{DoxyEnumerate}

Disclaimer\+: this is not an official Google product. 