teacss 0.1.5 → 0.1.7
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.cjs +5 -1
- package/dist/index.d.mts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +7 -3
- package/dist/index.mjs +2 -1
- package/package.json +10 -10
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as _unocss_core from '@unocss/core';
|
|
2
2
|
import { CSSObject, Arrayable, Preflight, PresetOptions, UserConfig } from '@unocss/core';
|
|
3
|
+
export { definePreset } from '@unocss/core';
|
|
3
4
|
|
|
4
5
|
declare const theme: {
|
|
5
6
|
aria: {
|
|
@@ -701,6 +702,8 @@ interface Theme {
|
|
|
701
702
|
};
|
|
702
703
|
preflightRoot?: Arrayable<string>;
|
|
703
704
|
preflightBase?: Record<string, string | number>;
|
|
705
|
+
preflightLight?: Record<string, string | number>;
|
|
706
|
+
preflightDark?: Record<string, string | number>;
|
|
704
707
|
}
|
|
705
708
|
|
|
706
709
|
declare const preflights: Preflight<Theme>[];
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as _unocss_core from '@unocss/core';
|
|
2
2
|
import { CSSObject, Arrayable, Preflight, PresetOptions, UserConfig } from '@unocss/core';
|
|
3
|
+
export { definePreset } from '@unocss/core';
|
|
3
4
|
|
|
4
5
|
declare const theme: {
|
|
5
6
|
aria: {
|
|
@@ -701,6 +702,8 @@ interface Theme {
|
|
|
701
702
|
};
|
|
702
703
|
preflightRoot?: Arrayable<string>;
|
|
703
704
|
preflightBase?: Record<string, string | number>;
|
|
705
|
+
preflightLight?: Record<string, string | number>;
|
|
706
|
+
preflightDark?: Record<string, string | number>;
|
|
704
707
|
}
|
|
705
708
|
|
|
706
709
|
declare const preflights: Preflight<Theme>[];
|
package/dist/index.js
CHANGED
|
@@ -1082,7 +1082,7 @@ function clearIdenticalEntries(entry) {
|
|
|
1082
1082
|
function entriesToCss(arr) {
|
|
1083
1083
|
if (arr == null)
|
|
1084
1084
|
return "";
|
|
1085
|
-
return clearIdenticalEntries(arr).map(([key, value]) => value != null ? `${key}:${value};` : undefined).filter(Boolean).join("");
|
|
1085
|
+
return clearIdenticalEntries(arr).map(([key, value]) => value != null && typeof value !== "function" ? `${key}:${value};` : undefined).filter(Boolean).join("");
|
|
1086
1086
|
}
|
|
1087
1087
|
function notNull(value) {
|
|
1088
1088
|
return value != null;
|
|
@@ -11488,6 +11488,9 @@ function transformThemeString(code2, theme, throwOnMissing = true) {
|
|
|
11488
11488
|
const [rawKey, alpha] = code2.split("/");
|
|
11489
11489
|
const keys = rawKey.trim().split(".");
|
|
11490
11490
|
let value = keys.reduce((t, k) => t?.[k], theme);
|
|
11491
|
+
if (typeof value === "object") {
|
|
11492
|
+
value = value.DEFAULT;
|
|
11493
|
+
}
|
|
11491
11494
|
if (typeof value === "string") {
|
|
11492
11495
|
if (alpha) {
|
|
11493
11496
|
const color = parseCssColor(value);
|
|
@@ -18405,11 +18408,11 @@ var preflightBase = {
|
|
|
18405
18408
|
};
|
|
18406
18409
|
var preflightLight = {
|
|
18407
18410
|
layer: "preflights",
|
|
18408
|
-
getCSS: () => getPreflightCss(tokenLight, [lightSelector])
|
|
18411
|
+
getCSS: (ctx) => getPreflightCss({ ...tokenLight, ...ctx.theme.preflightLight }, [lightSelector])
|
|
18409
18412
|
};
|
|
18410
18413
|
var preflightDark = {
|
|
18411
18414
|
layer: "preflights",
|
|
18412
|
-
getCSS: () => getPreflightCss(tokenDark, [darkSelector])
|
|
18415
|
+
getCSS: (ctx) => getPreflightCss({ ...tokenDark, ...ctx.theme.preflightDark }, [darkSelector])
|
|
18413
18416
|
};
|
|
18414
18417
|
var preflightSupportP3 = {
|
|
18415
18418
|
layer: "preflights",
|
|
@@ -22224,6 +22227,7 @@ export {
|
|
|
22224
22227
|
theme,
|
|
22225
22228
|
presetStyles,
|
|
22226
22229
|
preflights2 as preflights,
|
|
22230
|
+
definePreset,
|
|
22227
22231
|
defineConfig,
|
|
22228
22232
|
exports_colors as colors
|
|
22229
22233
|
};
|