feat(color)!: move colors to `.meta.themeOptions`
This commit is contained in:
parent
5575556d76
commit
6ecc806add
|
@ -56,13 +56,14 @@ npx jsonresume-theme-even < resume.json > resume.html
|
||||||
|
|
||||||
### Colors
|
### Colors
|
||||||
|
|
||||||
You can override theme colors via the `.meta.colors` resume field. Each entry defines a tuple of light and (optional) dark color values. If only one array value is defined, it will be used in both light and dark modes.
|
You can override theme colors via the `.meta.themeOptions.colors` resume field. Each entry defines a tuple of light and (optional) dark color values. If only one array value is defined, it will be used in both light and dark modes.
|
||||||
|
|
||||||
Here's an example using the default theme colors:
|
Here's an example using the default theme colors:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"meta": {
|
"meta": {
|
||||||
|
"themeOptions": {
|
||||||
"colors": {
|
"colors": {
|
||||||
"background": ["#ffffff", "#191e23"],
|
"background": ["#ffffff", "#191e23"],
|
||||||
"dimmed": ["#f3f4f5", "#23282d"],
|
"dimmed": ["#f3f4f5", "#23282d"],
|
||||||
|
@ -71,5 +72,6 @@ Here's an example using the default theme colors:
|
||||||
"accent": ["#0073aa", "#00a0d2"]
|
"accent": ["#0073aa", "#00a0d2"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
|
@ -8,10 +8,12 @@ const resume = {
|
||||||
...sampleResume,
|
...sampleResume,
|
||||||
meta: {
|
meta: {
|
||||||
...sampleResume.meta,
|
...sampleResume.meta,
|
||||||
|
themeOptions: {
|
||||||
colors: {
|
colors: {
|
||||||
background: ['lightgray', 'darkgray'],
|
background: ['lightgray', 'darkgray'],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
},
|
||||||
basics: {
|
basics: {
|
||||||
...sampleResume.basics,
|
...sampleResume.basics,
|
||||||
image: 'image.jpg',
|
image: 'image.jpg',
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
export default function colors(meta = {}) {
|
export default function colors(meta = {}) {
|
||||||
const { colors } = meta
|
const { colors } = meta.themeOptions || {}
|
||||||
return colors && Object.entries(colors)
|
return (
|
||||||
|
colors &&
|
||||||
|
Object.entries(colors)
|
||||||
.map(([name, [light, dark = light]]) => `--color-${name}-light:${light}; --color-${name}-dark:${dark};`)
|
.map(([name, [light, dark = light]]) => `--color-${name}-light:${light}; --color-${name}-dark:${dark};`)
|
||||||
.join(' ')
|
.join(' ')
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue