perf: improve the dark theme

This commit is contained in:
vince
2024-07-15 23:59:22 +08:00
parent f95d9aa609
commit cf16c7bdde
12 changed files with 124 additions and 199 deletions

View File

@@ -1,8 +1,9 @@
import { DEFAULT_NAMESPACE } from '@vben-core/constants';
/**
* @see copy https://github.com/element-plus/element-plus/blob/dev/packages/hooks/use-namespace/index.ts
*/
export const defaultNamespace = 'vben';
const statePrefix = 'is-';
const _bem = (
@@ -35,7 +36,7 @@ const is: {
};
const useNamespace = (block: string) => {
const namespace = defaultNamespace;
const namespace = DEFAULT_NAMESPACE;
const b = (blockSuffix = '') => _bem(namespace, block, blockSuffix, '', '');
const e = (element?: string) =>
element ? _bem(namespace, block, '', element, '') : '';