This commit is contained in:
dap
2024-08-07 13:34:24 +08:00
10 changed files with 83 additions and 16 deletions

View File

@@ -1,7 +1,7 @@
import { reactive, watch } from 'vue';
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 value = rootStyles.getPropertyValue(variable);
return isColor ? `hsl(${value})` : value;
return isColor ? hlsStringToRGBString(value) : value;
};
watch(
@@ -150,7 +150,6 @@ export function useNaiveDesignTokens() {
},
{ immediate: true },
);
return {
commonTokens,
};