Remove support for returning an array of functions in matchUtilities
Can add again if we need it?
This commit is contained in:
parent
cd2db712c5
commit
297cb675df
2 changed files with 17 additions and 19 deletions
|
|
@ -518,15 +518,15 @@ function buildPluginApi(tailwindConfig, context, { variantList, variantMap, offs
|
|||
|
||||
for (let identifier in base) {
|
||||
let prefixedIdentifier = prefixIdentifier(identifier, options)
|
||||
let value = [].concat(base[identifier])
|
||||
let rule = base[identifier]
|
||||
|
||||
let withOffsets = value.map((rule) => [{ sort: offset, layer: 'base' }, rule])
|
||||
let withOffsets = [{ sort: offset, layer: 'base' }, rule]
|
||||
|
||||
if (!context.candidateRuleMap.has(prefixedIdentifier)) {
|
||||
context.candidateRuleMap.set(prefixedIdentifier, [])
|
||||
}
|
||||
|
||||
context.candidateRuleMap.get(prefixedIdentifier).push(...withOffsets)
|
||||
context.candidateRuleMap.get(prefixedIdentifier).push(withOffsets)
|
||||
}
|
||||
},
|
||||
matchUtilities: function (utilities, options) {
|
||||
|
|
@ -543,15 +543,15 @@ function buildPluginApi(tailwindConfig, context, { variantList, variantMap, offs
|
|||
|
||||
for (let identifier in utilities) {
|
||||
let prefixedIdentifier = prefixIdentifier(identifier, options)
|
||||
let value = [].concat(utilities[identifier])
|
||||
let rule = utilities[identifier]
|
||||
|
||||
let withOffsets = value.map((rule) => [{ sort: offset, layer: 'utilities', options }, rule])
|
||||
let withOffsets = [{ sort: offset, layer: 'utilities', options }, rule]
|
||||
|
||||
if (!context.candidateRuleMap.has(prefixedIdentifier)) {
|
||||
context.candidateRuleMap.set(prefixedIdentifier, [])
|
||||
}
|
||||
|
||||
context.candidateRuleMap.get(prefixedIdentifier).push(...withOffsets)
|
||||
context.candidateRuleMap.get(prefixedIdentifier).push(withOffsets)
|
||||
}
|
||||
},
|
||||
// ---
|
||||
|
|
|
|||
|
|
@ -20,22 +20,20 @@ export default function () {
|
|||
)
|
||||
|
||||
matchUtilities({
|
||||
animate: [
|
||||
(modifier, { theme }) => {
|
||||
let value = theme.animation[modifier]
|
||||
animate: (modifier, { theme }) => {
|
||||
let value = theme.animation[modifier]
|
||||
|
||||
if (value === undefined) {
|
||||
return []
|
||||
}
|
||||
if (value === undefined) {
|
||||
return []
|
||||
}
|
||||
|
||||
let { name: animationName } = parseAnimationValue(value)
|
||||
let { name: animationName } = parseAnimationValue(value)
|
||||
|
||||
return [
|
||||
keyframes[animationName],
|
||||
{ [nameClass('animate', modifier)]: { animation: value } },
|
||||
].filter(Boolean)
|
||||
},
|
||||
],
|
||||
return [
|
||||
keyframes[animationName],
|
||||
{ [nameClass('animate', modifier)]: { animation: value } },
|
||||
].filter(Boolean)
|
||||
},
|
||||
})
|
||||
} else {
|
||||
const prefixName = (name) => prefix(`.${name}`).slice(1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue