Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-properties-values-api/animation/custom-property-animation-used-in-shorthand.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
@property --angle {
syntax: "<angle>";
inherits: false;
initial-value: 0deg;
}
@keyframes angle-animation {
from { --angle: 0deg }
to { --angle: 180deg }
}
#target {
animation: angle-animation 1000s linear -500s;
background: linear-gradient(var(--angle), black, white);
}
</style>
<div id="target"></div>
<script>
test(() => {
assert_equals(getComputedStyle(target).backgroundImage, 'linear-gradient(90deg, rgb(0, 0, 0), rgb(255, 255, 255))')
}, "Animated custom property is applied in a shorthand property.");
</script>