Skip to content

Commit 21e07ef

Browse files
committed
Migrate ringColor.DEFAULT to —default-ring-color during upgrades
1 parent 90422e9 commit 21e07ef

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

integrations/upgrade/js-config.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ test(
3434
steel: 'rgb(70 130 180 / <alpha-value>)',
3535
smoke: 'rgba(245, 245, 245, var(--smoke-alpha, <alpha-value>))',
3636
},
37+
ringColor: {
38+
DEFAULT: '#c0ffee',
39+
},
3740
opacity: {
3841
superOpaque: '0.95',
3942
},

packages/@tailwindcss-upgrade/src/codemods/config/migrate-js-config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,14 @@ async function migrateTheme(
237237
prevSectionKey = sectionKey
238238
}
239239

240+
// ringColor.DEFAULT is a special case that maps to `--default-ring-color`
241+
// as to match the behavior of v3
242+
if (key[0] === 'ringColor' && key[1] === 'DEFAULT') {
243+
let property = 'default-ring-color'
244+
themeSection.push(` ${escape(`--${property}`)}: ${value};`)
245+
continue
246+
}
247+
240248
if (resetNamespaces.has(key[0]) && resetNamespaces.get(key[0]) === false) {
241249
resetNamespaces.set(key[0], true)
242250
let property = keyPathToCssProperty([key[0]])

0 commit comments

Comments
 (0)