Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-cascade/revert-rule-custom-property.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<title>The revert-rule keyword: custom properties</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
#test1 {
--a: red;
--b: green;
}
#test1 {
--a: green;
--b: revert-rule;
}
#test1 {
--a: revert-rule;
--b: revert-rule;
}
</style>
<div id=test1></div>
<script>
test(() => {
assert_true(CSS.supports('color:revert-rule'));
assert_equals(getComputedStyle(test1).getPropertyValue("--a"), 'green')
assert_equals(getComputedStyle(test1).getPropertyValue("--b"), 'green')
}, 'revert-rule in a custom property');
</script>