Skip to content

Function: parseTextShadow() ​

ts
function parseTextShadow(shadow, textColor?, fontSize?): TextShadow | null;

Experimental

Parse a CSS text-shadow (the first shadow of a list): two or three lengths (offsetX offsetY [blur], in px, unitless, em, or rem) and an optional color before or after them. A missing color is the text color (currentColor); an unknown one is black.

'auto' is Plotly's automatic shadow: a thin halo around the glyphs — no offset, 1 px outline, 1 px blur — in the contrast color of the text (white behind dark text, black behind light text). 'none', empty, unset, or unparsable values yield null.

Parameters ​

ParameterTypeDefault value
shadowstring | null | undefinedundefined
textColorRGBA...
fontSizenumber16

Returns ​

TextShadow | null

Released under the MIT License.