Skip to content

Instantly share code, notes, and snippets.

@vio
Last active October 2, 2015 13:30
Show Gist options
  • Save vio/d82d3e63ed3ea26d9203 to your computer and use it in GitHub Desktop.
Save vio/d82d3e63ed3ea26d9203 to your computer and use it in GitHub Desktop.

Since 0.45.0, stylus is not throwing errors when the top parent selector is indented.

In 0.44.0

  .element
    color: #fff

Is throwing an error:

{ [ParseError: stylus:1
 > 1|   .element
   2|     color: #fff
   3|

unexpected "space"
]
  name: 'ParseError',
  message: 'stylus:1\n > 1|   .element\n   2|     color: #fff\n   3| \n\nunexpected "space"\n' 
}

In 0.52.4, is compiled to:

.element {
    color: #fff;
}

That's valid, but when there is a wrong indented comment before, the source is producing unexpected output without throwing an error:

.element
  .child-1
    color: #fff

// wrong indent
  .child-2
    color: #fff
.element .child-1 {
    color: #fff;
}
.child-2 {
    color: #fff;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment