Fix function colors bug (#2919)

This commit is contained in:
Dylan Vann 2021-02-07 14:57:57 -05:00 • committed by GitHub
parent e86b586f4b
commit 33dcd44dbe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View file

@ -78,6 +78,7 @@ function validatePath(config, path, defaultValue) {
!(
typeof value === 'string' ||
typeof value === 'number' ||
typeof value === 'function' ||
value instanceof String ||
value instanceof Number ||
Array.isArray(value)

View file

@ -21,5 +21,9 @@ export default function transformThemeValue(themeSection) {
return (value) => (Array.isArray(value) ? value.join(', ') : value)
}
if (themeSection === 'colors') {
return (value) => (typeof value === 'function' ? value({}) : value)
}
return (value) => value
}