in19farkt / css-to-jss

VS Code extension for converting CSS rules to JSS format
https://marketplace.visualstudio.com/items?itemName=infarkt.css-to-jss
15 stars 3 forks source link

If there is no trailing comma then the last style is not converted from jss-to-css #3

Closed sambhav-gore closed 5 years ago

sambhav-gore commented 5 years ago

First of all many thanks for creating this. I just now found this and I am sure this is going to be a big helper. I constantly find myself copying styles from web tools and manually converting to jss syntax.

Now I have a minor bug to report:

If I don't have a trailing comma in jss after the last style then the last style is not converted to css. For example following is the jss:

wrapper: {
    display: "flex",
    paddingTop: 10,
    marginTop: 20
  }

And this results in following css after conversion:

wrapper: {
    display: flex;
    padding-top: 10px;
    marginTop: 20
  }

See the last property is not change. Adding a trailing comma results in last property converting as well.

Similarly when going from CSS to JSS it always adds a trailing comma.

in19farkt commented 5 years ago

Thanks for this issue. This happens because the comma and semicolon defines the format of the string (CSS or JSS). I'll think about how to fix it.

in19farkt commented 5 years ago

Fixed in 1.0.6

sambhav-gore commented 5 years ago

Wow, Thanks for super quick fix and release of this.