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:
parent
975dcdb8d8
commit
f7ddb8483d
1 changed files with 15 additions and 2 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue