sass 0.4.2+2

  • Installing
  • Versions
  • 38

The name of this package was changed from

sass to dart_sass_transformer

Build Status

Sass integration for pub

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


Simply add the following lines to your pubspec.yaml:

  sass: any
  - sass

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:

  - sass:
      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'):

  - sass:
      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:

  - sass/inlined_sass_transformer
      <possible configuration settings>

Current limitations

  • UTF8-encoding is assumed for all input files.

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.

Use this package as a library

1. Depend on it

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

  sass: ^0.4.2+2

2. Install it

You can install packages from the command line:

with pub:

$ pub get

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

3. Import it

Now in your Dart code, you can use:

import 'package:sass/sass.dart';
Version Uploaded Documentation Archive
1.14.3 Oct 18, 2018 Go to the documentation of sass 1.14.3 Download sass 1.14.3 archive
1.14.2 Oct 11, 2018 Go to the documentation of sass 1.14.2 Download sass 1.14.2 archive
1.14.1 Sep 27, 2018 Go to the documentation of sass 1.14.1 Download sass 1.14.1 archive
1.14.0 Sep 19, 2018 Go to the documentation of sass 1.14.0 Download sass 1.14.0 archive
1.13.4 Sep 11, 2018 Go to the documentation of sass 1.13.4 Download sass 1.13.4 archive
1.13.3 Sep 11, 2018 Go to the documentation of sass 1.13.3 Download sass 1.13.3 archive
1.13.2 Sep 5, 2018 Go to the documentation of sass 1.13.2 Download sass 1.13.2 archive
1.13.1 Sep 1, 2018 Go to the documentation of sass 1.13.1 Download sass 1.13.1 archive
1.13.0 Aug 17, 2018 Go to the documentation of sass 1.13.0 Download sass 1.13.0 archive
1.12.0 Aug 15, 2018 Go to the documentation of sass 1.12.0 Download sass 1.12.0 archive

All 81 versions...

Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Sep 12, 2018, and provided a score, details, and suggestions below. Analysis was completed with status tool failures using:

  • Dart: 2.0.0
  • pana: 0.12.2


Detected platforms: unsure

Error(s) prevent platform classification:

Fix dependencies in pubspec.yaml.

Analysis issues and suggestions

Fix dependencies in pubspec.yaml.

Running pub upgrade failed with the following output:

ERR: The current Dart SDK version is 2.0.0.
 Because sass depends on barback >=0.6.2 which requires SDK version >=0.6.2 <2.0.0 or >=2.0.0-dev.17.0 <2.0.0, version solving failed.

Health suggestions

Format lib/inlined_sass_transformer.dart.

Run dartfmt to format lib/inlined_sass_transformer.dart.

Format lib/sass.dart.

Run dartfmt to format lib/sass.dart.

Format lib/src/base_sass_transformer.dart.

Run dartfmt to format lib/src/base_sass_transformer.dart.

Fix additional 4 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/src/inlined_sass_file.dart (Run dartfmt to format lib/src/inlined_sass_file.dart.)
  • lib/src/sass_file.dart (Run dartfmt to format lib/src/sass_file.dart.)
  • lib/src/transformer_options.dart (Run dartfmt to format lib/src/transformer_options.dart.)
  • lib/transformer.dart (Run dartfmt to format lib/transformer.dart.)

Maintenance issues and suggestions

Fix platform conflicts. (-20 points)

Error(s) prevent platform classification:

Fix dependencies in pubspec.yaml.

Add SDK constraint in pubspec.yaml. (-5 points)

For information about setting SDK constraint, please see

Package is getting outdated. (-89.86 points)

The package was released 99 weeks ago.

The description is too short. (-20 points)

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

Maintain an example. (-10 points)

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 sass.dart.