JSFiddle - React, Tailwind, and code Playground
by kougiland
HTML
<p class=shadowElement data-shadowtype="text" data-maxshadow="32" data-shadowcolor="rgb(1, 134, 135)">WELCOME</p>
JavaScript
var shadowElement = $(".shadowElement"),shadowType = shadowElement.data("shadowtype"),maxShadowIndex = shadowElement.data("maxshadow"),textShadowColor =shadowElement.data("shadowcolor"),elementTmp =$("a.elementTmp");
shadowElement.each( function(){
elementTmp.append(maxShadowIndex+'px '+maxShadowIndex+'px 0px '+textShadowColor);
for(i=(maxShadowIndex-1);i>0;i--){
elementTmp.append(','+i+'px '+i+'px 0px '+textShadowColor);
}
var o = elementTmp.html();
console.log(o);
shadowElement.css(shadowType+'-shadow',o);
});