Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Nested @layer rule lost scope #4242

Open
woody-li opened this issue Nov 1, 2023 · 1 comment · May be fixed by #4260
Open

Nested @layer rule lost scope #4242

woody-li opened this issue Nov 1, 2023 · 1 comment · May be fixed by #4260
Labels

Comments

@woody-li
Copy link

woody-li commented Nov 1, 2023

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 {
  ::before {
    color: #f00;
  }
}

Expected behavior:
Nesting selector & resolved as its scope selector.

@layer {
  .main::before {
    color: #f00;
  }
}

Environment information:

  • less version: 4.2.0
@woody-li woody-li added the bug label Nov 1, 2023
@matthew-dean
Copy link
Member

Fixed in #4260

@matthew-dean matthew-dean linked a pull request Nov 21, 2024 that will close this issue
3 tasks
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants