Skip to content

Commit

Permalink
feat(theme): more performance improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
SutuSebastian committed Jan 22, 2025
1 parent ec5d379 commit 67305c0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/ui/src/helpers/resolve-theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ export function resolveTheme<T>(
applyThemeList?: DeepPartialApplyTheme<T>[],
): T {
const prefix = getPrefix();
const _custom = custom?.filter((value) => value !== undefined);
const _clearThemeList = clearThemeList?.filter((value) => value !== undefined);
const _applyThemeList = applyThemeList?.filter((value) => value !== undefined);
const _custom = custom?.length ? custom?.filter((value) => value !== undefined) : undefined;
const _clearThemeList = clearThemeList?.length ? clearThemeList?.filter((value) => value !== undefined) : undefined;
const _applyThemeList = applyThemeList?.length ? applyThemeList?.filter((value) => value !== undefined) : undefined;
const baseTheme = _clearThemeList?.length || prefix ? klona(base) : base;

if (_clearThemeList?.length) {
Expand Down Expand Up @@ -92,7 +92,7 @@ export function resolveTheme<T>(
let theme = baseTheme;

if (_custom?.length) {
theme = deepMergeStrings(twMerge)(baseTheme, ...custom) as T;
theme = deepMergeStrings(twMerge)(baseTheme, ..._custom) as T;
}

if (_applyThemeList?.length && _custom?.length) {
Expand Down

0 comments on commit 67305c0

Please sign in to comment.