C.73 SassTask

The SassTask converts SCSS or Sass files to CSS using either the 'sass' gem or the scssphp package.

Table C.98: Attributes

checkBooleanWhether to just check the syntax of the input files.FalseNo
compactBooleanSet the style to compact.FalseNo
compressedBooleanSet the style to compressed.FalseNo
crunchedBooleanSet the style to crunched. Supported by scssphp, not sass.FalseNo
expandBooleanSet the style to expanded.FalseNo
encodingStringDefault encoding for input files. Supported by scssphp.utf-8No
executableStringLocation/name of the sass executable, if required.sassNo
extfilterStringExtension to filter against.n/aNo
failonerrorBooleanWhether to fail/halt if an error occurs.FalseNo
fileStringName of single file to process.N/ANo
flagsStringAdditional flags to set for sass executable.n/aNo
inputStringName of single file to process. Synonym for file.N/ANo
keepsubdirectoriesBooleanWhether to keep the directory structure when compiling.TrueNo
linenumbersBooleanWhether to annotate generated CSS with source file and line numbers.FalseNo
nestedBooleanSet the style to expanded.trueNo
newextStringExtension for newly created files.cssNo
nocacheBooleanWhether to cache parsed sass files.n/aNo
outputStringCorresponding output file for 'file'/'input' parameter. If not specified and outputpath is, then the generated file is placed there, with the filename based on the input file. If neither is specified, then the generated file is placed into the directory that the input file is in. N/ANo
outputpathStringWhere to place the generated CSS files.n/aYes
pathStringSpecify sass import path. e.g. --load-path ...n/aNo
removeoldextBooleanWhether to strip existing extension off the output filename.TrueNo
styleStringName of style to output. Must be one of 'nested', 'compact', 'compressed', 'crunched' or 'expanded'. 'Helper' attributes may also be used. 'crunched' is supported by scssphp only.nestedNo
traceBooleanWhether to show a full stack trace on error.FalseNo
unixnewlinesBooleanUse Unix-style newlines in written files.TrueNo
useSassBooleanWhether to use the 'sass' command line tool. Takes precedence over scssphp if both are available and enabled.TrueNo
useScssphpBooleanWhether to use the 'scssphp' PHP package.TrueNo

The useSass and useScssphp attributes can be used to indicate which compiler should be used, which would be useful if both are available. If both are available and enabled, then the 'sass' compiler is used rather than the scssphp library.

C.73.1 Example

<sass style="compact" trace="yes" unixnewlines="yes" outputpath="${compiled.dir.resolved}">
    <fileset dir="."/>

C.73.2 Supported Nested Tags