Skip to content

Commit

Permalink
Fix overriding default colours
Browse files Browse the repository at this point in the history
  • Loading branch information
catuhana committed Mar 18, 2024
1 parent 71aa4f5 commit 279a71c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/extend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ export const extendTheme = (options: ExtendOptions = {}) => {
if (defaultFlavour && flavours[defaultFlavour]) {
// Iterate through the colours of the flavours and add them to the target
for (let [colourName, colour] of flavours[defaultFlavour].colorEntries) {
target[colourName] = colour.hex;
if (!prefix && target[colourName]) {
target['ctp'] ??= {};
target['ctp'][colourName] = colour.hex;
} else {
target[colourName] = colour.hex;
}
}
}
// If `defaultFlavour` is not set, or if it doesn't exist:
Expand Down

0 comments on commit 279a71c

Please sign in to comment.