|
@@ -1,7 +1,7 @@
|
|
import { reactive, watch } from 'vue';
|
|
import { reactive, watch } from 'vue';
|
|
|
|
|
|
import { preferences } from '@vben/preferences';
|
|
import { preferences } from '@vben/preferences';
|
|
-import { updateCSSVariables } from '@vben/utils';
|
|
|
|
|
|
+import { hlsStringToRGBString, updateCSSVariables } from '@vben/utils';
|
|
|
|
|
|
/**
|
|
/**
|
|
* 用于适配各个框架的设计系统
|
|
* 用于适配各个框架的设计系统
|
|
@@ -102,7 +102,7 @@ export function useNaiveDesignTokens() {
|
|
|
|
|
|
const getCssVariableValue = (variable: string, isColor: boolean = true) => {
|
|
const getCssVariableValue = (variable: string, isColor: boolean = true) => {
|
|
const value = rootStyles.getPropertyValue(variable);
|
|
const value = rootStyles.getPropertyValue(variable);
|
|
- return isColor ? `hsl(${value})` : value;
|
|
|
|
|
|
+ return isColor ? hlsStringToRGBString(value) : value;
|
|
};
|
|
};
|
|
|
|
|
|
watch(
|
|
watch(
|
|
@@ -150,7 +150,6 @@ export function useNaiveDesignTokens() {
|
|
},
|
|
},
|
|
{ immediate: true },
|
|
{ immediate: true },
|
|
);
|
|
);
|
|
-
|
|
|
|
return {
|
|
return {
|
|
commonTokens,
|
|
commonTokens,
|
|
};
|
|
};
|