This commit is contained in:
OllieinCanada 2026-09-26 08:50:30 -04:00 • committed by GitHub
commit 2600d507a9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 47 additions and 1 deletions

View file

@ -4211,6 +4211,29 @@ describe('@custom-variant', () => {
`)
})
test('vendor-prefixed selector function variant', async () => {
expect(
await run(
['firefox:underline'],
css`
@custom-variant firefox (:-moz-any(&));
@layer utilities {
@tailwind utilities;
}
`,
),
).toMatchInlineSnapshot(`
"
@layer utilities {
:-moz-any(.firefox\\:underline) {
text-decoration-line: underline;
}
}
"
`)
})
test('at-rule variant', async () => {
expect(
await run(

View file

@ -284,6 +284,27 @@ describe('parse', () => {
])
})
it.each([':-moz-any', ':-webkit-any'])(
'should parse selector lists in vendor-prefixed functions (%s)',
(fn) => {
expect(parse(`${fn}(&, .foo)`)).toEqual([
{
kind: 'function',
value: fn,
nodes: [
{
kind: 'list',
nodes: [
{ kind: 'selector', value: '&' },
{ kind: 'selector', value: '.foo' },
],
},
],
},
])
},
)
it('should handle next-children combinator', () => {
expect(parse('.foo + p')).toEqual([
{

View file

@ -385,7 +385,9 @@ export function parse(input: string) {
node.value !== ':not' &&
node.value !== ':where' &&
node.value !== ':has' &&
node.value !== ':is'
node.value !== ':is' &&
node.value !== ':-moz-any' &&
node.value !== ':-webkit-any'
) {
// Find the end of the function call
let start = i + 1