From ab47cee503bdb485035bf438e1b97b3d53f8bc77 Mon Sep 17 00:00:00 2001 From: Robin Malfait Date: Fri, 25 Nov 2022 14:03:50 +0100 Subject: [PATCH] drop withAlpha on `theme` (#9906) --- src/lib/setupContextUtils.js | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/lib/setupContextUtils.js b/src/lib/setupContextUtils.js index b3f6b4ab7..0912ffab7 100644 --- a/src/lib/setupContextUtils.js +++ b/src/lib/setupContextUtils.js @@ -253,25 +253,18 @@ function buildPluginApi(tailwindConfig, context, { variantList, variantMap, offs } function resolveThemeValue(path, defaultValue, opts = {}) { - const [pathRoot, ...subPaths] = toPath(path) - const value = getConfigValue(['theme', pathRoot, ...subPaths], defaultValue) - return transformThemeValue(pathRoot)(value, opts) + let parts = toPath(path) + let value = getConfigValue(['theme', ...parts], defaultValue) + return transformThemeValue(parts[0])(value, opts) } - const theme = Object.assign( - (path, defaultValue = undefined) => resolveThemeValue(path, defaultValue), - { - withAlpha: (path, opacityValue) => resolveThemeValue(path, undefined, { opacityValue }), - } - ) - let variantIdentifier = 0 let api = { postcss, prefix: applyConfiguredPrefix, e: escapeClassName, config: getConfigValue, - theme, + theme: resolveThemeValue, corePlugins: (path) => { if (Array.isArray(tailwindConfig.corePlugins)) { return tailwindConfig.corePlugins.includes(path)