Skip to content

Commit 90422e9

Browse files
committed
Treat ringColor.DEFAULT as —default-ring-color when loading configs
1 parent 479b725 commit 90422e9

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

packages/tailwindcss/src/compat/apply-config-to-theme.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ test('config values can be merged into the theme', () => {
5757
'2xl': ['2rem'],
5858
},
5959

60+
ringColor: {
61+
DEFAULT: '#fff',
62+
},
63+
6064
letterSpacing: {
6165
superWide: '0.25em',
6266
},
@@ -125,6 +129,8 @@ test('config values can be merged into the theme', () => {
125129
expect(theme.resolve('100%', ['--width'])).toEqual('100%')
126130
expect(theme.resolve('9xs', ['--container'])).toEqual('6rem')
127131
expect(theme.resolve('fast', ['--ease'])).toEqual('cubic-bezier(0, 0.55, 0.45, 1)')
132+
expect(theme.get(['--ring-color'])).toEqual(null)
133+
expect(theme.get(['--default-ring-color'])).toEqual('#fff')
128134
})
129135

130136
test('will reset default theme values with overwriting theme values', () => {

packages/tailwindcss/src/compat/apply-config-to-theme.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,18 @@ export function applyConfigToTheme(
5050
}
5151
}
5252

53+
// ringColor.DEFAULT is a special case that maps to `--default-ring-color`
54+
// as to match the behavior of v3
55+
if (path[0] === 'ringColor' && path[1] === 'DEFAULT') {
56+
designSystem.theme.add(
57+
'--default-ring-color',
58+
'' + value,
59+
ThemeOptions.INLINE | ThemeOptions.REFERENCE | ThemeOptions.DEFAULT,
60+
)
61+
62+
continue
63+
}
64+
5365
let name = keyPathToCssProperty(path)
5466
if (!name) continue
5567

0 commit comments

Comments
 (0)