
For example, this: ```css .foo { color: red; &:hover { color: green; } } ``` now has the same effect as this: ```css .foo { color: red; } .foo:hover { color: green; } ``` CSSStyleRule now has "absolutized selectors", which are its selectors with any `&`s resolved. We use these instead of the "real" selectors when matching them, meaning the style computer doesn't have to know or care about where the selector appears in the CSS document.
18 lines
381 B
HTML
18 lines
381 B
HTML
<!DOCTYPE html>
|
|
<style>
|
|
.test {
|
|
background-color: green;
|
|
width: 30px;
|
|
height: 30px;
|
|
margin-bottom: 10px;
|
|
}
|
|
</style>
|
|
<div class="test"></div>
|
|
<div class="test"></div>
|
|
<div class="test"></div>
|
|
<div class="test"></div>
|
|
<div class="test"></div>
|
|
<div class="test"></div>
|
|
<div class="test"></div>
|
|
<div class="test"></div>
|
|
<div class="test"></div>
|