sass_transformer 0.1.2+1

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 13

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:

dependencies:
  sass_transformer: any
transformers:
  - 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:

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

you can have multiple include_paths:

dependencies:
  sass_transformer: any
transformers:
  - sass_transformer:
      include_paths:
        - 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">
<head>
    <link rel="stylesheet" href="path/to/main.css">
</head>
<body>
    <!-- content goes hear -->
</body>
</html>

Configuration

You can also pass options to Sass if necessary:

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

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


dependencies:
  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
Popularity:
Describes how popular the package is relative to other packages. [more]
27
Health:
Code health derived from static analysis. [more]
0
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
0
Overall:
Weighted score of the above. [more]
13
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.

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 https://www.dartlang.org/dart-2#migration.

Dependencies

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