summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-properties-values-api/animation/custom-property-animation-used-in-shorthand.html
blob: 63f7fd3fe79bd3f95efe1dc717f0ac5418ad509f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<!DOCTYPE html>
<link rel="help" href="https://drafts.css-houdini.org/css-properties-values-api-1">
<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>