fui-fancyui
Version:
FancyUI Libary
28 lines (26 loc) • 1.11 kB
JavaScript
import { css as s } from "styled-components";
import $ from "../../../theme/themeStore/themeStore.js";
import { getBackgroundColor as g } from "../../colorCalculatorForComponent/colorCalculatorForComponent.js";
import { boxShadow as u } from "../../shadows/shadows.js";
import { calcTextColor as d } from "./calcTextColor.js";
import { generateBackgroundColor as i } from "./generateBackgroundColor.js";
import f from "../../../../utils/functions/clampLayer/clampLayer.js";
const b = (n) => {
const { $themeType: o, $hoverColor: t, $textColor: a, $outlined: c, $layer: r } = n, e = $.getState().theme, m = d({ $textColor: a, $themeType: o, $outlined: c }), l = () => o === "transparent" ? "transparent" : t ? e.color[t][1] : g({
theme: e,
$themeType: o ?? "accent",
$layer: f((r && r + 1) ?? 1)
}), p = i({ $themeType: o, $layer: r });
return s`
background-color: ${p};
color: ${m};
&:hover {
${o === "transparent" ? "color: " + e.color.secondary[1] : ""};
${o !== "transparent" && u.sm};
background-color: ${l};
}
`;
};
export {
b as generateNormal
};