oddbird / sass-json-export

JSON exporter for Sass. Based on SassyJSON, by Kitty Giraudel.
MIT License
12 stars 4 forks source link

Fails on percentages #1

Open carljm opened 8 years ago

carljm commented 8 years ago

If you have a percentage value in Sass and you run it through sass-json-export, it outputs malformed JSON with bare percentages in it (e.g. 80%) -- that's not a valid JSON value.

Should be fixed to either output "80%" as a quoted string or 0.8 as a number, not sure which. The latter seems more "right" in terms of accurately representing the Sass value, but the former may be more practically useful in many cases?

d-asensio commented 7 years ago

I think that's fixed, or at least is not happening to me. I've tested it this way:

$aaaaaa: 35% (
        "1":        35%,
        "2":      35%,
        "3":        35%,
        "4":       35%,
        "5":        35%,
) (35% 35%) !default;

And I get this output:

[
  "35%",
  {
    "3" : "35%",
    "1" : "35%",
    "4" : "35%",
    "2" : "35%",
    "5" : "35%"
  },
  [
    "35%",
    "35%"
  ]
]