egoist / egoist/rollup-plugin-postcss

Error importing bootstrap's minified file: property "url" must be followed by a ':'

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

Description

Having this import in my code:
```
@import '~bootstrap/dist/css/bootstrap.min.css';
```

produces this error:

```
Error: property "url" must be followed by a ':'
at options.error (.../test-rollup-postcss-and-bootstrap/node_modules/node-sass/lib/index.js:290:33) {
status: 1,
file: '.../test-rollup-postcss-and-bootstrap/node_modules/bootstrap/dist/css/bootstrap.min.css',
line: 6,
column: 69384,
formatted: `Error: property "url" must be followed by a ':'\n` +
' on line 6 of node_modules/bootstrap/dist/css/bootstrap.min.css\n' +
' from line 1 of src/style.scss\n' +
'>> size:1.25rem;--bs-navbar-toggler-icon-bg:url("data:image/svg+xml,%3csvg x\n' +
' ------------------------------------------^\n',
code: 'PLUGIN_ERROR',
plugin: 'postcss',
hook: 'transform',
id: '.../test-rollup-postcss-and-bootstrap/src/style.scss',
watchFiles: [
'.../test-rollup-postcss-and-bootstrap/src/index.js',
'.../test-rollup-postcss-and-bootstrap/src/style.scss'
]
}
```

The error does not appear if we import he unminified file, like:

```
@import '~bootstrap/dist/css/bootstrap.css';
```

I have prepared the repo [test-rollup-postcss-and-bootstrap](https://github.com/afialapis/test-rollup-postcss-and-bootstrap) to test this.

Running `postcss` (and `node-sass`) on their own does not seem to produce the problem.

This is the related `css` failing (of the unminified file, `node_modules/bootstrap/dist/css/bootstrap.css`):

```css
.navbar {
...
--bs-navbar-toggler-icon-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%280, 0, 0, 0.55%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
```

Error happens, at least, on this `bootstrap` versions:
· 5.1.3
· 5.2.2

Am I missing some param to `rollup-plugin-postcss`?

Thanks!

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.