<header>
<h1 class="dynamic-text-shadow"><code>font-size</code> Contextual Text Shadows</h1>
<h2 class="dynamic-text-shadow">powered by <code>em</code></h2>
</header>
.dynamic-text-shadow {
/* larger font size, more shadow distance */
text-shadow: .1em .1em 0 hsl(200 50% 30%);
}
* {
box-sizing: border-box;
margin: 0;
}
html {
block-size: 100%;
background: hsl(200 50% 50%);
color: hsl(200 50% 90%);
}
h1 {
font-size: 5rem;
font-weight: 900;
line-height: 1.1;
max-inline-size: 15ch;
}
@media (max-width: 480px) {
h1 {
font-size: 2.5rem;
}
}
h2 {
text-transform: uppercase;
text-align: end;
}
code {
color: white;
}
header {
display: grid;
gap: 1ch;
}
body {
min-block-size: 100%;
font-family: 'Fugaz One', cursive;
display: grid;
place-content: center;
padding: 5vmin;
}
This Pen doesn't use any external JavaScript resources.