1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00

[Sass] Be a little more specific about how sequences @extending works.

This commit is contained in:
Nathan Weizenbaum 2010-04-25 19:29:15 -07:00
parent 975dcdb8d8
commit f7ddb8483d

View file

@ -1027,8 +1027,7 @@ is compiled to:
#### Selector Sequences
Selector sequences, such as `.foo .bar` or `.foo + .bar`,
currently can't be extended.
Selector sequences, such as `.foo .bar` or `.foo + .bar`, currently can't be extended.
However, it is possible for nested selectors themselves to use `@extend`.
For example:
@ -1056,6 +1055,20 @@ For example:
.foo .bar {@extend .bang}
.baz .bang {color: blue}
When `.bang` in `.baz .bang` is replaced with `.foo .bar`,
we need the resulting selector to match any element with class `.bar`
that has a parent with class `.foo` *and* a parent with class `.baz`.
That includes each of the following cases:
<div class="baz"><div class="foo"><div class="bar">...</div></div></div>
<div class="foo baz"><div class="bar">...</div></div>
<div class="foo"><div class="baz"><div class="bar">...</div></div></div>
There's no single selector that matches all of these, so the following:
.foo .bar {@extend .bang}
.baz .bang {color: blue}
is compiled to:
.baz .bang, .baz .foo .bar, .foo.baz .bar, .foo .baz .bar {