vueless 0.0.473 → 0.0.474
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/constants.js +2 -0
- package/package.json +1 -1
- package/preset.tailwind.js +5 -4
- package/utils/utilTheme.js +17 -0
- package/utils/utilUI.js +1 -0
- package/web-types.json +1 -1
package/constants.js
CHANGED
|
@@ -13,6 +13,8 @@ export const DEFAULT_BRAND_COLOR = GRAYSCALE_COLOR;
|
|
|
13
13
|
export const DEFAULT_GRAY_COLOR = COOL_COLOR;
|
|
14
14
|
export const DEFAULT_RING = 4; /* pixels */
|
|
15
15
|
export const DEFAULT_RING_OFFSET = 0; /* pixels */
|
|
16
|
+
export const DEFAULT_RING_OFFSET_COLOR_LIGHT = "#ffffff"; // white
|
|
17
|
+
export const DEFAULT_RING_OFFSET_COLOR_DARK = "#4b5563"; // gray-600
|
|
16
18
|
export const DEFAULT_ROUNDING = 8; /* pixels */
|
|
17
19
|
|
|
18
20
|
/* Vueless supported colors and shades */
|
package/package.json
CHANGED
package/preset.tailwind.js
CHANGED
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
DEFAULT_ROUNDING,
|
|
10
10
|
DEFAULT_RING,
|
|
11
11
|
DEFAULT_RING_OFFSET,
|
|
12
|
+
DEFAULT_RING_OFFSET_COLOR_LIGHT,
|
|
12
13
|
} from "./constants.js";
|
|
13
14
|
|
|
14
15
|
const isStrategyOverride = process.env.VUELESS_STRATEGY === "override";
|
|
@@ -81,10 +82,9 @@ export const vuelessTailwindConfig = {
|
|
|
81
82
|
ringOffsetWidth: {
|
|
82
83
|
dynamic: "var(--vl-ring-offset)",
|
|
83
84
|
},
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
// },
|
|
85
|
+
ringOffsetColor: {
|
|
86
|
+
dynamic: "var(--vl-ring-offset-color)",
|
|
87
|
+
},
|
|
88
88
|
borderRadius: {
|
|
89
89
|
dynamic: "var(--vl-rounding)",
|
|
90
90
|
},
|
|
@@ -94,6 +94,7 @@ export const vuelessTailwindConfig = {
|
|
|
94
94
|
// TODO: Set colors from vueless.config.{js|ts} if it present.
|
|
95
95
|
"var(--vl-ring)": DEFAULT_RING,
|
|
96
96
|
"var(--vl-ring-offset)": DEFAULT_RING_OFFSET,
|
|
97
|
+
"var(--vl-ring-offset-color)": DEFAULT_RING_OFFSET_COLOR_LIGHT,
|
|
97
98
|
"var(--vl-rounding)": DEFAULT_ROUNDING,
|
|
98
99
|
...getReplacementColors(GRAY_COLOR, GRAY_COLOR),
|
|
99
100
|
...getReplacementColors(BRAND_COLOR, GRAY_COLOR),
|
package/utils/utilTheme.js
CHANGED
|
@@ -9,6 +9,8 @@ import {
|
|
|
9
9
|
GRAYSCALE_COLOR,
|
|
10
10
|
DEFAULT_RING,
|
|
11
11
|
DEFAULT_RING_OFFSET,
|
|
12
|
+
DEFAULT_RING_OFFSET_COLOR_LIGHT,
|
|
13
|
+
DEFAULT_RING_OFFSET_COLOR_DARK,
|
|
12
14
|
DEFAULT_ROUNDING,
|
|
13
15
|
DEFAULT_BRAND_COLOR,
|
|
14
16
|
DEFAULT_GRAY_COLOR,
|
|
@@ -33,6 +35,17 @@ export function setTheme(config = {}) {
|
|
|
33
35
|
const isDarkMode = setDarkMode(config);
|
|
34
36
|
const ring = config?.ring ?? vuelessConfig.ring ?? DEFAULT_RING;
|
|
35
37
|
const ringOffset = config?.ringOffset ?? vuelessConfig.ringOffset ?? DEFAULT_RING_OFFSET;
|
|
38
|
+
|
|
39
|
+
const defaultRingOffsetColorDark =
|
|
40
|
+
config?.ringOffsetColorDark ??
|
|
41
|
+
vuelessConfig.ringOffsetColorDark ??
|
|
42
|
+
DEFAULT_RING_OFFSET_COLOR_DARK;
|
|
43
|
+
|
|
44
|
+
const defaultRingOffsetColorLight =
|
|
45
|
+
config?.ringOffsetColorLight ??
|
|
46
|
+
vuelessConfig.ringOffsetColorLight ??
|
|
47
|
+
DEFAULT_RING_OFFSET_COLOR_LIGHT;
|
|
48
|
+
|
|
36
49
|
const rounding = config?.rounding ?? vuelessConfig.rounding ?? DEFAULT_ROUNDING;
|
|
37
50
|
let brand = config?.brand ?? vuelessConfig.brand ?? DEFAULT_BRAND_COLOR;
|
|
38
51
|
let gray = config?.gray ?? vuelessConfig.gray ?? DEFAULT_GRAY_COLOR;
|
|
@@ -52,6 +65,9 @@ export function setTheme(config = {}) {
|
|
|
52
65
|
|
|
53
66
|
const defaultBrandShade = isDarkMode ? 400 : 600;
|
|
54
67
|
const defaultGrayShade = isDarkMode ? 400 : 600;
|
|
68
|
+
const defaultRingOffsetColor = isDarkMode
|
|
69
|
+
? defaultRingOffsetColorDark
|
|
70
|
+
: defaultRingOffsetColorLight;
|
|
55
71
|
|
|
56
72
|
if (gray === COOL_COLOR) {
|
|
57
73
|
gray = GRAY_COLOR;
|
|
@@ -64,6 +80,7 @@ export function setTheme(config = {}) {
|
|
|
64
80
|
const variables = {
|
|
65
81
|
"--vl-ring": `${ring}px`,
|
|
66
82
|
"--vl-ring-offset": `${ringOffset}px`,
|
|
83
|
+
"--vl-ring-offset-color": `rgb(${convertHexInRgb(defaultRingOffsetColor)})`,
|
|
67
84
|
"--vl-rounding": `${Number(rounding) / PX_IN_REM}rem`,
|
|
68
85
|
"--vl-color-gray-default": convertHexInRgb(colors[gray][defaultBrandShade]),
|
|
69
86
|
"--vl-color-brand-default": convertHexInRgb(colors[brand][defaultGrayShade]),
|
package/utils/utilUI.js
CHANGED
|
@@ -55,6 +55,7 @@ const twMerge = extendTailwindMerge(
|
|
|
55
55
|
classGroups: {
|
|
56
56
|
"ring-w": [{ ring: ["dynamic"] }],
|
|
57
57
|
"ring-offset-w": [{ "ring-offset": ["dynamic"] }],
|
|
58
|
+
"ring-offset-color": [{ "ring-offset": ["dynamic"] }],
|
|
58
59
|
"font-size": [{ text: ["2xs"] }],
|
|
59
60
|
rounded: [{ rounded: ["dynamic"] }],
|
|
60
61
|
},
|