Skip to content

Commit f8ce5da

Browse files
committed
format user nodes in @responsive
Otherwise the wrong indentation is being used.
1 parent 12fe7d6 commit f8ce5da

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

packages/@tailwindcss-upgrade/src/codemods/migrate-tailwind-directives.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ it('should replace `@responsive` with its children', async () => {
414414
`),
415415
).toMatchInlineSnapshot(`
416416
".foo {
417-
color: red;
418-
}"
417+
color: red;
418+
}"
419419
`)
420420
})

packages/@tailwindcss-upgrade/src/codemods/migrate-tailwind-directives.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ export function migrateTailwindDirectives(options: { newPrefix: string | null })
5858
// Replace Tailwind CSS v2 directives that still worked in v3.
5959
else if (node.name === 'responsive') {
6060
if (node.nodes) {
61+
for (let child of node.nodes) {
62+
child.raws.tailwind_pretty = true
63+
}
6164
node.replaceWith(node.nodes)
6265
} else {
6366
node.remove()

0 commit comments

Comments
 (0)