@vinicunca/unocss-preset 1.29.2 → 1.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +13 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -528,6 +528,13 @@ async function resolveOptions(options) {
|
|
|
528
528
|
const transformers = await resolveTransformers(optionsWithDefault);
|
|
529
529
|
const { theme: themeExtend, shortcuts, safelist } = resolveExtend(optionsWithDefault);
|
|
530
530
|
const theme_ = mergeDeep(optionsWithDefault.theme, themeExtend);
|
|
531
|
+
const enableAkar = Boolean(options.akar);
|
|
532
|
+
const layers = {};
|
|
533
|
+
if (enableAkar) layers.akar = 10;
|
|
534
|
+
const variants = [];
|
|
535
|
+
if (enableAkar) variants.push((matcher) => {
|
|
536
|
+
if (matcher.startsWith("akar:")) return { matcher: matcher.replace("akar:", "uno-layer-akar:") };
|
|
537
|
+
});
|
|
531
538
|
return {
|
|
532
539
|
...optionsWithDefault,
|
|
533
540
|
theme: { ...theme_ },
|
|
@@ -535,7 +542,9 @@ async function resolveOptions(options) {
|
|
|
535
542
|
presets,
|
|
536
543
|
shortcuts,
|
|
537
544
|
transformers,
|
|
538
|
-
safelist
|
|
545
|
+
safelist,
|
|
546
|
+
layers,
|
|
547
|
+
variants
|
|
539
548
|
}
|
|
540
549
|
};
|
|
541
550
|
}
|
|
@@ -625,14 +634,15 @@ const presetVinicunca = definePreset(async (options) => {
|
|
|
625
634
|
const { enableDefaultShortcuts, unColor, theme, meta } = resolvedOptions;
|
|
626
635
|
return {
|
|
627
636
|
name: `unocss-preset-${PRESET_NAME}`,
|
|
628
|
-
layers: { [PRESET_NAME]: 10 },
|
|
629
637
|
theme,
|
|
630
638
|
shortcuts: [...enableDefaultShortcuts ? defaultShortcuts : [], ...meta.shortcuts],
|
|
631
639
|
postprocess: [unColor ? postprocessWithUnColor(unColor) : void 0].filter(Boolean),
|
|
632
640
|
presets: meta.presets,
|
|
633
641
|
transformers: meta.transformers,
|
|
634
642
|
preflights: getPreflights(resolvedOptions),
|
|
635
|
-
safelist: meta.safelist
|
|
643
|
+
safelist: meta.safelist,
|
|
644
|
+
variants: meta.variants,
|
|
645
|
+
layers: meta.layers
|
|
636
646
|
};
|
|
637
647
|
});
|
|
638
648
|
function defineVinicuncaConfig(options = {}, config = {}) {
|