Kronuz/pyScss

@import re-orders file contents

longhotsummer opened this issue · 2 comments

When pyscss encounters an @import statement, it seems to process them after all other lines in the file.

Here are two files:

outer.scss

outer {color: green}
@import 'inner';
outer2 {color: red;}

_inner.scss

inner {color: blue;}

When running pyscss outer.scss I get:

outer{color:green}outer2{color:red}
inner{color:blue}

When running sass outer.scss I get:

outer {
  color: green; }

inner {
  color: blue; }

outer2 {
  color: red; }

I'm using PySCSS version v1.3.4 (20141215).

I would expect that pyscss would pull in the content of _inner.scss at the point where the @import appears, not at the end of the file. What gives?

Any thoughts here? This seems very weird.

eevee commented

Seemed to be due to some old code that was sorting rules in order of the file they came from, just for the sake of printing out how many rules came from each file. I didn't think that was particularly useful, so I nuked it, which fixed this.

I've released 1.3.5 to PyPI.