sass_transformer 0.1.2+1

  • Installing
  • Versions
  • 7

DEPRECATED - use grind sass task instead

Build Status

Sass integration for pub #

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

Usage #

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

Configuration #

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

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_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
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.

The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.

Analysis issues and suggestions

Support Dart 2 in pubspec.yaml.

The SDK constraint in pubspec.yaml doesn't allow the Dart 2.0.0 release. For information about upgrading it to be Dart 2 compatible, please see

Maintenance issues and suggestions

Make sure dartdoc successfully runs on your package's source files. (-10 points)

Dependencies were not resolved.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.12.0 <2.0.0