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

Using ampersand (&) to select only the provided parent string and not the whole concatenated parent #2909

Closed
aleksander351 opened this issue Sep 22, 2020 · 1 comment

Comments

@aleksander351
Copy link

My SCSS:

.block {
    margin: 2px;

    & &__element {
        margin: 3px;
              
        &-nested {
            margin: 4px;
        }
    }
}

The desired output:

.block {
  margin: 2px;
}

.block .block__element {
  margin: 3px;
}

.block .block__element .block__element-nested {
  margin: 4px;
}

Obviously, the & selector copies the whole parent when applying to a child. But could there be a way to combine the child name with only the provided direct parent?

@Awjin
Copy link
Contributor

Awjin commented Sep 23, 2020

This is a great question for the Sass StackOverflow community! We try to keep this issue tracker focused on bugs and feature requests that need the core team's attention in particular, while requests for support are usually better handled by the community at large.

@Awjin Awjin closed this as completed Sep 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants