Merge 03c029ed8f into fa81d697fe
This commit is contained in:
commit
2600d507a9
3 changed files with 47 additions and 1 deletions
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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([
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue