vueless 1.2.15-beta.6 → 1.2.15-beta.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/constants.d.ts +1 -0
- package/constants.js +1 -0
- package/package.json +1 -1
- package/utils/theme.ts +13 -6
package/constants.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export const COLOR_MODE_KEY: "vl-color-mode";
|
|
|
16
16
|
export const AUTO_MODE_KEY: "vl-auto-mode";
|
|
17
17
|
export const DARK_MODE_CLASS: "vl-dark";
|
|
18
18
|
export const LIGHT_MODE_CLASS: "vl-light";
|
|
19
|
+
export const THEME_TOKENS: "vueless-theme-tokens";
|
|
19
20
|
export const DEFAULT_PRIMARY_COLOR: "grayscale";
|
|
20
21
|
export const DEFAULT_NEUTRAL_COLOR: "gray";
|
|
21
22
|
export const DEFAULT_TEXT: 14;
|
package/constants.js
CHANGED
|
@@ -26,6 +26,7 @@ export const COLOR_MODE_KEY = "vl-color-mode";
|
|
|
26
26
|
export const AUTO_MODE_KEY = "vl-auto-mode";
|
|
27
27
|
export const DARK_MODE_CLASS = "vl-dark";
|
|
28
28
|
export const LIGHT_MODE_CLASS = "vl-light";
|
|
29
|
+
export const THEME_TOKENS = "vueless-theme-tokens";
|
|
29
30
|
|
|
30
31
|
/* Vueless defaults */
|
|
31
32
|
export const DEFAULT_PRIMARY_COLOR = GRAYSCALE_COLOR;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vueless",
|
|
3
|
-
"version": "1.2.15-beta.
|
|
3
|
+
"version": "1.2.15-beta.7",
|
|
4
4
|
"description": "Vue Styleless UI Component Library, powered by Tailwind CSS.",
|
|
5
5
|
"author": "Johnny Grid <hello@vueless.com> (https://vueless.com)",
|
|
6
6
|
"homepage": "https://vueless.com",
|
package/utils/theme.ts
CHANGED
|
@@ -898,14 +898,21 @@ function setCSSVariables(
|
|
|
898
898
|
`;
|
|
899
899
|
|
|
900
900
|
if (isCSR) {
|
|
901
|
-
const
|
|
902
|
-
|
|
901
|
+
const vuelessStyleId = "vueless-theme-tokens";
|
|
902
|
+
let style = document.getElementById(vuelessStyleId) as HTMLStyleElement | null;
|
|
903
903
|
|
|
904
|
-
style
|
|
904
|
+
if (!style) {
|
|
905
|
+
style = document.createElement("style");
|
|
906
|
+
style.id = vuelessStyleId;
|
|
907
|
+
|
|
908
|
+
const firstStyleOrLink = document.querySelector("link[rel='stylesheet'], style");
|
|
905
909
|
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
910
|
+
firstStyleOrLink && firstStyleOrLink.parentNode
|
|
911
|
+
? firstStyleOrLink.parentNode.insertBefore(style, firstStyleOrLink)
|
|
912
|
+
: document.head.appendChild(style);
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
style.innerHTML = rootVariables;
|
|
909
916
|
}
|
|
910
917
|
|
|
911
918
|
return rootVariables;
|