less.js
less.js copied to clipboard
Variable interpolation not working for multiple classes in :not
-
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 ')'
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
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 👍