egoist / egoist/rollup-plugin-postcss

Doesn't work with postcss-simple-vars default variables option

Open
#168 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
689
Forks
210
PR merge metrics
No merged PRs in 30d

Description

Hey there, thanks for making this plugin!

I noticed an incompatibility with the [postcss-simple-vars](https://github.com/postcss/postcss-simple-vars) plugin. Specifically the option to [set default variables](https://github.com/postcss/postcss-simple-vars#variables)

`postcss.config.js`
```js
const colors = {
blue: '#056ef0'
}

module.exports = {
// ...
plugins: {
// ...
'postcss-simple-vars': {
variables: colors
},
// ...
}
}
```

^ this all works fine in webpack and I can use `$blue` in my css files. However, attempting to bundle with `rollup-plugin-postcss` produces this error:

```
(postcss plugin) Error: Undefined variable
color: $blue
^^^^^^
```

And my rollup config:

```
import postcss from 'rollup-plugin-postcss';
plugins: [
// ...
postcss({
extract: `dist/${name}.css`,
})
]
```

Any ideas on why these default variables would not be supported in `rollup-plugin-postcss`, but works fine in webpack?

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.