before-after-dynamic-custom-property-001.html (892B)
1 <!doctype html> 2 <meta charset="utf-8"> 3 <title>CSS Test: Dynamic ::before and ::after generation by a custom property reference</title> 4 <link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io"> 5 <link rel="match" href="before-after-dynamic-custom-property-001-ref.html"> 6 <link rel="help" href="https://drafts.csswg.org/css-pseudo/#generated-content"> 7 <link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1660804"> 8 <style> 9 .first::before { 10 content: var(--variable-1); 11 } 12 .second::after { 13 content: var(--variable-2); 14 } 15 </style> 16 <p>Test passes if you see two PASS lines below:</p> 17 <div class="first">SS</div> 18 <div class="second">PA</div> 19 <script> 20 document.querySelector(".second").getBoundingClientRect(); 21 document.documentElement.style.setProperty("--variable-1", "\"PA\""); 22 document.documentElement.style.setProperty("--variable-2", "\"SS\""); 23 </script>