Skip to content

Options

The options class allow to customize each compilation process. Most options are equals to the well known command line options from sass compilers.

Function providers

options.getFunctionProviders().add(new MyFunctions());

Headers

options.getHeaderImporters().add(new MyHeaderImporter());

Importers

options.getImporters().add(new MyImporter());

Include paths

options.getIncludePaths().add(new File("bower_components/foundation/scss");

Indention

options.setIndent("\t");

SASS syntax

Treat source_string as sass (as opposed to scss).

options.setIsIndentedSyntaxSrc(true);

Linefeed

options.setLinefeed("\r\n");

Omit source map url

Disable sourceMappingUrl in css output.

options.setOmitSourceMapUrl(true);

Output style

Output style for the generated css code.

options.setOutputStyle(io.bit3.jsass.OutputStyle.NESTED);

Precision

Precision for outputting fractional numbers.

options.setPrecision(6);

Inline source comments

If you want inline source comments.

options.setSourceComments(true);

Embed contents in source map

Embed include contents in maps.

options.setSourceMapContents(true);

Embedded source map

Embed sourceMappingUrl as data uri.

options.setSourceMapEmbed(true);

Source map

Path to source map file. Enables the source map generating. Used to create sourceMappingUrl.

options.setSourceMapFile(new File("stylesheet.css.map");