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 doesn't extend nested rules #159

Closed
okonet opened this issue Sep 4, 2013 · 15 comments
Closed

@extend doesn't extend nested rules #159

okonet opened this issue Sep 4, 2013 · 15 comments

Comments

@okonet
Copy link

okonet commented Sep 4, 2013

Consider following example:

.x {
    color: red;
   .y {
        color: blue;
    }
}
.z { @extends .x; }

should compile to

.x, .z { color: red; }
.x .y, .z .y { color: blue; }

but compiles to:

.x, .z { color: red; }
.x .y { color: blue; }
@akhleung
Copy link

akhleung commented Sep 4, 2013

Thanks for the report! @extend is difficult to implement fully, so I haven't been able to cover cases like these yet.

@blaise-io
Copy link

I'm encountering a similar issue with a different kind of nesting:

.x { color: red; }
.y { @extend .x; color: blue; }
.z { @extend .y; }

should compile to:

.x, .y, .z { color: red; }
.y, .z { color: blue; }

but compiles to:

.x, .y { color: red; }
.y, .z { color: blue; }

@andrewdc
Copy link

+1

@andrewdc
Copy link

I have a similar issue as @extend fails to chain properly.

 .toggle {
   position:relative;
 } 

 .toggle--switch {
    @extend .toggle;
  }

 .toggle--switch--is-off {
    @extend .toggle--switch;
  }

.toggle--switch--is-off does not inherit the position:relative; properties from its double chained parent .toggle

@opichals
Copy link

opichals commented Dec 3, 2013

After transitioning away from the ruby sass implementation I have been hit by this too. Anyone?

@killercup
Copy link

I'm still using ruby sass just because of this, too.

@kennethormandy
Copy link

@opichals @killercup There’s a bit more info in #146, #137, it’s hopefully supposed to be in before the end of the year. There’s an open bounty on it, too: https://www.bountysource.com/issues/1057456-extend-classes-wont-compile-correctly-with-both-regular-and-silent-selectors/bounties

@akhleung
Copy link

akhleung commented Dec 4, 2013

Currently working on making @extend do the right thing. It's a very complex feature, but I'll try to get this particular case working by the holidays.

@urbaniak
Copy link

+1

@gastlich
Copy link

+1, @akhleung thanks for working on that!

@crohrer
Copy link

crohrer commented Dec 19, 2013

+1

@mstrutt
Copy link

mstrutt commented Jan 13, 2014

+1

@steveluscher
Copy link

Go @akhleung, go!

@bradens
Copy link

bradens commented Jan 21, 2014

Looking forward to this!

@akhleung
Copy link

Closing this since it's subsumed by #146.

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