ThisIsManta / stylus-supremacy

A Node.js script that helps formatting Stylus files.
https://thisismanta.github.io/stylus-supremacy
MIT License
88 stars 9 forks source link

Found unexpected commas in multiple background shorthand #12

Closed zhanziyang closed 6 years ago

zhanziyang commented 6 years ago

Hi, when writing multiple background shorthand with the / to separate background-size and background-position, stylus-supremacy adds a comma between url() and background-position.

.page
  background background url(../images/runway.png) center / 100%, url('../images/btm.png') center / cover

got formatted to

.page
  background url('../images/runway.png'), center / 100%, url('../images/btm.png'), center / cover
ThisIsManta commented 6 years ago

Pardon me, but I need to understand why you have two background in

.page
  background background url(...)

Also having two url(...) does not make sense to me.

If you write just something like the below, then it would be fine formatting with Stylus Supremacy.

.page
  background: url("https://upload.wikimedia.org/wikipedia/en/a/a9/Example.jpg") center / 100%;
zhanziyang commented 6 years ago

@ThisIsManta The first one (two background) is a typo, sorry about that.

As for multiple url(...), it is actually very useful. Check this out: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Backgrounds_and_Borders/Using_multiple_backgrounds

ThisIsManta commented 6 years ago

Thanks for clarification. Let me try fixing this.

ThisIsManta commented 6 years ago

Sorry to keep you waiting. This is fixed in version 2.6.1.

Cheers!