diff --git a/src/lib/evaluateTailwindFunctions.js b/src/lib/evaluateTailwindFunctions.js index 1d742aa0df85..033ceca379d2 100644 --- a/src/lib/evaluateTailwindFunctions.js +++ b/src/lib/evaluateTailwindFunctions.js @@ -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) diff --git a/src/util/transformThemeValue.js b/src/util/transformThemeValue.js index 3e4fcdc6004f..5b24ee7110d8 100644 --- a/src/util/transformThemeValue.js +++ b/src/util/transformThemeValue.js @@ -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 }