slotted-specificity.html (848B)
1 <!doctype html> 2 <meta charset="utf-8"> 3 <title>CSS Test: the selector inside ::slotted() affects specificity</title> 4 <link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io"> 5 <link rel="help" href="https://drafts.csswg.org/css-scoping/#slotted-pseudo"> 6 <link rel="help" href="https://github.com/w3c/csswg-drafts/issues/1915"> 7 <link rel="help" href="https://bugzil.la/1454165"> 8 <link rel="match" href="reference/green-box.html"> 9 <p>Test passes if you see a single 100px by 100px green box below.</p> 10 <div id="host"><div id="slotted"></div></div> 11 <script> 12 host.attachShadow({ mode: 'open' }).innerHTML = ` 13 <style> 14 ::slotted(#slotted) { 15 width: 100px; 16 height: 100px; 17 background: green; 18 } 19 ::slotted(*) { 20 background: red; 21 } 22 </style> 23 <slot></slot> 24 `; 25 </script>