UNPKG

fui-fancyui

Version:
24 lines (22 loc) 859 B
import p from "color"; import { css as s } from "styled-components"; import i from "../../../theme/themeStore/themeStore.js"; import { getBackgroundColor as d } from "../../colorCalculatorForComponent/colorCalculatorForComponent.js"; import { calcTextColor as u } from "./calcTextColor.js"; const f = (c) => { const { $themeType: t, $textColor: o, $outlined: l, $layer: n } = c, e = i.getState().theme, r = d({ theme: e, $themeType: t ?? "accent", $layer: n }), a = u({ $textColor: o, $themeType: t, $outlined: l }), m = p(r).alpha(0.1).hexa(); return s` position: relative; background-color: transparent; border: 1.5px solid ${r}; color: ${a}; &:hover:enabled { background-color: ${m}; color: ${o ? e.color[o][1] : r}; box-shadow: 0 0 10px 1px rgba(0, 0, 0, 0.15); } `; }; export { f as generateOutlined };