The SassTask
converts SCSS or Sass files to CSS using either the
'sass' gem
or the scssphp package.
Table C.94: Attributes
Name | Type | Description | Default | Required |
---|---|---|---|---|
check | Boolean | Whether to just check the syntax of the input files. | False | No |
compact | Boolean | Set the style to compact. | False | No |
compressed | Boolean | Set the style to compressed. | False | No |
crunched | Boolean | Set the style to crunched. Supported by scssphp, not sass. | False | No |
expand | Boolean | Set the style to expanded. | False | No |
encoding | String | Default encoding for input files. Supported by scssphp. | utf-8 | No |
executable | String | Location/name of the sass executable, if required. | sass | No |
extfilter | String | Extension to filter against. | n/a | No |
failonerror | Boolean | Whether to fail/halt if an error occurs. | False | No |
file | String | Name of single file to process. | N/A | No |
flags | String | Additional flags to set for sass executable. | n/a | No |
input | String | Name of single file to process. Synonym for file. | N/A | No |
keepsubdirectories | Boolean | Whether to keep the directory structure when compiling. | True | No |
linenumbers | Boolean | Whether to annotate generated CSS with source file and line numbers. | False | No |
nested | Boolean | Set the style to expanded. | true | No |
newext | String | Extension for newly created files. | css | No |
nocache | Boolean | Whether to cache parsed sass files. | n/a | No |
output | String | Corresponding 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/A | No |
outputpath | String | Where to place the generated CSS files. | n/a | Yes |
path | String | Specify sass import path. e.g. --load-path ... | n/a | No |
removeoldext | Boolean | Whether to strip existing extension off the output filename. | True | No |
style | String | Name 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. | nested | No |
trace | Boolean | Whether to show a full stack trace on error. | False | No |
unixnewlines | Boolean | Use Unix-style newlines in written files. | True | No |
useSass | Boolean | Whether to use the 'sass' command line tool. Takes precedence over scssphp if both are available and enabled. | True | No |
useScssphp | Boolean | Whether to use the 'scssphp' PHP package. | True | No |
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.
<sass style="compact" trace="yes" unixnewlines="yes" outputpath="${compiled.dir.resolved}"> <fileset dir="."/> </sass>