From 33dcd44dbe7d4c493f436f5b2ae55d88c8b19e06 Mon Sep 17 00:00:00 2001 From: Dylan Vann Date: Sun, 7 Feb 2021 14:57:57 -0500 Subject: [PATCH] Fix function colors bug (#2919) --- src/lib/evaluateTailwindFunctions.js | 1 + src/util/transformThemeValue.js | 4 ++++ 2 files changed, 5 insertions(+) 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 }