Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /css/css-backgrounds/background-clip/clip-text-animated-text.html - WPT Dashboard Interop Dashboard
<!doctype html>
<html class="reftest-wait">
<title>CSS Test: background-clip: text animated text</title>
<link rel="author" href="mailto:nathan@knowler.dev" title="Nathan Knowler">
<link rel="match" href="clip-text-animated-text-ref.html">
<style>
.text {
background-color: DeepPink;
background-clip: text;
font-size: 50px;
font-family: sans-serif;
font-weight: 600;
color: transparent;
}
.text p {
animation: fade-in 0.1s both;
}
@keyframes fade-in {
from { opacity: 0; }
}
</style>
<div class="text">
<p>Text</p>
</div>
<script>
const [animation] = document.querySelector(".text p").getAnimations();
animation.finished.then(() => {
document.documentElement.classList.remove("reftest-wait");
});
</script>