Handle variants when the same class appears multiple times in a selector (#10397)
This commit is contained in:
parent
937ac139a1
commit
667eac5e88
2 changed files with 28 additions and 1 deletions
|
|
@ -218,7 +218,7 @@ export function finalizeSelector(current, formats, { context, candidate, base })
|
|||
parent.insertAfter(simpleSelector[simpleSelector.length - 1], simpleEnd)
|
||||
|
||||
for (let child of formatNodes) {
|
||||
parent.insertBefore(simpleSelector[0], child)
|
||||
parent.insertBefore(simpleSelector[0], child.clone())
|
||||
}
|
||||
|
||||
node.remove()
|
||||
|
|
|
|||
|
|
@ -922,4 +922,31 @@ crosscheck(({ stable, oxide }) => {
|
|||
`)
|
||||
})
|
||||
})
|
||||
|
||||
it('should not crash when matching variants where utility classes are doubled up', () => {
|
||||
let config = {
|
||||
content: [
|
||||
{
|
||||
raw: '<div class="hover:foo"></div>',
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
let input = css`
|
||||
@tailwind utilities;
|
||||
@layer utilities {
|
||||
.foo.foo {
|
||||
text-decoration-line: underline;
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
return run(input, config).then((result) => {
|
||||
expect(result.css).toMatchFormattedCss(css`
|
||||
.hover\:foo:hover.hover\:foo:hover {
|
||||
text-decoration-line: underline;
|
||||
}
|
||||
`)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue