Is Dart integrated with SASS?
Asked Answered
D

1

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

Dissever answered 12/1, 2017 at 0:28 Comment(0)
D
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.

Dannielledannon answered 12/1, 2017 at 7:18 Comment(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.Dissever

© 2022 - 2024 — McMap. All rights reserved.