Skip to content

Commit

Permalink
fix: support for special theme key 'DEFAULT'
Browse files Browse the repository at this point in the history
  • Loading branch information
nado1001 committed Jun 18, 2023
1 parent b3df690 commit 5415a38
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ export const makeNestedObject = <T extends readonly string[]>(
}
obj = obj[key]
}
obj[camelCase(keys[lastIndex])] = value

// https://v2.tailwindcss.com/docs/upgrading-to-v2#update-default-theme-keys-to-default
if (keys[lastIndex] === 'DEFAULT') {
obj[keys[lastIndex]] = value
} else {
obj[camelCase(keys[lastIndex])] = value
}
}

export const getConfigValue = <T>(value: T | undefined, defaultValue: T) => {
Expand Down

0 comments on commit 5415a38

Please sign in to comment.