@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
98 lines (97 loc) • 2.36 kB
JavaScript
import { getThemesFromOptions as m, defaultThemeName as v } from "../utils/options/index.js";
import { resolveThemeExtensionsAsTailwindExtension as T, resolveThemeExtensionAsCustomProps as _ } from "../utils/theme/themeUtils.js";
var l = {}, c = {}, h;
function O() {
return h || (h = 1, function(e) {
Object.defineProperty(e, "__esModule", {
value: !0
}), Object.defineProperty(e, "default", {
enumerable: !0,
get: function() {
return r;
}
});
function t(u, n) {
return {
handler: u,
config: n
};
}
t.withOptions = function(u, n = () => ({})) {
const i = function(o) {
return {
__options: o,
handler: u(o),
config: n(o)
};
};
return i.__isOptionsFunction = !0, i.__pluginFunction = u, i.__configFunction = n, i;
};
const r = t;
}(c)), c;
}
var g;
function q() {
return g || (g = 1, function(e) {
Object.defineProperty(e, "__esModule", {
value: !0
}), Object.defineProperty(e, "default", {
enumerable: !0,
get: function() {
return u;
}
});
const t = /* @__PURE__ */ r(O());
function r(n) {
return n && n.__esModule ? n : {
default: n
};
}
const u = t.default;
}(l)), l;
}
var d, P;
function y() {
if (P) return d;
P = 1;
let e = q();
return d = (e.__esModule ? e : { default: e }).default, d;
}
var $ = y();
const x = (e, { addVariant: t, e: r }) => {
for (const { name: u, selectors: n, mediaQuery: i } of e) {
const o = u === v ? "defaultTheme" : u, s = n ?? (!n && !i ? [`.${r(o)}`] : []);
s.length > 0 && t(
o,
s.flatMap((f) => [`${f} &`, `&${f}`])
), i && t(o, i);
}
}, p = (e, t) => {
const { addBase: r, e: u } = t;
for (const { name: n, selectors: i, extend: o, mediaQuery: a } of e) {
const s = i ?? (n === v ? [":root"] : a ? [] : [`.${u(n)}`]);
s.length > 0 && r({
[s.join(", ")]: _(o, t)
}), a && r({
[a]: {
":root": _(o, t)
}
});
}
}, C = (e, t) => {
const { addUtilities: r } = t;
r(e);
}, E = $.withOptions(
(e) => (t) => {
const r = m(e);
x(r, t), p(r, t), e != null && e.utilities && C(e.utilities, t);
},
(e) => ({
theme: {
extend: T(m(e))
}
})
);
export {
E as themePlugin
};