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

extend(&) #3450

Closed
nexcode opened this issue Nov 11, 2019 · 2 comments
Closed

extend(&) #3450

nexcode opened this issue Nov 11, 2019 · 2 comments

Comments

@nexcode
Copy link

nexcode commented Nov 11, 2019

.header {
    &__links-item {
        display: flex;
        justify-content: center;
        align-items: center;
        height: 28px;

        &--icon:extend(&) {
            width: 28px;
        }
    }
}

output:

.header__links-item {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 28px;
}
.header__links-item--icon {
  width: 28px;
}

I expected this:

.header__links-item--icon,
.header__links-item {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 28px;
}
.header__links-item--icon {
  width: 28px;
}

Is it possible to achieve such a result somehow?

@seven-phases-max
Copy link
Member

No. Extend does not support anything but plain CSS selectors.
The best you can do now is something like:

.header {
    &__links-item {
        &, &--icon {
            display: flex;
            justify-content: center;
            align-items: center;
            height: 28px;
        }

        &--icon {
            width: 28px;
        }
    }
}

@seven-phases-max
Copy link
Member

Closing as (an edge case) duplicate of #1485.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants