UNPKG

@leancodepl/styled-tools

Version:
25 lines (24 loc) 455 B
import { useTheme as m } from "styled-components"; function r(e) { const n = {}; return new Proxy(e, { get(u, t) { return t === "prototype" ? Function.prototype : (n[t] ??= r((c) => { const o = u(c); return i(o) ? o?.[t] : void 0; }), n[t]); } }); } function i(e) { return typeof e == "object"; } function h() { return { theme: r((e) => e.theme), useTheme: () => m() }; } export { h as mkTheme };