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 @extend rules in the same block don't process the second @extend correctly #10

Open
jzarzeckis opened this issue Jan 24, 2020 · 5 comments

Comments

@jzarzeckis
Copy link

%foo {
  right: 0;
}

%bar {
  left: 0;
}

.baz {
  @extend %foo;
  @extend %bar;
}

Worked in 2.0.0, but doesn't generate correctly on 3.0.0.

@gnimmelf
Copy link

gnimmelf commented Feb 28, 2020

No nagging, but I had a go at this, and it's way above my head =/ so I hope someone else sees the need for this in the near future and has a go at it.

Cheers!

Edit: I made a pull request and now my wife is not happy for me spending the evening at it.

@kongxiangyan
Copy link

@jzarzeckis @gnimmelf Just use @extend like this:

%foo {
  right: 0;
}

%bar {
  left: 0;
}

.baz {
  @extend %foo, %bar;
}

And by the way, you can only use @extend at your first line of rules, following is not allowed:

%foo {
  right: 0;
}

%bar {
  left: 0;
}

.baz {
  top: 0;
  @extend %foo, %bar;
}

@gnimmelf
Copy link

gnimmelf commented Mar 3, 2020

@kongxiangyan where were you a week ago? Anyway, much appreciated, so thanks.

@jonathantneal The @extend draft is still a bit lacking, so I'll leave the PR for you to decide.

@hitendra-ap
Copy link

Hello @gnimmelf , @kongxiangyan, @jonathantneal

Thanks for the discussion above. It was really helpful.

But do you know @extend rule does not work for child classes.

For example :-

%foo {
  right: 0;
}

%bar {
  left: 0;
}

.baz {
    .child {
        @extend %foo, %bar;
    }
}

.baz > .child css class does not have foo and bar css props

@hitendra-ap
Copy link

Ah, after spending time on debugging.
I found that the above issue^ is fixed in 4.0.0v.
Thanks

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

4 participants