Skip to content

Text Shadow

Use text-shadow-* utilities to add shadows to text.

Use utilities like text-shadow-sm and text-shadow-lg to apply different sized text shadows to a text element:

Style('text-shadow-2xs ...', child: Text('The quick brown fox...'))
Style('text-shadow-xs ...', child: Text('The quick brown fox...'))
Style('text-shadow-sm ...', child: Text('The quick brown fox...'))
Style('text-shadow-md ...', child: Text('The quick brown fox...'))
Style('text-shadow-lg ...', child: Text('The quick brown fox...'))

Use the opacity modifier to adjust the opacity of the text shadow:

Style('text-shadow-lg ...', child: Text('The quick brown fox...'))
Style('text-shadow-lg/20 ...', child: Text('The quick brown fox...'))
Style('text-shadow-lg/30 ...', child: Text('The quick brown fox...'))

The default text shadow opacities are quite low (20% or less), so increasing the opacity (to like 50%) will make the text shadows more pronounced.

Use utilities like text-shadow-indigo-500 and text-shadow-cyan-500/50 to change the color of a text shadow:

Style('text-sky-950 text-shadow-2xs text-shadow-sky-300 ...', child: Text('Book a demo'))
Style('text-gray-950 ...', child: Text('See pricing'))

By default colored text shadows have an opacity of 100% but you can adjust this using the opacity modifier.

Use the text-shadow-none utility to remove an existing text shadow from an element.

Style('text-shadow-lg', child: const Text('with shadow'));
Style('text-shadow-none', child: const Text('no shadow'));
ClassDescription
text-shadow-2xs2x extra small text shadow
text-shadow-xsExtra small text shadow
text-shadow-smSmall text shadow
text-shadowDefault text shadow
text-shadow-mdMedium text shadow
text-shadow-lgLarge text shadow
text-shadow-noneRemove text shadow
text-shadow-{color}Override the text-shadow color (e.g. text-shadow-sky-300)
text-shadow-{color}/{opacity}Color override with explicit alpha
text-shadow-{size}/{opacity}Size with alpha override (e.g. text-shadow-lg/20)