Skip to content
This repository has been archived by the owner on Mar 12, 2023. It is now read-only.

backgrounfimage url path gets stripped #100

Open
schroef opened this issue Mar 5, 2020 · 1 comment
Open

backgrounfimage url path gets stripped #100

schroef opened this issue Mar 5, 2020 · 1 comment

Comments

@schroef
Copy link

schroef commented Mar 5, 2020

Describe the bug
Minifying background-image url path gets stripped when using up a couple levels
this path "../../../assets/images/" will be this after minifying "assets/images/". It also stripes quotes from the url attribute.

To Reproduce
Steps to reproduce the behavior:

  1. Open attached file
  2. Minify it
  3. Open the min version and search for "color.jpg"
  4. See the path has been striped

Expected behavior
Dont touch the paths

Screenshots
original syntax
Screen Shot 2020-03-04 at 22 28 35

Stripped syntax
Screen Shot 2020-03-04 at 22 28 51

Desktop (please complete the following information):

  • OSX
  • 10.11.6
  • Vcode 1.42.1
  • Minify 3.3.2

Test file
mbr-additional.css.zip

@olback
Copy link
Owner

olback commented Mar 5, 2020

Removal of the quotes around URLs are expected since that is the default behaviour by clean-css. This can be fixed by adding

"compatibility": {
    "properties": {
        "urlQuotes": true
    }
}

to the setting es6-css-minify.css.

The other issue you're having is that paths are getting rebased which they should not by default. Are you sure that es6-css-minify.css > rebase is set to false? It is set to false by default.

Adding the following to your .vscode/settings.json should fix both issues:

"es6-css-minify.css": {
    "rebase": false,
    "compatibility": {
         "properties": {
              "urlQuotes": true
        }
    }
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants