Files
serenity/Tests/LibWeb/Text/input/ShadowDOM/css-variable-inheritance-across-shadow-boundary.html
Andreas Kling 94c1066f68 LibWeb: Inherit CSS variables across shadow boundaries
This fixes a bunch of issues on https://wpt.fyi/

(cherry picked from commit de2b9eebe6012e321c85cdae0ca14b4be40de624)
2024-07-28 07:33:15 -04:00

21 lines
400 B
HTML

<style>
:root {
--foo: green;
}
</style>
<div id="myShadowHost">
<template shadowrootmode="open">
<style>
span { color: var(--foo, red); }
</style>
<span>green</span>
</template>
</div>
<script src="../include.js"></script>
<script>
test(() => {
let span = myShadowHost.shadowRoot.firstElementChild.nextElementSibling;
println(getComputedStyle(span).color);
});
</script>