vueless 0.0.492 → 0.0.493
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 +1 -1
- package/index.ts +2 -1
- package/package.json +1 -1
- package/preset-tailwind.js +1 -1
- package/utils/theme.ts +19 -5
- package/web-types.json +1 -1
package/constants.js
CHANGED
|
@@ -19,7 +19,7 @@ export const DEFAULT_GRAY_COLOR = COOL_COLOR;
|
|
|
19
19
|
export const DEFAULT_RING = 4; /* pixels */
|
|
20
20
|
export const DEFAULT_RING_OFFSET = 0; /* pixels */
|
|
21
21
|
export const DEFAULT_RING_OFFSET_COLOR_LIGHT = "#ffffff"; // white
|
|
22
|
-
export const DEFAULT_RING_OFFSET_COLOR_DARK = "#
|
|
22
|
+
export const DEFAULT_RING_OFFSET_COLOR_DARK = "#111827"; // gray-900
|
|
23
23
|
export const DEFAULT_ROUNDING = 8; /* pixels */
|
|
24
24
|
|
|
25
25
|
/* Vueless supported colors and shades */
|
package/index.ts
CHANGED
package/package.json
CHANGED
package/preset-tailwind.js
CHANGED
|
@@ -96,7 +96,7 @@ export const vuelessTailwindConfig = {
|
|
|
96
96
|
dynamic: "var(--vl-ring-offset)",
|
|
97
97
|
},
|
|
98
98
|
ringOffsetColor: {
|
|
99
|
-
|
|
99
|
+
DEFAULT: twColorWithOpacity("--vl-ring-offset-color"),
|
|
100
100
|
},
|
|
101
101
|
},
|
|
102
102
|
configViewer: {
|
package/utils/theme.ts
CHANGED
|
@@ -144,12 +144,26 @@ function setDarkMode(config: InternalThemeConfig) {
|
|
|
144
144
|
? isCSR && localStorage.removeItem(DARK_MODE_SELECTOR)
|
|
145
145
|
: isCSR && localStorage.setItem(DARK_MODE_SELECTOR, Number(config?.darkMode).toString());
|
|
146
146
|
|
|
147
|
-
|
|
147
|
+
let storedDarkMode = null;
|
|
148
|
+
let darkModeAsClass = null;
|
|
148
149
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
150
|
+
if (isCSR) {
|
|
151
|
+
const classList = document.documentElement.classList;
|
|
152
|
+
|
|
153
|
+
storedDarkMode = localStorage.getItem(DARK_MODE_SELECTOR);
|
|
154
|
+
darkModeAsClass = classList.contains(DARK_MODE_SELECTOR) ? true : null;
|
|
155
|
+
darkModeAsClass = classList.contains(LIGHT_MODE_SELECTOR) ? false : null;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
let isDarkMode = !!(config?.darkMode ?? vuelessConfig.darkMode ?? config?.systemDarkMode);
|
|
159
|
+
|
|
160
|
+
if (storedDarkMode !== null) {
|
|
161
|
+
isDarkMode = !!Number(storedDarkMode);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
if (darkModeAsClass !== null) {
|
|
165
|
+
isDarkMode = darkModeAsClass;
|
|
166
|
+
}
|
|
153
167
|
|
|
154
168
|
if (isCSR) {
|
|
155
169
|
if (isDarkMode) {
|