Lorax
Lorax

Reputation: 231

Is Dart integrated with SASS?

After finally becoming more intimate with AngularDart (2.0), I decided to throw SASS into the relationship. It appears the SASS devs are also coming over to Dart SASS to Dart (two months ago).

Knowing that, the @Component( styleUrls: 'style.sass') doesn't appear to recognize the .sass or .scss extensions. Is there any knowledge or update on a timeline or expectancy to compatibility? Hell, maybe even a Dart pub for SASS (I feel like the latter might be here, but I glossed over it).

Upvotes: 2

Views: 1095

Answers (1)

Günter Zöchbauer
Günter Zöchbauer

Reputation: 657308

Dart 2 In Dart 2 with build_runner just add

dev_dependencies:
  sass_builder: ^1.1.2

to pubspec.yaml

Dart 1

Use instead

@Component( styleUrls: 'style.css')

and add a sass transformer to your pubspec.yaml

https://pub.dartlang.org/packages/dart_sass_transformer

dependencies:
  dart_sass_transformer: ^0.5.0
transformers:
  - dart_sass_transformer:

then style.sass or style.scss will automatically be transformed to style.css and made available to Angular components

You need to run pub get --packages-dir until https://github.com/sass/dart-sass/pull/53 becomes available.

Upvotes: 2

Related Questions