UNPKG

fui-fancyui

Version:
32 lines (30 loc) 1.12 kB
import { css as $ } from "styled-components"; import { getBackgroundColor as o } from "../../colorCalculatorForComponent/colorCalculatorForComponent.js"; import { generateStateStyle as y } from "./generateHoverActiveColor.js"; import g from "../../colorTransparencyCalculator/colorTransparencyCalculator.js"; import u from "../../../../utils/functions/clampLayer/clampLayer.js"; const f = (t) => { const { $themeType: e, theme: r, $layer: n = 0, $backgroundState: l, $outlinedBackgroundStrength: a = 0.1, $textColor: i, $outlinedRemoveBorder: c } = t, d = o({ theme: r, $themeType: e ?? "primary", $layer: n ?? 0 }), m = g( o({ theme: r, $themeType: e || "primary", $layer: u(n - 3) }), a ); return $` box-sizing: border-box; ${c ? "border: none" : `border: 2px solid ${d};`}; color: ${o({ $themeType: i ?? e ?? "secondary", theme: r, $layer: 0 })}; background-color: ${m}; /* This generate the hover / active style if its needed */ ${l && y({ ...t, $outlined: !0, $outlinedBackgroundStrength: a + 0.1 })} `; }; export { f as generateOutlineStyle };