Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Import css3/compass from Angular Typescript

I tried to use compass from an Angular application written in TypeScript (not Javascript), but when I write the next line:

// general.scss
@import 'compass/css3';

I get the following error:

@import 'compass/css3';
^
      File to import not found or unreadable: compass/css3.

How could I install compass?

like image 950
Cequiel Avatar asked Dec 21 '17 20:12

Cequiel


2 Answers

Try importing it with this ~ as in (if you've installed compass-mixins),

@import '~compass-mixins/lib/compass/css3';
like image 80
amal Avatar answered Sep 21 '22 06:09

amal


Thanks good I found the solution. Simply install compass-mixins:

$ npm install compass-mixins

And then read it from the node_modules folder:

@import '../../../node_modules/compass-mixins/lib/compass';

It's a bit cumbersome, but it works.

update: Do not use the previous import. Use the following syntax, as described in https://stackoverflow.com/a/47932124/1704895

@import '~compass-mixins/lib/compass/css3';
like image 29
Cequiel Avatar answered Sep 18 '22 06:09

Cequiel