Kronuz / pyScss

pyScss, a Scss compiler for Python
MIT License
582 stars 141 forks source link

Wrong output when using variable as selector #238

Closed antonpirker closed 11 years ago

antonpirker commented 11 years ago

I am trying to compile bourbon.io with pyScss and get a wrong output. The problem is with using the $all-text-inputs variable defined here https://github.com/thoughtbot/bourbon/blob/master/dist/addons/_html5-input-types.scss?source=cc as selector like this:

#{$all-text-inputs} {
    float: left;
}

I have made a little test.scss for demonstration purposes:

$inputs-list: 'input[type="email"]',
              'input[type="number"]';

$unquoted-inputs-list: ();
@each $input-type in $inputs-list {
  $unquoted-inputs-list: append($unquoted-inputs-list, unquote($input-type), comma);
}

$all-text-inputs: $unquoted-inputs-list;

#{$all-text-inputs} {
    float: left;
}

Here are the outputs of Sass and pyScss:

Sass

$ sass test.scss 
input[type="email"], input[type="number"] {
  float: left; }

PyScss

$ pyscss test.scss 
(), input[type="email"],input[type="number"]{float:left}

Notice the (),! Is this a problem with Bourbon or with pyScss?

eevee commented 11 years ago

This is a pyScss shortcoming: the empty list syntax () isn't implemented and is being treated as an opaque token.

This is tracked in #166 but unfortunately, since it involves parsing changes, I don't think it'll get fixed til 1.3. Which should at least not take as long as 1.2 did. :)