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

Variable interpolation not working for multiple classes in :not

Open alanyinjs opened this issue 6 years ago • 3 comments

  • div:not(.class-a, .class-b, .class-c){} is supported in less
  • div:not(.@{some-variale}-class) is also supported in less However:
  • div:not(.@{some-variale}-class), .@{some-other-variale}-some-class)) is not supported and gives an error

e.g.

@ant-prefix: ant;
div:not(.@{ant-prefix}-radio-wrapper, .@{ant-prefix}-checkbox-wrapper){
  color: #ffffff;
}

Error message:

Module build failed (from ./node_modules/less-loader/dist/cjs.js):


  label:not(
    .@{ant-prefix}-radio-wrapper,
                              ^
Missing closing ')'

alanyinjs avatar Jul 17 '19 02:07 alanyinjs

This has nothing to do with variables. A selector list for :not() is not supported by Less because it's not supported by most browsers. See: https://caniuse.com/#feat=css-not-sel-list

matthew-dean avatar Jul 17 '19 18:07 matthew-dean

It is supported by browsers for the past 2 years, so now is the time to bring it in LESS as well, I guess?

tophf avatar Jun 07 '23 11:06 tophf

@tophf 👍

matthew-dean avatar Jun 11 '23 21:06 matthew-dean