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

multiple nth-child selector with @extend inside only complies the first one #1729

Closed
hyunchulkwak opened this issue Nov 13, 2015 · 3 comments

Comments

@hyunchulkwak
Copy link

example

%place-to-go {
  font-size: 1em;
}

.where-i-am {
  &:nth-child(1){
    @extend %place-to-go;
  }
  &:nth-child(2){
    @extend %place-to-go;
  }
  &:nth-child(3){
    @extend %place-to-go;
  }
}

expected

.where-i-am:nth-child(1),
.where-i-am:nth-child(2),
.where-i-am:nth-child(3) {
  font-size: 1em;
}

result

.where-i-am:nth-child(1) {
  font-size: 1em;
}
@xzyfer
Copy link
Contributor

xzyfer commented Nov 13, 2015

Spec added sass/sass-spec#609

@mgreter
Copy link
Contributor

mgreter commented Nov 13, 2015

Bare bone spec would be:

%place-to-go {
  font-size: 1em;
}

:nth-child(1){
  @extend %place-to-go;
}
:nth-child(2){
  @extend %place-to-go;
}
:nth-child(3){
  @extend %place-to-go;
}

@mgreter
Copy link
Contributor

mgreter commented Nov 14, 2015

Spec test I used to check my implementation:

%place-to-go {
  font-size: 1em;
}

a::foo(1){
  @extend %place-to-go;
}
a::foo(2){
  @extend %place-to-go;
}
b::foo(1){
  @extend %place-to-go;
}
b::foo(2){
  @extend %place-to-go;
}

:bar(1){
  @extend %place-to-go;
}
:bar(2){
  @extend %place-to-go;
}
:bar(3){
  @extend %place-to-go;
}

[foo]{
  @extend %place-to-go;
}
[bar]{
  @extend %place-to-go;
}
[baz]{
  @extend %place-to-go;
}

[bar="1"]{
  @extend %place-to-go;
}
[bar="2"]{
  @extend %place-to-go;
}
[bar="3"]{
  @extend %place-to-go;
}

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

No branches or pull requests

4 participants