vueless 0.0.124 → 0.0.125
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/package.json +1 -1
- package/preset.tailwind/index.js +15 -3
- package/web-types.json +1 -1
package/package.json
CHANGED
package/preset.tailwind/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import colors from "tailwindcss/colors.js";
|
|
2
1
|
import forms from "@tailwindcss/forms";
|
|
3
2
|
import { BRAND_COLORS, GRAY_COLORS, GRAYSCALE_COLOR } from "./constants/index.js";
|
|
4
3
|
|
|
@@ -10,6 +9,11 @@ export function vuelessPreset() {
|
|
|
10
9
|
const isProd = process.env.NODE_ENV === "production";
|
|
11
10
|
const brandColor = twColorWithOpacity("--color-brand");
|
|
12
11
|
const { brand, gray } = getVuelessConfig();
|
|
12
|
+
const colors = getTailwindColorsConfig();
|
|
13
|
+
|
|
14
|
+
if (!Object.keys(colors).length) {
|
|
15
|
+
return {};
|
|
16
|
+
}
|
|
13
17
|
|
|
14
18
|
let brandPalette = BRAND_COLORS.includes(brand) ? colors[brand] : colors.green;
|
|
15
19
|
let grayPalette = GRAY_COLORS.includes(gray) ? colors[gray] : colors.zinc;
|
|
@@ -70,10 +74,18 @@ function twColorWithOpacity(variableName) {
|
|
|
70
74
|
|
|
71
75
|
/**
|
|
72
76
|
* Convert sting to object.
|
|
73
|
-
* @returns {
|
|
77
|
+
* @returns {Object} - TailwindCSS safelist.
|
|
78
|
+
*/
|
|
79
|
+
function getTailwindColorsConfig() {
|
|
80
|
+
return JSON.parse(process.env.VUELESS_TAILWIND_COLORS_CONFIG_JSON || "{}");
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Convert sting to object.
|
|
85
|
+
* @returns {Object} - TailwindCSS safelist.
|
|
74
86
|
*/
|
|
75
87
|
function getVuelessConfig() {
|
|
76
|
-
return JSON.parse(process.env.VUELESS_CONFIG_JSON || "
|
|
88
|
+
return JSON.parse(process.env.VUELESS_CONFIG_JSON || "{}");
|
|
77
89
|
}
|
|
78
90
|
|
|
79
91
|
/**
|