mirror of
https://github.com/tailwindlabs/tailwindcss.git
synced 2025-12-08 21:36:08 +00:00
drop withAlpha on theme (#9906)
This commit is contained in:
parent
b7c1bee131
commit
ab47cee503
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user