Closed twhoff closed 9 years ago
Thank you for the report, I will do bugfixing soon.
Just released 1.12.0 version should have this fixed. If it is not, please re-open the issue.
I think this doesn't work if it's on the top level of the less file. The example code from http://lesscss.org/features/#css-guards-feature:
& when (@my-option = true) {
button {
color: white;
}
a {
color: blue;
}
}
throws the following error:
Appender symbol is not allowed inside top level rulesets.
Hi,
That's correct, Less doesn't allow then appended symbol in the root of the document as far as I know.
This isn't always ideal as sometimes it's nice to use for scoping when sharing mixins which run at the root across multiple files.
Thanks for your great work with this compiler!
Thomas
On 23 Jun 2015, at 8:58 am, CptS notifications@github.com wrote:
I think this doesn't work if it's on the top level of the less file. The example code from http://lesscss.org/features/#css-guards-feature:
& when (@my-option = true) { button { color: white; } a { color: blue; } } throws the following error:
Appender symbol is not allowed inside top level rulesets. — Reply to this email directly or view it on GitHub.
It's allowed by Less (see http://jsfiddle.net/qb5t3zbr/) but not by less4j.
We're using a theme which is delivered as css and less version. We want to use the less version but thats sadly impossible with less4j.
Because of the AST implementation?
I guess it’s a shame but there are also workarounds for it, although not ideal!
Nothing is impossible ;)
On 23 Jun 2015, at 09:45, CptS notifications@github.com wrote:
It's allowed by Less (see http://jsfiddle.net/qb5t3zbr/ http://jsfiddle.net/qb5t3zbr/) but not by less4j.
We're using a theme which is delivered as css and less version. We want to use the less version but thats sadly impossible with less4j.
— Reply to this email directly or view it on GitHub https://github.com/SomMeri/less4j/issues/283#issuecomment-114394458.
@CptS @EightDJ I opened new issue #286 for top level appender and the fix is already on master branch.
Unfortunately, I will not be able to do release for next week and half. If you are comfortable compiling and using latest head, then you can use that before I do proper release.
Great! Thanks very much :)
On 25 Jun 2015, at 14:33, Mária Jurčovičová notifications@github.com wrote:
@CptS https://github.com/CptS @EightDJ https://github.com/EightDJ I opened new issue #286 https://github.com/SomMeri/less4j/issues/286 for top level appender and the fix is already on master branch.
Unfortunately, I will not be able to do release for next week and half. If you are comfortable compiling and using latest head, then you can use that before I do proper release.
— Reply to this email directly or view it on GitHub https://github.com/SomMeri/less4j/issues/283#issuecomment-115235254.
Yeah! Thank you! :)
Somewhere between 1.9.0 and 1.11.0 the "& when" appears to have stopped working: