92 lines
2.8 KiB
Plaintext
92 lines
2.8 KiB
Plaintext
|
'use strict';
|
||
|
|
||
|
Object.defineProperty(exports, '__esModule', { value: true });
|
||
|
|
||
|
const core = require('@unocss/core');
|
||
|
const extractorArbitraryVariants = require('@unocss/extractor-arbitrary-variants');
|
||
|
const utilities = require('./shared/preset-mini.UhMMbd34.cjs');
|
||
|
const _default = require('./shared/preset-mini.fgwIVvur.cjs');
|
||
|
const _default$1 = require('./shared/preset-mini.qKuB9vcd.cjs');
|
||
|
const _default$2 = require('./shared/preset-mini.e29ECnbA.cjs');
|
||
|
const colors = require('./colors.cjs');
|
||
|
require('@unocss/rule-utils');
|
||
|
require('./shared/preset-mini.-3Qybdh5.cjs');
|
||
|
|
||
|
const preflights = [
|
||
|
{
|
||
|
layer: "preflights",
|
||
|
getCSS(ctx) {
|
||
|
if (ctx.theme.preflightBase) {
|
||
|
const css = core.entriesToCss(Object.entries(ctx.theme.preflightBase));
|
||
|
const roots = core.toArray(ctx.theme.preflightRoot ?? ["*,::before,::after", "::backdrop"]);
|
||
|
return roots.map((root) => `${root}{${css}}`).join("");
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
];
|
||
|
|
||
|
const shorthands = {
|
||
|
position: [
|
||
|
"relative",
|
||
|
"absolute",
|
||
|
"fixed",
|
||
|
"sticky",
|
||
|
"static"
|
||
|
],
|
||
|
globalKeyword: utilities.globalKeywords
|
||
|
};
|
||
|
|
||
|
const presetMini = core.definePreset((options = {}) => {
|
||
|
options.dark = options.dark ?? "class";
|
||
|
options.attributifyPseudo = options.attributifyPseudo ?? false;
|
||
|
options.preflight = options.preflight ?? true;
|
||
|
options.variablePrefix = options.variablePrefix ?? "un-";
|
||
|
return {
|
||
|
name: "@unocss/preset-mini",
|
||
|
theme: _default.theme,
|
||
|
rules: _default$1.rules,
|
||
|
variants: _default$2.variants(options),
|
||
|
options,
|
||
|
prefix: options.prefix,
|
||
|
postprocess: VarPrefixPostprocessor(options.variablePrefix),
|
||
|
preflights: options.preflight ? normalizePreflights(preflights, options.variablePrefix) : [],
|
||
|
extractorDefault: options.arbitraryVariants === false ? void 0 : extractorArbitraryVariants.extractorArbitraryVariants,
|
||
|
autocomplete: {
|
||
|
shorthands
|
||
|
}
|
||
|
};
|
||
|
});
|
||
|
function VarPrefixPostprocessor(prefix) {
|
||
|
if (prefix !== "un-") {
|
||
|
return (obj) => {
|
||
|
obj.entries.forEach((i) => {
|
||
|
i[0] = i[0].replace(/^--un-/, `--${prefix}`);
|
||
|
if (typeof i[1] === "string")
|
||
|
i[1] = i[1].replace(/var\(--un-/g, `var(--${prefix}`);
|
||
|
});
|
||
|
};
|
||
|
}
|
||
|
}
|
||
|
function normalizePreflights(preflights3, variablePrefix) {
|
||
|
if (variablePrefix !== "un-") {
|
||
|
return preflights3.map((p) => ({
|
||
|
...p,
|
||
|
getCSS: /* @__PURE__ */ (() => async (ctx) => {
|
||
|
const css = await p.getCSS(ctx);
|
||
|
if (css)
|
||
|
return css.replace(/--un-/g, `--${variablePrefix}`);
|
||
|
})()
|
||
|
}));
|
||
|
}
|
||
|
return preflights3;
|
||
|
}
|
||
|
|
||
|
exports.parseColor = utilities.parseColor;
|
||
|
exports.theme = _default.theme;
|
||
|
exports.colors = colors.colors;
|
||
|
exports.VarPrefixPostprocessor = VarPrefixPostprocessor;
|
||
|
exports.default = presetMini;
|
||
|
exports.normalizePreflights = normalizePreflights;
|
||
|
exports.preflights = preflights;
|
||
|
exports.presetMini = presetMini;
|