postcss / postcss-url

PostCSS plugin to rebase url(), inline or copy asset.
MIT License
377 stars 59 forks source link

dir.file incorrect when stacking multiple backgrounds #96

Closed kevinkace closed 7 years ago

kevinkace commented 7 years ago

Using postcssUrl({ url : (asset, dir) => {} });

This works:

/* ./public/css/index.css */
div {
    background: url(./img/bg.jpg);
}
// dir
{
    from: '.',
    to: '.',
    file: 'd:\\app\public\css'
}

This does not:

/* ./public/css/index.css */
div {
    background: url(./img/bg.jpg), linear-gradient(to right, red 0%, black 100%);
}
// dir
{
    from: '.',
    to: '.',
    file: 'd:\\app\public'
}

Expected: same as single BG.

kevinkace commented 7 years ago

My mistake, related to other build things 😶