diff --git a/packages/tailwind/src/__snapshots__/tailwind.spec.tsx.snap b/packages/tailwind/src/__snapshots__/tailwind.spec.tsx.snap index c6edea3134..8e7dbf3d32 100644 --- a/packages/tailwind/src/__snapshots__/tailwind.spec.tsx.snap +++ b/packages/tailwind/src/__snapshots__/tailwind.spec.tsx.snap @@ -140,6 +140,23 @@ exports[`Tailwind component > with non-inlinable styles > adds css to an " `; +exports[`Tailwind component > with non-inlinable styles > handles non-inlinable styles in custom utilities 1`] = ` +" + + + + + + +
+ + + +" +`; + exports[`Tailwind component > with non-inlinable styles > persists existing elements 1`] = ` " diff --git a/packages/tailwind/src/tailwind.spec.tsx b/packages/tailwind/src/tailwind.spec.tsx index 292521e000..65e9299e5c 100644 --- a/packages/tailwind/src/tailwind.spec.tsx +++ b/packages/tailwind/src/tailwind.spec.tsx @@ -378,6 +378,34 @@ describe('Tailwind component', () => { ).toMatchSnapshot(); }); + it('handles non-inlinable styles in custom utilities', async () => { + const actualOutput = await render( + + { + api.addUtilities({ + '.text-body': { + '@apply text-[green] sm:text-[darkgreen]': {}, + }, + }); + }, + }, + ], + }} + > + + +
+ + + , + ).then(pretty); + expect(actualOutput).toMatchSnapshot(); + }); + it('adds css to and keep class names', async () => { const actualOutput = await render(