egoist / egoist/rollup-plugin-postcss

Is there a way to support "@use" from sass?

Open
#304 5 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
689
Forks
210
PR merge metrics
No merged PRs in 30d

Description

I know sass is currently using dart-sass which supports "@use": https://sass-lang.com/documentation/at-rules/use

Here is my rollup configuration:

```js
postcss({
plugins: [autoprefixer()],
extract: false,
modules: true,
use: ["sass"]
})
```

But if I use this in the `scss` file
```css
@use "./vars.module";

.header {
height: vars.$size-base;
}
```
I got `(plugin postcss) Error: Invalid CSS after " height: vars": expected expression (e.g. 1px, bold), was ".$size-base;"`

It does work perfectly using `@import` but it will be [deprecated](https://github.com/sass/sass/blob/master/accepted/module-system.md#timeline)

```css
@import "./vars.module";

.header {
height: $size-base;
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.