Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<title>CSS Values: typed arithmetic with custom property and cycle tests</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
@property --length {
syntax: "<length>";
initial-value: 0px;
inherits: false;
}
:root {
font-size: 228px;
}
div {
--length: calc(10px * (2em / 1em));
font-size: var(--length);
}
</style>
<div id="target"></div>
<script>
test(() => {
assert_equals(getComputedStyle(target).fontSize, "228px");
});
</script>