Open woody-li opened 11 months ago
To reproduce:
https://lesscss.org/less-preview/#eyJjb2RlIjoiLm1haW57ICBcbiAgQGxheWVye1xuICAgICY6OmJlZm9yZXtcbiAgICAgIGNvbG9yOiNmMDA7XG4gICAgfVxuICB9XG4gIEBtZWRpYSBzY3JlZW57XG4gICAgJjo6YmVmb3Jle1xuICAgICAgY29sb3I6IzBmMDtcbiAgICB9XG4gIH1cbiAgQGNvbnRhaW5lciAod2lkdGg+NDAwcHgpe1xuICAgICY6OmJlZm9yZXtcbiAgICAgIGNvbG9yOiMwMGY7XG4gICAgfVxuICB9XG59IiwiYWN0aXZlVmVyc2lvbiI6IjQuMi4wIiwibWF0aCI6InBhcmVucy1kaXZpc2lvbiIsInN0cmljdFVuaXRzIjpmYWxzZX0=
.main{ @layer{ &::before{ color:#f00; } } }
Current behavior: Nesting selector & lost in @layer. But other @ rules works well, such as @media, @container etc.
&
@layer
@media
@container
@layer { ::before { color: #f00; } }
Expected behavior: Nesting selector & resolved as its scope selector.
@layer { .main::before { color: #f00; } }
Environment information:
less
Fixed in https://github.com/less/less.js/pull/4260
To reproduce:
https://lesscss.org/less-preview/#eyJjb2RlIjoiLm1haW57ICBcbiAgQGxheWVye1xuICAgICY6OmJlZm9yZXtcbiAgICAgIGNvbG9yOiNmMDA7XG4gICAgfVxuICB9XG4gIEBtZWRpYSBzY3JlZW57XG4gICAgJjo6YmVmb3Jle1xuICAgICAgY29sb3I6IzBmMDtcbiAgICB9XG4gIH1cbiAgQGNvbnRhaW5lciAod2lkdGg+NDAwcHgpe1xuICAgICY6OmJlZm9yZXtcbiAgICAgIGNvbG9yOiMwMGY7XG4gICAgfVxuICB9XG59IiwiYWN0aXZlVmVyc2lvbiI6IjQuMi4wIiwibWF0aCI6InBhcmVucy1kaXZpc2lvbiIsInN0cmljdFVuaXRzIjpmYWxzZX0=
Current behavior: Nesting selector
&
lost in@layer
. But other @ rules works well, such as@media
,@container
etc.Expected behavior: Nesting selector
&
resolved as its scope selector.Environment information:
less
version: 4.2.0