Remove previously added extend class

1,074 views
Skip to first unread message

andrej telle

unread,
Aug 14, 2014, 7:05:46 AM8/14/14
to sass...@googlegroups.com
Hi,

given the following setup:

.img-frame {funky css goes here;}

.myClass {@extend .img-frame;}

I would like to remove the ".img-frame" extend from .myClass like so:

.sidebar .myClass {@remove .img-frame;}

Is there any way to do this? (Instead of overwriting all the "funky css" declarations by hand)

Or maybe I am missing something and there is an easier way?

Thank you,

Andrej

Roy Tomeij

unread,
Aug 14, 2014, 5:27:08 PM8/14/14
to sass...@googlegroups.com
You can't. I suggest solving this by using different CSS selectors.

Chris Eppstein

unread,
Aug 14, 2014, 6:30:58 PM8/14/14
to sass...@googlegroups.com
Actually, in theory, Sass *can* implement @unextend.

.img-frame {funky: css;}
.myClass:not(.sidebar .myClass) {@extend .img-frame; }
.sidebar .myClass {@unextend .img-frame; sidebar: css}

The output would be:

.img-frame, .myClass:not(.sidebar .myClass) {
  funky: css; }

.sidebar .myClass {
  sidebar: css; }

And there's a certain sense to doing this. I think it's worth filing a new issue on github to discuss it.


--
You received this message because you are subscribed to the Google Groups "Sass" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sass-lang+...@googlegroups.com.
To post to this group, send email to sass...@googlegroups.com.
Visit this group at http://groups.google.com/group/sass-lang.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
Message has been deleted
0 new messages