Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Node-Sass will not compile/transpile @use "module"

I´m trying to transpile/compile the following example provided by [https://sass-lang.com/documentation/at-rules/use#load-paths]

// src/_corners.scss
$radius: 3px;

@mixin rounded {
  border-radius: $radius;
}

// style.scss
@use "src/corners";

.button {
  @include corners.rounded;
  padding: 5px + corners.$radius;
}

this is the error that node-sass gives me:

{
  "status": 1,
  "file": "C:/Users/path/scss_mixins/style.scss",
  "line": 4,
  "column": 12,
  "message": "Invalid CSS after \"  @include corners\": expected \"}\", was \".rounded;\"",
  "formatted": "Error: Invalid CSS after \"  @include corners\": expected \"}\", was \".rounded;\"\n        on line 4 of style.scss\n>>   @include corners.rounded;\r\n   -----------^\n"
}

this is my cli input:

npx node-sass -o ./dist style.scss

node, npm and node-sass are all up to dates versions.

Thanks for help in advance. :)

like image 962
nukeurself Avatar asked Jan 28 '20 16:01

nukeurself


1 Answers

I have found out that node-sass based in libsass is currently not supporting the

@use "module";

feature.

I got it to work with dart´s sass for node.

like image 150
nukeurself Avatar answered Sep 25 '22 00:09

nukeurself