Skip to content
This repository

Unable to include "reset.css" #790

jdmathur opened this Issue August 14, 2012 · 7 comments

4 participants

Jaiditya TJ Holowaychuk Dave Geddes ThomasWaldmann

I have imported few css files in my main.styl. The generated css code includes some of the css files except "reset.css" and another file containing only comments.

Code used to import: @import "reset.css"

CSS file generated using: stylus --include-css --compress < main.styl > ../common.css

Dave Geddes

Do you have a simple example you could zip up and post somewhere? I can take a look.

common.css is generated output using: stylus --include-css --compress < main.styl > ../common.css
and reset.css is missing from it.

Dave Geddes

Alright boss so I've found what's causing your issue. Whenever your comment ends in a colon, the next import doesn't happen.

// comment ending in a colon causes import to fail:
@import "reset.css"
// => import doesn't happen
// comments without trailing colon don't cause issue
@import "reset.css"
// => import happens

So there's your quick fix (remove trailing colons in comments), but this is definitely a bug in Stylus. Will look into the cause later.


thanks David Geddes


Hah, what a bug! :) Thanks for solving this for us (MoinMoin Wiki).

And also thanks for stylus, we like it. It's like CSS for Pythonistas somehow.

Dave Geddes


Dave Geddes geddski referenced this issue from a commit in geddski/stylus August 14, 2012
Dave Geddes fix for #790
allow trailing colon, comma etc in // comments
Dave Geddes geddski referenced this issue August 15, 2012

fix for #790 #791

Dave Geddes

I did some digging and figured out what was causing this. Stylus supports multiline for function calls:

  x = 5
, y = 10

And so the lexer removes the \n to make this possible. It was checking for /* */ comments but not // comments. I've submitted pull request #791 that fixes this issue.

TJ Holowaychuk visionmedia closed this August 15, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.