Skip to content

Commit 397f8ea

Browse files
committed
chore: optimize
1 parent 3f69c95 commit 397f8ea

File tree

4 files changed

+2
-16
lines changed

4 files changed

+2
-16
lines changed

src/hooks/useVariables.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { ref } from '@vue/composition-api';
22
import type { Ref } from '@vue/composition-api';
33
import { isString } from 'lodash-es';
4-
import { getColorTokenColor } from '../utils/dom';
4+
import { getColorTokenColor } from '../_common/js/utils/getColorTokenColor';
55
import { THEME_MODE } from '../_common/js/common';
66
import useMutationObservable from './useMutationObservable';
77

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
import { mount } from '@vue/test-utils';
2-
import {
3-
describe, it, vi, expect,
4-
} from 'vitest';
52
import { QRCode, TdQRCodeProps } from '../index';
63

74
describe('QRCode', () => {

src/utils/dom.ts

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -359,14 +359,3 @@ export function getWindowSize(): { width: number; height: number } {
359359
const doc = document.documentElement;
360360
return { width: doc.clientWidth, height: doc.clientHeight };
361361
}
362-
363-
/**
364-
* 获取颜色token的色值
365-
* @example getColorTokenColor('--td-brand-color')
366-
* @returns string
367-
*/
368-
export const getColorTokenColor = (token: string): string => {
369-
const targetElement = document?.documentElement;
370-
const styles = getComputedStyle(targetElement);
371-
return styles.getPropertyValue(token).trim() ?? '';
372-
};

0 commit comments

Comments
 (0)