nex3/sass — Issue #285: New Idea for Ampersand
Author: gisu
Created: 2012-02-20 17:22:21+00:00
State: open

First, I like it with the ampersand Selector to work, little sign big effect;)

But I have an idea, perhaps that will come in order to improve working with mixins and class combinations.

SASS Part
=test
.mixinClass
height: 20px

.combinatedClass
background: red
+test

I got this

.combinatedClass { background: red; }
.combinatedClass .mixinClass { height: 20px; }

This is already sufficient in most cases, but sometimes you want the class of mixins combine with the parent class, like so:

.combinatedClass { background: red; }
.combinatedClass.mixinClass { height: 20px; }

The Idea is this

@mixin test
.mixinClass
height: 20px

.combinatedClass
background: red
& +test

Nest so they could be used two ways a mixin, as usual, once it comes in a different class or to combine it with the other class. And with the least effort. I do not know what you think, I personally would find it not bad.