nex3/sass — Issue #289: Bugs with referencing parent selectors
Author: kizu
Created: 2012-02-22 20:30:35+00:00
State: open

There are some cases that work ok in other pre-processors and it would be cool to support them in Sass too:

# Concatenating with elements

When I write 'p&' I expect the & to expand to the parent selector, so I could narrow the class to the element and from

.class {
color: lime;
p& {
color: red;
}
}

I would get the

.class {
color: lime;
}
p.class {
color: red;
}

Right now I get the error “"&" may only be used at the beginning of a selector.” — I think that such limitation is unneeded.

# Concatenating the parent selector with the postfix

When I write `&_disabled` I expect it to expand to concatenate with the selector, so I could write

.class {
color: lime;
&_disabled {
color: red;
}
}

and get this:

.class {
color: lime;
}
.class_disabled {
color: red;
}

But right now I get this (the space occurs between the postfix and selector):

.class {
color: lime;
}
.class _disabled {
color: red;
}