Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-variables/registered-property-light-dark.html - WPT Dashboard Interop Dashboard
<!doctype html>
<meta charset="utf-8">
<title>light-dark() in custom property whose light value equals the registered initial-value</title>
<link rel="help" href="https://drafts.css-houdini.org/css-properties-values-api/#initial-value-descriptor">
<link rel="match" href="/css/reference/ref-filled-green-100px-square-only.html">
<style>
@property --test-color {
syntax: "<color>";
inherits: true;
initial-value: red;
}
.square {
width: 100px;
height: 100px;
color-scheme: dark;
--test-color: light-dark(red, green);
background-color: var(--test-color);
}
</style>
<p>Test passes if there is a filled green square.</p>
<div class="square"></div>