Four zero-blur shadows stepped one pixel apart give a 3D edge. Four at the diagonals give an outline.
Size, weight and colors are here so you can judge the shadow. Only the shadow goes into the CSS.
Almost before we knew it
Layer shadows behind your text and copy the CSS.
Four zero-blur shadows stepped one pixel apart give a 3D edge. Four at the diagonals give an outline.
Size, weight and colors are here so you can judge the shadow. Only the shadow goes into the CSS.
Almost before we knew it
The text-shadow property takes three lengths and a color, with nothing to tell you which is which. A generator puts a slider on each one and shows the result on real text, so you can see the difference between a shadow that lifts a heading off the page and one that just makes it look blurry.
What makes this property more interesting than box-shadow is that stacking changes what it does entirely. One shadow is a shadow. Four identical ones stepped a pixel apart become a 3D extrusion. Four at the diagonals become an outline. Three at the same spot with rising blur become a neon glow. Those effects are the reason most people look for this tool, so it stacks up to eight layers and ships a preset for each of them.
Text shadows earn their place in a few specific spots, and get in the way everywhere else.
-webkit-text-stroke is awkward.Shadowing a box instead? The CSS Box Shadow Generator stacks layers the same way. For colored headings there's the CSS Gradient Text Generator. Or browse all our free developer tools.
Across, down, blur, color, in that order. The first two can be negative to move the shadow left or up. Blur is optional and defaults to zero, which gives a hard edge. Unlike box-shadow there is no spread value, so a text shadow can only be offset and softened, never grown.
Stack four shadows with zero blur, one pixel out in each diagonal direction, all in the outline color. It's a fake, but it works everywhere and it follows the letterforms exactly. The property that's actually meant for this is -webkit-text-stroke, which is widely supported but draws the stroke centered on the glyph edge, so it eats into thin fonts in a way the shadow trick does not.
Use the Neon glow preset, or build it yourself with three or four layers at zero offset, same hue, with the blur roughly doubling each time, on a dark background. The trick is that the layers add up where they overlap, so the center burns brighter than the edges, which is what makes it read as light rather than a colored blur.
It can, especially on body text, so it's worth being careful. A shadow adds a second edge to every letter, and at small sizes those edges close up the counters inside letters like e and a. Keep shadows for display sizes and keep the blur small relative to the font size. If the shadow only exists to make text readable over an image, a semi-transparent panel behind the text is cheaper to paint and easier to read.
A static shadow is close to free. An animated one isn't, because every layer is repainted on every frame and text repaints are expensive. If you want a glow that pulses, animate opacity on a duplicate of the text sitting behind the real one rather than animating the shadow itself.
Yes, switch the format above the code. Tailwind gets an arbitrary-value class, since its built-in text shadow utilities do not cover stacked layers. The JS object drops straight into React inline styles or styled-components.