Add the bg-gradient migration to the default list of template migrations (#14538)

Quick follow-up from #14537 as I forgot to add the new migration to the
default list of migrations.
This commit is contained in:
Philipp Spiess 2024-09-27 17:22:00 +02:00 committed by GitHub
parent 64497e380f
commit b16444fc3a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 3 deletions

View File

@ -19,7 +19,7 @@ test(
`,
'src/index.html': html`
<h1>🤠👋</h1>
<div class="!flex sm:!block"></div>
<div class="!flex sm:!block bg-gradient-to-t"></div>
`,
'src/input.css': css`
@tailwind base;
@ -35,7 +35,7 @@ test(
'src/index.html',
html`
<h1>🤠👋</h1>
<div class="flex! sm:block!"></div>
<div class="flex! sm:block! bg-linear-to-t"></div>
`,
)

View File

@ -3,6 +3,7 @@ import path from 'node:path'
import type { Candidate } from '../../../tailwindcss/src/candidate'
import type { DesignSystem } from '../../../tailwindcss/src/design-system'
import { extractCandidates, printCandidate, replaceCandidateInContent } from './candidates'
import { bgGradient } from './codemods/bg-gradient'
import { migrateImportant } from './codemods/migrate-important'
export type Migration = (candidate: Candidate) => Candidate | null
@ -10,7 +11,7 @@ export type Migration = (candidate: Candidate) => Candidate | null
export default async function migrateContents(
designSystem: DesignSystem,
contents: string,
migrations: Migration[] = [migrateImportant],
migrations: Migration[] = [migrateImportant, bgGradient],
): Promise<string> {
let candidates = await extractCandidates(designSystem, contents)