Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Problems with @at-root #706

Open
shahroq opened this issue Mar 6, 2024 · 2 comments
Open

Problems with @at-root #706

shahroq opened this issue Mar 6, 2024 · 2 comments
Labels
bug Something isn't working spec compliance Issues with compliance to the Sass spec
Milestone

Comments

@shahroq
Copy link

shahroq commented Mar 6, 2024

Working with this project, which extensively uses @at-root, I found some differences between the result of scssphp and SCSS compiler. This is one use-case:

.container {
  @at-root body#{&} {
     #logo { 
      border: 1px solid red;
    }
  }
}

The expected result, as shown here

body.container #logo {
    border: 1px solid red;
}

The scssphp result:

bodybody.container #logo {
  border: 1px solid red;
}
@stof stof added this to the 2.0 milestone Mar 12, 2024
@stof stof added bug Something isn't working spec compliance Issues with compliance to the Sass spec labels Mar 12, 2024
@stof
Copy link
Member

stof commented Mar 12, 2024

I'm adding that to the 2.0 milestone because our messy implementation of @at-root, selector manipulation and nesting in 1.x would require a lot of work to fix it (if even possible).

@zoglo
Copy link

zoglo commented May 2, 2024

Same issue as in sass and more of a limitation: sass/sass#2135

You could try

.container {
  @at-root #{selector-append('body', &)} {
     #logo { 
      border: 1px solid red;
    }
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working spec compliance Issues with compliance to the Sass spec
Projects
None yet
Development

No branches or pull requests

3 participants