Skip to content

Commit 9403ee5

Browse files
committed
Custom properties test, tweaks to animation tests
1 parent 05f436e commit 9403ee5

File tree

3 files changed

+128
-1
lines changed

3 files changed

+128
-1
lines changed

animation-font-properties.html

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8" />
5+
<title>Animating font (and text) properties</title>
6+
<style type="text/css">
7+
html {background: silver;}
8+
body {background: white; margin: 1em; padding: 1em;}
9+
label {border: 1px solid rgba(0,0,0,0.5); border-radius: 2ch; padding: 0.5ch 1.5ch; font: bold 1em sans-serif;}
10+
label:focus {background: yellow;}
11+
#run:checked + label {color: white; background: darkgreen;}
12+
13+
.arena ol {margin-top: 1em; border-top: 1px solid gray;}
14+
.arena ol li {animation: 2s 0s paused linear alternate infinite;}
15+
#run:checked ~ ol li {animation-play-state: running;}
16+
17+
.arena li:nth-child(1) {animation-name: sizer;}
18+
.arena li:nth-child(2) {animation-name: adjuster;}
19+
.arena li:nth-child(3) {animation-name: weighter;}
20+
.arena li:nth-child(4) {animation-name: styler;}
21+
.arena li:nth-child(5) {animation-name: stretcher;}
22+
.arena li:nth-child(6) {animation-name: heighter;}
23+
24+
@keyframes sizer {
25+
from {font-size: 1em;}
26+
to {font-size: 2em;}
27+
}
28+
29+
@keyframes heighter {
30+
from {line-height: 1em;}
31+
to {line-height: 4em;}
32+
}
33+
34+
@keyframes weighter {
35+
from {font-weight: 400;}
36+
to {font-weight: 900;}
37+
}
38+
39+
@keyframes styler {
40+
from {font-style: normal;}
41+
to {font-style: italic;}
42+
}
43+
44+
@keyframes styler {
45+
from {font-stretch: ultra-condensed;}
46+
to {font-stretch: ultra-expanded;}
47+
}
48+
49+
@keyframes adjuster {
50+
from {font-size-adjust: 0.5;}
51+
to {font-size-adjust: 1;}
52+
}
53+
</style>
54+
</head>
55+
<body>
56+
57+
58+
<form class="arena">
59+
60+
<input type="checkbox" id="run"> <label for="run">Run animations</label>
61+
62+
<ol>
63+
<li><p>A paragraph.</p></li>
64+
<li><p>A paragraph.</p></li>
65+
<li><p>A paragraph.</p></li>
66+
<li><p>A paragraph.</p></li>
67+
<li><p>A paragraph.</p></li>
68+
<li><p>A paragraph.</p></li>
69+
</ol>
70+
71+
</form>
72+
73+
74+
75+
</body>
76+
</html>

animation-step-direction.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html>
33
<head>
44
<meta charset="utf-8" />
5-
<title>Figure</title>
5+
<title>Step animation direction</title>
66
<style type="text/css">
77
html {background: silver;}
88
body {background: white; margin: 1em; padding: 1em;}

custom-properties.html

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="utf-8" />
5+
<title>Custom Properties</title>
6+
<style type="text/css">
7+
html {
8+
--base-color: #639;
9+
}
10+
aside {
11+
--base-color: #F60;
12+
}
13+
14+
h1 {color: var(--base-color);}
15+
16+
id[^="support"] {color: silver;}
17+
@supports (color: var(--test)) {
18+
#support1 {color: green;}
19+
}
20+
@supports (--test: pass) {
21+
#support2 {color: green;}
22+
}
23+
24+
</style>
25+
</head>
26+
<body>
27+
28+
29+
<section class="arena">
30+
31+
<h1>Heading 1</h1>
32+
<p>Main text.</p>
33+
34+
<aside>
35+
<h1>Heading 1</h1>
36+
<p>An aside.</p>
37+
</aside>
38+
39+
<h1>Heading 1</h1>
40+
<p>Main text.</p>
41+
42+
</section>
43+
44+
<ol>
45+
<li id="support1">Support 1</li>
46+
<li id="support2">Support 2</li>
47+
</ol>
48+
49+
50+
</body>
51+
</html>

0 commit comments

Comments
 (0)