Kronuz / pyScss

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

`@charset` sometimes output without a semicolon #251

Closed eevee closed 8 years ago

eevee commented 11 years ago

Which makes the next rule invalid.

I can't find a minimal case but it happened to Yelp's CSS.

ryneeverett commented 11 years ago

I'm have an issue with @charset which may or may not be related. The semicolon is included in output, but @charset breaks the import order.

Using the import example from the SASS guide:

@charset "utf-8";
/* _reset.scss */

html,
body,
ul,
ol {
  margin:  0;
  padding: 0;
}
/* base.scss */

@import 'reset';

body {
  font-size: 100% Helvetica, sans-serif;
  background-color: #efefef;
}

When @charset is omitted, pyScss correctly renders:

html,body,ul,ol{margin:0;padding:0}body{font-size:100% Helvetica,sans-serif;background-color:#efefef}

But with @charset included, it renders the import out of order:

@charset "utf-8";body{font-size:100% Helvetica,sans-serif;background-color:#efefef}html,body,ul,ol{margin:0;padding:0}
eevee commented 8 years ago

I think this is fixed now, or at least, there was another reproducible ticket and it stopped being reproducible between 1.3.4 and 1.3.5. The @import issue above should be fixed in 1.3.5 as well. It might've been the same fix, come to think of it.