sass_var_transformer 0.3.0

SASS Var Transformer #

Replaces vars in SCSS files with package path and compiles it to .css files

It depends on dart-sass, so there is no need to have Sass installed.

Usage #

Add the following lines to your pubspec.yaml:

  # Only for demonstration!!!!
  mdl: ^1.18.0

  # This is important
  sass_var_transformer: any
  - di
  # And this
  - sass_var_transformer:
      # Converts @mdl to ../.pub-cache/hosted/
      mdl: package:mdl

Assume you have web/material.scss:

@import "@mdl/assets/themes/deep_purple-pink/material-design-lite";

Add this line to your index.html:

    <link rel="stylesheet" href="material.css">

If you run pub serve:

  • The Transformer reads the SCSS-File

  • @mdl will be replaced with the path to your local mdl-package
    e.g. @import "<your user>/.pub-cache/hosted/<version from pubspec>/lib/assets/themes/deep_purple-pink/material-design-lite";

  • SCSS-File will be compiled to .CSS

Check out this sample: GH MDL Text-Only
The sample uses a mixture between Global-Package-Style and Styles for local components!

License #

Copyright 2017 Michael Mitterer (,
IT-Consulting and Development Limited, Austrian Branch

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
either express or implied. See the License for the specific language
governing permissions and limitations under the License.

If this plugin is helpful for you - please (Circle) me or star this repo here on GitHub

Change Log for sass_var_transformer #

Transformer that changes vars in SASS-Files

v0.3.0 - 2017-02-28

Feature #

  • String-Rendering-Function added ac71d9b

v0.2.0 - 2017-02-28

Feature #

  • Works also with local packages and package internal styles 5e46329

This was generated with Changelog for Dart

Use this package as a library

1. Depend on it

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

  sass_var_transformer: ^0.3.0

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_var_transformer/sass_var_transformer.dart';
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.19.0 <2.0.0