react-fdt-gradient
Version:
A React component library for gradient-based designs, including text, background, and border gradients.
3 lines (2 loc) • 1.22 kB
JavaScript
import{jsx as r}from"react/jsx-runtime";var e=function(e){var n=e.text,t=e.direction,a=e.gradientColors,i=e.className,o="linear-gradient(".concat(t,", ").concat(a.join(", "),")");return r("span",{className:i,style:{background:o,WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",display:"inline-block"},children:n})},n=function(){return n=Object.assign||function(r){for(var e,n=1,t=arguments.length;n<t;n++)for(var a in e=arguments[n])Object.prototype.hasOwnProperty.call(e,a)&&(r[a]=e[a]);return r},n.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;var t=function(e){var t=e.children,a=e.gradientColors,i=e.style,o=e.className,c="linear-gradient(90deg, ".concat(a.join(", "),")");return r("div",{className:o,style:n({background:c},i),children:t})},a=function(e){var t=e.children,a=e.gradientColors,i=e.borderWidth,o=void 0===i?2:i,c=e.style,d=e.className,l="linear-gradient(90deg, ".concat(a.join(", "),")");return r("div",{className:d,style:n({padding:o,borderRadius:"8px",background:l},c),children:r("div",{style:{background:"#fff",borderRadius:"inherit"},children:t})})};export{t as GradientBackground,a as GradientBorder,e as GradientText};
//# sourceMappingURL=index.esm.js.map