host-nesting-003.html (814B)
1 <!doctype html> 2 <meta charset="utf-8"> 3 <title>:host and nesting (combined with something else)</title> 4 <link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io"> 5 <link rel="author" title="Mozilla" href="https://mozilla.org"> 6 <link rel="help" href="https://drafts.csswg.org/css-nesting/#nest-selector"> 7 <link rel="match" href="/css/reference/ref-filled-green-100px-square-only.html"> 8 <p>Test passes if there is a filled green square.</p> 9 <div id="host"></div> 10 <script> 11 host.attachShadow({mode: "open"}).innerHTML = ` 12 <style> 13 .nested { 14 width: 100px; 15 height: 100px; 16 background-color: green; 17 } 18 :host(#not-host), #host { 19 .nested { 20 background-color: red; 21 } 22 } 23 </style> 24 <div class="nested"></div> 25 `; 26 </script>