Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lessc file ordering problems #16

Open
ahamid opened this issue Dec 29, 2011 · 4 comments
Open

lessc file ordering problems #16

ahamid opened this issue Dec 29, 2011 · 4 comments

Comments

@ahamid
Copy link

ahamid commented Dec 29, 2011

If I invoke lessc with one order of files, the second file content is not included in the output. If i flip the order then both file contents are included:

[aaron@msi-cr620 andreas-2]$ lessc crossroads.less pivotx_light.less  | grep header
.header_content{width:460px;}
.header_content h1{border-top:0px;}
.header_content h1 *{width:460px;}
#header{height:180px;background:#495170 url(images/header_light.jpg);}
[aaron@msi-cr620 andreas-2]$ lessc pivotx_light.less crossroads.less | grep header
#header{height:180px;background:#495170 url(images/header_light.jpg);}

the missing lines are not present in pivotx_light.less, so I think that rules out weird inheritance interactions.

@ahamid
Copy link
Author

ahamid commented Dec 29, 2011

a similar issue was occurring with @import, namely a trailing @import statement was not including file content. assuming perhaps @import only worked for importing mixins and variables, I fell back to direct file ordering as above.

@ahamid
Copy link
Author

ahamid commented Dec 29, 2011

I narrowed it down to a syntax error that was masked:

[aaron@msi-cr620 andreas-2]$ cat bad.less 
.ok {
  font-size: large;
}

.bad {
  height: 10px;;
}
[aaron@msi-cr620 andreas-2]$ cat good.less 
.good {
  width: 10px;
}
[aaron@msi-cr620 andreas-2]$ lessc good.less bad.less
.good{width:10px;}
.ok{font-size:large;}
[aaron@msi-cr620 andreas-2]$ lessc bad.less good.less 
.ok{font-size:large;}
[aaron@msi-cr620 andreas-2]$ 

errors from V8 don't make it out of this method:

# Convert `less` source into a abstract syntaxt tree
# @param [String] less the source to parse
# @return [Less::Tree] the parsed tree
def parse(less)
  calljs do
    error,tree = nil
    @parser.parse(less, lambda {|e, t|
      error = e; tree = t
    })
    Tree.new(tree) if tree
  end
end

@ahamid
Copy link
Author

ahamid commented Dec 29, 2011

this also solved the previous issue with @import'ing the second file which makes sense since nothing after the syntax error was getting parsed and rendered.

@cowboyd
Copy link
Owner

cowboyd commented Jan 3, 2012

Would you suggest that it raise an error?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants