2

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

Lorax
  • 231
  • 2
  • 8

1 Answers1

2

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.

Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567
  • 1
    I'm not entirely sure about the downvote. The question was really about sass integration with Dart. I knew the solution to the @Component already (I was using css, transformed from scss using `sass --watch`). I'll check out the pub package and keep watching the github page. That was really what I wanted to know. – Lorax Jan 12 '17 at 19:56