Deraen / less4clj

Less compiler for Clj, Lein and Boot, using Less4j
Eclipse Public License 1.0
29 stars 8 forks source link

Using "&" parent selector + Double-hyphens in a class name causes the compiler to fail #21

Open egesd opened 2 years ago

egesd commented 2 years ago

I noticed weird behaviour when naming my CSS classes with BEM-naming convention, using & and double hyphens. When naming my classes in a following way

.foo { &__bar { &--baz { } } }

the error occurs

ERROR file:/** 260:8 mismatched character 'b' expecting '>' 259: &__bar { 260: &--baz { 261:

When using the double hyphens without the "&" parent selector, it seems to be working fine.

To add: it also works with .foo__bar--baz so the problem isn't the double hyphens, but the combination of &-selector and double hyphens.

Deraen commented 2 years ago

I don't know if this has been supported in Less.js since some new versioon, but seems like less4j difference or just not implemented.

As less4j has been deprecated, this isn't going to be fixed.

https://github.com/SomMeri/less4j/wiki/Differences-Between-Less.js-and-Less4j