Skip to content

Instantly share code, notes, and snippets.

@ahallora
Created November 18, 2021 07:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ahallora/0d3004771d937963ab96a27242a8a24a to your computer and use it in GitHub Desktop.
Save ahallora/0d3004771d937963ab96a27242a8a24a to your computer and use it in GitHub Desktop.
Cool text effect
<a href="#">
COOL TEXT
<span class="outline">COOL TEXT</span>
</a>
<style type="text/css">
body {
background: #000;
}
a {
position: relative;
width: 100%;
display: inline;
color: #ffe500;
-webkit-font-smoothing: antialiased;
-webkit-text-stroke: .12rem currentcolor;
-webkit-text-fill-color: transparent;
text-align: center;
text-decoration: none;
text-transform: uppercase;
font-weight: bold;
font-size: 200px;
font-family: sans-serif;
line-height: 112%;
}
a span.outline {
position: absolute;
top: 0;
left: 0;
border: 0;
margin: 0;
padding: 0;
color: inherit;
line-height: inherit;
font: inherit;
clip-path: inset(0 100% 0 0);
transition: clip-path 420ms cubic-bezier(.3,.3,.1,1),opacity 700ms ease-out,-webkit-clip-path 350ms cubic-bezier(.3,.3,.1,1);
-webkit-text-fill-color: currentcolor;
pointer-events: none;
opacity: 1;
}
a:hover span.outline {
clip-path: inset(0 0 0 0);
}
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment