Roman capitals cut into a veined marble slab, with a raking light that drifts across the stone and shifts the shadows inside each cut. Veins are SVG turbulence; the cut is an inset text-shadow.
Also known as: marble text effect, stone carved text css, engraved text css, chiseled stone text.
<div class="txt-carved-marble-text"><span class="txt-carved-marble-text-word">VERITAS</span></div>
.txt-carved-marble-text {
--c: var(--txt-color, #3b82f6);
font-size: calc(var(--txt-size, 32px) * 1.4);
font-family: system-ui, sans-serif;
font-weight: 600;
line-height: 1.2;
position: relative;
display: inline-block;
overflow: hidden;
padding: 0.45em 1em;
border-radius: 0.2em;
background:
url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='v'%3E%3CfeTurbulence type='turbulence' baseFrequency='0.006 0.014' numOctaves='5' seed='8' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.45 0 0 0 0 0.46 0 0 0 0 0.5 -7 0 0 0 0.8'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23v)'/%3E%3C/svg%3E") 0 0 / 9em 9em,
linear-gradient(160deg, #fbfaf7, #ebe8e1);
box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.6), 0 0 0 1px rgb(0 0 0 / 0.08), 0 0.25em 0.7em -0.25em rgb(0 0 0 / 0.35);
font-family: "Didot", "Bodoni 72", "Playfair Display", Georgia, "Times New Roman", serif;
letter-spacing: 0.22em;}
.txt-carved-marble-text::after {
content: "";
position: absolute;
inset: 0;
background: linear-gradient(105deg, transparent 30%, rgb(255 255 255 / 0.55) 50%, transparent 70%) 0 0 / 250% 100% no-repeat;
mix-blend-mode: soft-light;
animation: txt-carved-marble-text-rake 7s ease-in-out infinite alternate;
}
.txt-carved-marble-text-word {
position: relative;
margin-right: -0.22em;
background-color: color-mix(in srgb, var(--c) 12%, #6b6862);
-webkit-background-clip: text;
background-clip: text;
color: transparent;
-webkit-text-fill-color: transparent;
text-shadow: -0.03em 0.035em 0.01em rgb(255 255 255 / 0.75);
animation: txt-carved-marble-text-cut 7s ease-in-out infinite alternate;
}
@keyframes txt-carved-marble-text-rake {
from { background-position: 120% 0; }
to { background-position: -20% 0; }
}
@keyframes txt-carved-marble-text-cut {
from { text-shadow: -0.03em 0.035em 0.01em rgb(255 255 255 / 0.75); }
to { text-shadow: 0.03em 0.035em 0.01em rgb(255 255 255 / 0.75); }
}
@media (prefers-reduced-motion: reduce) {
.txt-carved-marble-text::after, .txt-carved-marble-text-word { animation: none; }
}
@media (prefers-reduced-motion: reduce) {
.txt-carved-marble-text, .txt-carved-marble-text *, .txt-carved-marble-text::before, .txt-carved-marble-text::after, .txt-carved-marble-text *::before, .txt-carved-marble-text *::after {
animation-duration: 0.01ms !important;
animation-iteration-count: 1 !important;
transition-duration: 0.01ms !important;
}
}--txt-color on the element or a parent.
Currently previewing #3b82f6.--txt-size. Every other dimension is in
em, so the whole thing scales together. Currently previewing 40px.transition or animation
shorthand. Staggered delays are relative, so they keep their rhythm.