Skip to content

Commit

Permalink
feat: override palette in hyper config (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
Apthox committed Feb 2, 2023
1 parent 00d6227 commit 29c1502
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
10 changes: 10 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,16 @@ exports.decorateConfig = (config) => {
const variant = (config.theme && config.theme.variant) || "core";
const palette = variants[variant];

if (
config.theme &&
Object.keys(config.theme).includes(variant) &&
typeof config.theme[variant] === 'object'
) {
for (const param of Object.keys(config.theme[variant])) {
palette[param] = config.theme[variant][param]
}
}

const colors = {
black: palette.overlay,
lightBlack: palette.subtle,
Expand Down
3 changes: 3 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ config: {
// Default: core
// Can be core, moon or dawn
variant: 'dawn',
dawn: {
inactive: '#DFFF00'
}
}
}
```
Expand Down

0 comments on commit 29c1502

Please sign in to comment.