zero_coding zero_coding - 23 days ago 22
Dart Question

Using sass with angular2dart

How can I use https://github.com/sass/dart-sass with angular2dart.
For example, I have following component:

@Component(
selector: 'start-app',
directives: const[MaterialInputComponent],
styleUrls: const ['login_component.css'],
templateUrl: 'login_component.html')


Now instead of css, I would like to use sass.

Answer

I don't think there is an easy way currently, because there is no transformer. What you can do is build some watcher or script file that searches all files and compiles them to CSS. You can for example use https://github.com/dart-lang/build but it requires some development. It won't do anything out-of-the-box

I'd suggest using https://pub.dartlang.org/packages/dart_sass_transformer until tooling is available.

Comments