sass_transformer 0.1.2+1

  • Installing
  • Versions
  • 61

DEPRECATED - use grind sass task instead

Build Status

Sass integration for pub

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


1. Install Sass and add it to your path.

2. Add the following lines to your pubspec.yaml:

  sass_transformer: any
  - sass_transformer

After adding the transformer, all your .sass and .scss files that don't begin with _ will be automatically transformed to corresponding .css files.

If your main file imports other files outside the main files folder, you need to add the option include_paths, to let sass know which folder will be used for processing outside imports:

  sass_transformer: any
  - sass_transformer:
      include_paths: path/to/folder/with/other/scss

you can have multiple include_paths:

  sass_transformer: any
  - sass_transformer:
        - path/to/folder/with/other/scss1
        - path/to/folder/with/other/scss2

By using pub serve during development, css files are going to live in memory only. Executing pub build creates actual css files in build folder

3. Finally in the html files you only need to import the generated css files:

<!DOCTYPE html>
<html lang="en">
    <link rel="stylesheet" href="path/to/main.css">
    <!-- content goes hear -->


You can also pass options to Sass if necessary:

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

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

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

Current limitations

  • UTF8-encoding is assumed for all input files.

v0.1.2 (2016-08-31)

  • Correct bug caused by transformer run in debug mode
  • Change TransformerOptions.parse to TransformerOptions constructor

v0.1.1 (2016-08-26)

  • Correct lib path replacement. If primary asset path was lib/ without sub folder was not processed correctly.
  • Correct logging to sass_transformer instead dart-sass

v0.1.0+1 (2016-08-25)

  • Correct code to process all primary files

v0.1.0 (2016-08-25)

  • First Release

Use this package as a library

1. Depend on it

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

  sass_transformer: "^0.1.2+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 flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

      import 'package:sass_transformer/sass.dart';

      import 'package:sass_transformer/transformer.dart';
Version Uploaded Documentation Archive
0.1.2+1 Dec 2, 2016 Go to the documentation of sass_transformer 0.1.2+1 Download sass_transformer 0.1.2+1 archive
0.1.2 Sep 1, 2016 Go to the documentation of sass_transformer 0.1.2 Download sass_transformer 0.1.2 archive
0.1.1 Aug 27, 2016 Go to the documentation of sass_transformer 0.1.1 Download sass_transformer 0.1.1 archive
0.1.0+1 Aug 26, 2016 Go to the documentation of sass_transformer 0.1.0+1 Download sass_transformer 0.1.0+1 archive
0.1.0 Aug 26, 2016 Go to the documentation of sass_transformer 0.1.0 Download sass_transformer 0.1.0 archive


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

  • Dart: 2.0.0-dev.60.0
  • pana: 0.11.3


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


Detected platforms: Flutter, other

Platform components identified in package: build, io.


  • Package is getting outdated.

    The package was released 79 weeks ago.

  • 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 sass_transformer.dart.

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 3 hints.

    Run dartfmt to format lib/sass.dart.

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

    Similar analysis of the following files failed:

    • lib/transformer.dart (hint)


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.12.0 <2.0.0
barback ^0.15.0 0.15.2+16
utf ^0.9.0 0.9.0+4
Transitive dependencies
async 2.0.7
charcode 1.1.1
collection 1.14.10
path 1.6.0
pool 1.3.5
source_span 1.4.0
stack_trace 1.9.2
Dev dependencies
test ^0.12.0