Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<meta charset="utf-8">
<title>CSSOM: :root selector parsed in getComputedStyle()</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
:root {
--a: red;
}
</style>
<script>
"use strict";
test(() => {
const a = getComputedStyle(document.documentElement).getPropertyValue("--a");
assert_equals(a, "red");
}, "Accessing variables in :root pseudo-selector");
</script>