UNPKG

@carton-org/react-neumorphism

Version:

A React component library implementing the neumorphism design style

37 lines (36 loc) 1.18 kB
import { defaultDarkColorsTheme as u, defaultLightColorsTheme as l, defaultTypographyDarkTheme as g, defaultTypographyLightTheme as c, defaultBorderDarkTheme as s, defaultBorderLightTheme as $, defaultNeumorphismConfig as k } from "../constants/theme.js"; const f = ({ mode: d, neumorphismConfig: a, colorsConfig: t, typographyConfig: n, borderConfig: i }) => { const e = { ...d === "dark" ? u : l, ...t }, h = { ...d === "dark" ? g : c, ...n }, o = { ...d === "dark" ? s : $, ...i }, r = { ...k, ...a }; return { ...e, ...h, ...o, ...r, border: `${o.borderWidth} ${o.borderStyle} ${o.borderColor}`, background: `linear-gradient(145deg, ${e.backgroundColor}, ${e.backgroundColor})`, hoverBackground: `linear-gradient(145deg, ${e.hoverBackgroundColor}, ${e.hoverBackgroundColor})`, shadow: `${r.distance} ${r.distance} ${r.blur} ${e.darkShadow}, -${r.distance} -${r.distance} ${r.blur} ${e.lightShadow}`, shadowInset: `inset ${r.distance} ${r.distance} ${r.blur} ${e.darkShadow}, inset -${r.distance} -${r.distance} ${r.blur} ${e.lightShadow}` }; }; export { f as buildAugmentedTheme };