csscomb.js icon indicating copy to clipboard operation
csscomb.js copied to clipboard

LESS mixins and CSS guards implementation

Open matthieupetel opened this issue 8 years ago • 1 comments

Using LESS, it seems that writing mixins and css guards (the when / when not keywords, as described in the documentation here) causes a warning about code validity.

Example of code used :

.class {
  // CSS guard
  & when (@variable1 = @variable2) {
    // ... Properties here...
  }
}

The CSSComb output :

(node:22244) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Parsing error: Assets/less/imports/file.less
Please check validity of the block starting from line #35
CSScomb Core version: 4.2.0

33 |     .class {
34 |       // CSS guard
35*|       & when (@variable1 = @variable2) {
36 |          // ... Properties here...
37 |       }

Syntax: less
Gonzales PE version: 3.4.7

The same error occurs when using when not keyword, either in mixin guard or css guard.

Could it be possible to implement these useful LESS features ?

npm version : 5.5.1 CSSComb version : 4.2.0

matthieupetel avatar Nov 02 '17 10:11 matthieupetel

Looks like gpe is missing support for when and when not in LESS.

jdalton avatar May 07 '19 06:05 jdalton