dart_sass_transformer 0.5.0+1

  • README.md
  • Installing
  • Versions
  • 86

Build Status

Sass integration for pub

Sass-transformer for pub-serve and pub-build.


Simply add the following lines to your pubspec.yaml:

  dart_sass_transformer: any
  - dart_sass_transformer

After adding the transformer your .sass and .scss files will be automatically transformed to corresponding .css files.

You need to have Sass installed and available on the path.


You can also pass options to Sass if necessary:

  - dart_sass_transformer:
      executable: /path/to/sass     # Sass executable to use
      compass: true                 # Include compass
      line-numbers: true            # Include line numbers in output
      style: compact                # Style of generated CSS
      copy-sources: true            # Copy original .scss/.sass files to output directory

Using SassC

You can use SassC instead of normal Sass by specifying executable as 'sassc' (or any path ending with 'sassc'):

  - dart_sass_transformer:
      executable: sassc  # or /path/to/sassc

SassC only supports .scss-files and does not support Compass.

Inlined transformer

Normally the transformer simply asks Sass to process the primary input files and Sass will then read the dependent inputs from file system. However, if the input files for Sass are themselves produced by other transformers, they might not exist on the file system at all. The normal transformer will not work in those cases.

To work around this problem, you can use inlined_sass_transformer. It will use Barback's APIs to read and inline all imports into one big Sass file which it will then pass to Sass. The downside is that line numbers on error messages and source maps might be incorrect. (See Issue #4 for details.)

To enable the use of inlined transformer, use sass/inlined_sass_transformer as your transformer:

  - dart_sass_transformer/inlined_sass_transformer
      <possible configuration settings>

Current limitations

  • UTF8-encoding is assumed for all input files.

v0.5.0+1 (2016-10-16)

  • Package name changed from sass to dart_sass_transformer

v0.4.2 (2014-11-03)

  • Fixed files over 1024 bytes getting truncated on Windows. (#19) (Thanks to Alexander Sergeev.)
  • Normalize the load paths to platform's native format. (Thanks to llamadonica.)

v0.4.1 (2014-10-09)

  • Filter out external packages when resolving imports. (#12) (Thanks to Konstantin Borisov.)

v0.4.0 (2014-09-22)

  • Support for new inlined_sass_transformer. (#4) (Thanks to Dan Schultz.)
  • Require Barback 0.15.x.

v0.3.2 (2014-09-17)

  • Support Barback 0.15.x.

v0.3.1 (2014-06-24)

  • Use sass.bat as default executable on Windows. (#10) (Thanks to Nicholas Tuck.)

v0.3.0 (2014-05-25)

  • Breaking change: don't copy source .scss/.sass files to build directory by default. Use copy-sources: true to keep the old behavior. (#7)
  • Support imports with directory names. (#8)

v0.2.2 (2014-05-23)

  • Require Barback 0.13.x.
  • Fixed DeclaringTransformer on Barback 0.13.x.

v0.2.1 (2014-05-15)

  • Implemented DeclaringTransformer interface so Barback can optimize the asset graph.
  • Compatibility with Barback 0.13.x.

v0.2.0 (2014-05-15)

  • Exclude URL-imports when parsing imports. (Thanks to Vikraman Choudhury.)

v0.1.1 (2014-04-24)

  • Ignore Compass imports when reading the dependencies of a module. (Thanks to Dan Schultz.)

v0.1.0 (2014-04-19)

  • Support using SassC instead of vanilla Sass.

1. Depend on it

Add this to your package's pubspec.yaml file:

  dart_sass_transformer: "^0.5.0+1"

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter packages get

Alternatively, your editor might support pub get or packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:dart_sass_transformer/inlined_sass_transformer.dart';

import 'package:dart_sass_transformer/sass.dart';

import 'package:dart_sass_transformer/transformer.dart';
Version Uploaded Documentation Archive
0.5.0+1 Oct 19, 2016 Go to the documentation of dart_sass_transformer 0.5.0+1 Download dart_sass_transformer 0.5.0+1 archive


This feature is new.
We welcome feedback.
More details: scoring.

We analyzed this package, and provided a score, details, and suggestions below.

  • completed on Jan 21, 2018
  • Dart: 2.0.0-dev.15.0
  • pana: 0.10.0


Describes how popular the package is relative to other packages. [more]
85 / 100
Code health derived from static analysis. [more]
97 / 100
Reflects how tidy and up-to-date the package is. [more]
74 / 100
Overall score:
Weighted score of the above. [more]


Detected platforms: Flutter, other

Multiple platform identified in libraries.


  • The description is too short.

    Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

  • Maintain an example.

    Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use dart_sass_transformer.dart.


Package Constraint Resolved Available
Direct dependencies
barback >=0.15.0 <0.16.0 0.15.2+14
utf >=0.9.0 <0.9.1 0.9.0+3
Transitive dependencies
async 2.0.3
charcode 1.1.1
collection 1.14.5
path 1.5.1
pool 1.3.4
source_span 1.4.0
stack_trace 1.9.1
Dev dependencies
mock >=0.11.0 <0.13.0
test >=0.12.0 <0.13.0