UNPKG

@awal-solution/tailwind-theming

Version:

<div align="left"> <h1>Tailwind theming</h1> <p>The <b>TailwindCSS Multi-Theming Plugin</b> is a utility for creating and managing multiple themes in your TailwindCSS-based projects. With this library, you can define, add, update, and remove themes dyn

22 lines (21 loc) 795 B
import { i as n, t as c, g as i } from "../../colorUtils-Byrk_2xh.js"; const p = /[\\^$.*+?()[\]{}|]/g, a = RegExp(p.source), m = (t) => t && a.test(t) ? t.replace(p, "\\$&") : t || "", g = (t) => typeof t == "number" ? t.toString() : n(t) ? c(t) : t, s = /\s/g, f = (t) => { if (t.some((e) => s.test(e))) throw new Error( `Cannot have whitespace in any property in a theme config, found "${t.find((e) => s.test(e))}"` ); return m(`--${t.filter((e, o) => !(o == t.length - 1 && e == "DEFAULT")).join("-")}`); }, u = (t, e) => { const o = f(e); if (n(t)) { const r = i(t); return `rgb(var(${o}) / ${r == 1 ? "<alpha-value>" : r})`; } else return `var(${o})`; }; export { u as asCustomProp, m as escape, f as toCustomPropName, g as toCustomPropValue };