I am building a project with Angular Dart (My first serious one). I am familiar with SCSS and have used it in other 'normal' non-angular non-dart related projects. However, SCSS in AngularDart behaves way differently than I'm used to, and it's leaving me a little confused.
The thing I'm struggling with right now is how to import partials. In 'normal' scss I would do something like this to import _mixins.scss
:
@import 'mixins';
In my angular dart project, I tried doing something similar. The mixin file I created was one directory up so I tried this:
@import '../mixins';
That didn't work. The exact error message was Error: Can't find stylesheet to import.
. So, I googled a bit and came up with this:
@import '/src/components/widgets/mixins';
No luck. It told me that only "package" and "asset" schemes supported
. So I tried this:
@import 'package:dbClient/src/components/widgets/mixins';
And it proceeded to tell me "package:" URLs aren't supported on this platform.
I've never seen an asset
URL and am not sure what that even is, but I tried this anyway:
@import 'asset:dbClient/src/components/widgets/mixins';
Which brought me right back to Error: Can't find stylesheet to import.
So, I did some more googling, and ended up moving my scss partial file from lib/src/widgets/
to a new folder I called lib/assets/scss/
. However, I still can't seem to figure out how to import it into my component's scss file.
To sum it up, how do you create an scss partial file an import it into a component's scss file? Also, where do you put it?
(Also tangentially related but less concerning at the moment, what would you recommend as the best way to create global rules that apply to all components?)
Thanks in advance for anyone that can help!