Skip to content

Commit

Permalink
perf: custom theme merge logic.
Browse files Browse the repository at this point in the history
  • Loading branch information
riccox committed Feb 6, 2023
1 parent 93048e5 commit ddd9a1c
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions packages/tailwind/src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,13 @@ const config = plugin.withOptions(

if (siraThemes.length > 0) {
siraThemes.forEach((theme) => {
let mergedTheme: Theme = {
prefersColorScheme: false,
colors: {},
...theme,
};
let mergedTheme: Theme;

// merge built-in themes
if (theme.colorScheme === 'light') {
mergedTheme = _.merge(lightTheme, theme);
} else if (theme.colorScheme === 'dark') {
if (theme.colorScheme === 'dark') {
mergedTheme = _.merge(darkTheme, theme);
} else {
mergedTheme = _.merge(lightTheme, theme);
}

addBase([
Expand Down

0 comments on commit ddd9a1c

Please sign in to comment.