2023-09-28 02:50:43 +02:00
|
|
|
/** @typedef {Record<string, [light: string, dark?: string]>} ThemeColorOptions */
|
|
|
|
/** @typedef {{ colors?: ThemeColorOptions }} ThemeOptions */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {import('../schema.d.ts').ResumeSchema['meta'] & { themeOptions?: ThemeOptions }} meta
|
|
|
|
* @returns {string | undefined}
|
|
|
|
*/
|
2023-09-04 02:29:45 +02:00
|
|
|
export default function colors(meta = {}) {
|
2023-09-28 02:50:43 +02:00
|
|
|
const colors = meta.themeOptions?.colors
|
2023-09-17 00:54:31 +02:00
|
|
|
return (
|
|
|
|
colors &&
|
|
|
|
Object.entries(colors)
|
|
|
|
.map(([name, [light, dark = light]]) => `--color-${name}-light:${light}; --color-${name}-dark:${dark};`)
|
|
|
|
.join(' ')
|
|
|
|
)
|
2023-09-04 02:29:45 +02:00
|
|
|
}
|