@vinicunca/unocss-preset 1.4.1 → 1.5.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/chunks/index3.cjs +3 -1
- package/dist/chunks/index3.mjs +3 -1
- package/dist/index.cjs +3 -1
- package/dist/index.d.cts +6 -0
- package/dist/index.d.mts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.mjs +3 -1
- package/dist/shared/{unocss-preset.Di_kSW6D.mjs → unocss-preset.Bo6d0oPz.mjs} +22 -8
- package/dist/shared/{unocss-preset.D9iQspZ3.cjs → unocss-preset.D9CUN8gV.cjs} +22 -8
- package/package.json +1 -1
package/dist/chunks/index3.cjs
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const utils = require('@unocss/preset-mini/utils');
|
|
4
|
-
const index = require('../shared/unocss-preset.
|
|
4
|
+
const index = require('../shared/unocss-preset.D9CUN8gV.cjs');
|
|
5
5
|
require('@unocss/core');
|
|
6
6
|
require('@vinicunca/perkakas');
|
|
7
|
+
require('@unocss/preset-mini');
|
|
8
|
+
require('unocss');
|
|
7
9
|
|
|
8
10
|
const CSS_VARIABLE_PREFIX = "--vin";
|
|
9
11
|
const ENTER_ANIMATION_NAME = "vin-in";
|
package/dist/chunks/index3.mjs
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { h } from '@unocss/preset-mini/utils';
|
|
2
|
-
import { l as layerMeta } from '../shared/unocss-preset.
|
|
2
|
+
import { l as layerMeta } from '../shared/unocss-preset.Bo6d0oPz.mjs';
|
|
3
3
|
import '@unocss/core';
|
|
4
4
|
import '@vinicunca/perkakas';
|
|
5
|
+
import '@unocss/preset-mini';
|
|
6
|
+
import 'unocss';
|
|
5
7
|
|
|
6
8
|
const CSS_VARIABLE_PREFIX = "--vin";
|
|
7
9
|
const ENTER_ANIMATION_NAME = "vin-in";
|
package/dist/index.cjs
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
require('@unocss/core');
|
|
4
|
-
const index = require('./shared/unocss-preset.
|
|
4
|
+
const index = require('./shared/unocss-preset.D9CUN8gV.cjs');
|
|
5
5
|
require('@vinicunca/perkakas');
|
|
6
|
+
require('@unocss/preset-mini');
|
|
7
|
+
require('unocss');
|
|
6
8
|
|
|
7
9
|
|
|
8
10
|
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import '@unocss/core';
|
|
2
|
-
export { a as defineConfig, d as defineVinicuncaConfig, p as presetVinicunca } from './shared/unocss-preset.
|
|
2
|
+
export { a as defineConfig, d as defineVinicuncaConfig, p as presetVinicunca } from './shared/unocss-preset.Bo6d0oPz.mjs';
|
|
3
3
|
import '@vinicunca/perkakas';
|
|
4
|
+
import '@unocss/preset-mini';
|
|
5
|
+
import 'unocss';
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { definePreset, mergeConfigs } from '@unocss/core';
|
|
2
2
|
import { isString, isBoolean, isPlainObject, mergeDeep } from '@vinicunca/perkakas';
|
|
3
|
+
import { theme } from '@unocss/preset-mini';
|
|
4
|
+
import { entriesToCss } from 'unocss';
|
|
3
5
|
|
|
4
6
|
const RE_RGB = /rgb\(([\d\s]+?)\s*\/\s*([^)]+)\)/;
|
|
5
7
|
const RE_RGBA = /rgba\(([\d\s,]+),\s*([^)]+)\)/;
|
|
@@ -27,6 +29,10 @@ function postprocessWithUnColor(unColor) {
|
|
|
27
29
|
};
|
|
28
30
|
}
|
|
29
31
|
|
|
32
|
+
function compressCSS(css) {
|
|
33
|
+
return css.replace(/\s+/g, " ").replace(/\/\*[\s\S]*?\*\//g, "");
|
|
34
|
+
}
|
|
35
|
+
|
|
30
36
|
const resetCSS = `
|
|
31
37
|
/*
|
|
32
38
|
1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
|
|
@@ -471,24 +477,34 @@ Make sure disabled buttons don't get the pointer cursor.
|
|
|
471
477
|
cursor: default;
|
|
472
478
|
}
|
|
473
479
|
`.trim();
|
|
474
|
-
function compressCSS(css) {
|
|
475
|
-
return css.replace(/\s+/g, " ").replace(/\/\*[\s\S]*?\*\//g, "");
|
|
476
|
-
}
|
|
477
480
|
const resetPreflight = {
|
|
478
481
|
layer: "preflights",
|
|
479
482
|
getCSS: () => compressCSS(resetCSS)
|
|
480
483
|
};
|
|
481
484
|
|
|
482
485
|
function getPreflights(options) {
|
|
486
|
+
const miniPreflights = getMiniPreflights();
|
|
483
487
|
if (isBoolean(options.preflights)) {
|
|
484
488
|
return options.preflights ? [
|
|
485
|
-
resetPreflight
|
|
489
|
+
resetPreflight,
|
|
490
|
+
miniPreflights
|
|
486
491
|
] : [];
|
|
487
492
|
}
|
|
488
493
|
return [
|
|
489
|
-
options.preflights.reset ? resetPreflight : void 0
|
|
494
|
+
options.preflights.reset ? resetPreflight : void 0,
|
|
495
|
+
options.preflights.mini ? miniPreflights : void 0
|
|
490
496
|
].filter(Boolean);
|
|
491
497
|
}
|
|
498
|
+
function getMiniPreflights() {
|
|
499
|
+
const entries = Object.entries(theme.preflightBase);
|
|
500
|
+
const css = entriesToCss(entries);
|
|
501
|
+
const roots = ["*,::before,::after", "::backdrop"];
|
|
502
|
+
const cssContent = roots.map((root) => `${root}{${css}}`).join("");
|
|
503
|
+
return {
|
|
504
|
+
layer: "preflights",
|
|
505
|
+
getCSS: () => compressCSS(cssContent)
|
|
506
|
+
};
|
|
507
|
+
}
|
|
492
508
|
|
|
493
509
|
const customShortcuts = [
|
|
494
510
|
["flex-center", "flex justify-center items-center"],
|
|
@@ -576,9 +592,7 @@ function camelToHyphen(str) {
|
|
|
576
592
|
const defaultOptions = {
|
|
577
593
|
theme: {},
|
|
578
594
|
enableDefaultShortcuts: true,
|
|
579
|
-
preflights:
|
|
580
|
-
reset: true
|
|
581
|
-
},
|
|
595
|
+
preflights: true,
|
|
582
596
|
// presets
|
|
583
597
|
wind: {
|
|
584
598
|
reset: false
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
const core = require('@unocss/core');
|
|
4
4
|
const perkakas = require('@vinicunca/perkakas');
|
|
5
|
+
const presetMini = require('@unocss/preset-mini');
|
|
6
|
+
const unocss = require('unocss');
|
|
5
7
|
|
|
6
8
|
const RE_RGB = /rgb\(([\d\s]+?)\s*\/\s*([^)]+)\)/;
|
|
7
9
|
const RE_RGBA = /rgba\(([\d\s,]+),\s*([^)]+)\)/;
|
|
@@ -29,6 +31,10 @@ function postprocessWithUnColor(unColor) {
|
|
|
29
31
|
};
|
|
30
32
|
}
|
|
31
33
|
|
|
34
|
+
function compressCSS(css) {
|
|
35
|
+
return css.replace(/\s+/g, " ").replace(/\/\*[\s\S]*?\*\//g, "");
|
|
36
|
+
}
|
|
37
|
+
|
|
32
38
|
const resetCSS = `
|
|
33
39
|
/*
|
|
34
40
|
1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
|
|
@@ -473,24 +479,34 @@ Make sure disabled buttons don't get the pointer cursor.
|
|
|
473
479
|
cursor: default;
|
|
474
480
|
}
|
|
475
481
|
`.trim();
|
|
476
|
-
function compressCSS(css) {
|
|
477
|
-
return css.replace(/\s+/g, " ").replace(/\/\*[\s\S]*?\*\//g, "");
|
|
478
|
-
}
|
|
479
482
|
const resetPreflight = {
|
|
480
483
|
layer: "preflights",
|
|
481
484
|
getCSS: () => compressCSS(resetCSS)
|
|
482
485
|
};
|
|
483
486
|
|
|
484
487
|
function getPreflights(options) {
|
|
488
|
+
const miniPreflights = getMiniPreflights();
|
|
485
489
|
if (perkakas.isBoolean(options.preflights)) {
|
|
486
490
|
return options.preflights ? [
|
|
487
|
-
resetPreflight
|
|
491
|
+
resetPreflight,
|
|
492
|
+
miniPreflights
|
|
488
493
|
] : [];
|
|
489
494
|
}
|
|
490
495
|
return [
|
|
491
|
-
options.preflights.reset ? resetPreflight : void 0
|
|
496
|
+
options.preflights.reset ? resetPreflight : void 0,
|
|
497
|
+
options.preflights.mini ? miniPreflights : void 0
|
|
492
498
|
].filter(Boolean);
|
|
493
499
|
}
|
|
500
|
+
function getMiniPreflights() {
|
|
501
|
+
const entries = Object.entries(presetMini.theme.preflightBase);
|
|
502
|
+
const css = unocss.entriesToCss(entries);
|
|
503
|
+
const roots = ["*,::before,::after", "::backdrop"];
|
|
504
|
+
const cssContent = roots.map((root) => `${root}{${css}}`).join("");
|
|
505
|
+
return {
|
|
506
|
+
layer: "preflights",
|
|
507
|
+
getCSS: () => compressCSS(cssContent)
|
|
508
|
+
};
|
|
509
|
+
}
|
|
494
510
|
|
|
495
511
|
const customShortcuts = [
|
|
496
512
|
["flex-center", "flex justify-center items-center"],
|
|
@@ -578,9 +594,7 @@ function camelToHyphen(str) {
|
|
|
578
594
|
const defaultOptions = {
|
|
579
595
|
theme: {},
|
|
580
596
|
enableDefaultShortcuts: true,
|
|
581
|
-
preflights:
|
|
582
|
-
reset: true
|
|
583
|
-
},
|
|
597
|
+
preflights: true,
|
|
584
598
|
// presets
|
|
585
599
|
wind: {
|
|
586
600
|
reset: false
|