mirror of
https://github.com/aphrody-labs/tailwindcss.git
synced 2026-10-17 12:45:52 +00:00
drop withAlpha on theme (#9906)
This commit is contained in:
1 parent
b7c1bee131
commit
ab47cee503
1 file changed
+4
-11
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user