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

@at-root, and & selector works in Dart, but not scssphp #634

Open
EffakT opened this issue Dec 15, 2022 · 1 comment
Open

@at-root, and & selector works in Dart, but not scssphp #634

EffakT opened this issue Dec 15, 2022 · 1 comment
Labels
bug Something isn't working spec compliance Issues with compliance to the Sass spec
Milestone

Comments

@EffakT
Copy link

EffakT commented Dec 15, 2022

Given the following code.

.material-design_wrapper {
  @at-root {
    #{str-replace(unquote("#{selector_append(&)}"), "_wrapper", "")} {
      &.gform_confirmation_wrapper {
        background-color: red;
        width: 200px;
        height: 50px;
      }
    }
  }
  .gform_confirmation_wrapper {
    background-color: red;
    width: 200px;
    height: 50px;
  }
}

This will successfully compile in Dart, but will return an error in scssphp
"$selector: expected more input, invalid selector.:

Current workaround works:

.material-design_wrapper {
  $c: #{&}
  @at-root {
    #{str-replace(unquote("#{selector_append($c)}"), "_wrapper", "")} {
      &.gform_confirmation_wrapper {
        background-color: red;
        width: 200px;
        height: 50px;
      }
    }
  }
  .gform_confirmation_wrapper {
    background-color: red;
    width: 200px;
    height: 50px;
  }
}

Should output:

.material-design.gform_confirmation_wrapper {
  background-color: red;
  width: 200px;
  height: 50px;
}
.material-design_wrapper .gform_confirmation_wrapper {
  background-color: red;
  width: 200px;
  height: 50px;
}
@stof stof added this to the 2.0 milestone Dec 16, 2022
@stof stof added bug Something isn't working spec compliance Issues with compliance to the Sass spec labels Dec 16, 2022
@stof
Copy link
Member

stof commented Dec 16, 2022

This is kinda related to #512

This is part of our spec compliance issues that are very hard to fix in 1.x due to our weird handling of selectors. So I'm adding this to the 2.0 milestone.

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

2 participants