Resolve borderRadius when using dot notation inside the theme() function (#14436)

Fixes an issue where `borderRadius` was not properly upgraded when using
it in the `theme()` function like this:

```
rounded-[theme(borderRadius.lg)]
```

---------

Co-authored-by: Jordan Pittman <jordan@cryptica.me>
Co-authored-by: Adam Wathan <adam.wathan@gmail.com>
This commit is contained in:
Philipp Spiess 2024-09-17 10:54:36 +02:00 committed by GitHub
parent d9aad773aa
commit c7cbdb8472
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 25 additions and 1 deletions

View File

@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
- Nothing yet!
### Fixed
- Support `borderRadius.*` as an alias for `--radius-*` when using dot notation inside the `theme()` function ([#14436](https://github.com/tailwindlabs/tailwindcss/pull/14436))
## [4.0.0-alpha.24] - 2024-09-11

View File

@ -278,6 +278,7 @@ let themeUpgradeKeys = {
'--background-opacity': '--opacity',
'--border-color': '--color',
'--border-opacity': '--opacity',
'--border-radius': '--radius',
'--border-spacing': '--spacing',
'--box-shadow-color': '--color',
'--caret-color': '--color',

View File

@ -241,6 +241,27 @@ describe('theme function', () => {
`)
})
test('theme(borderRadius.lg)', async () => {
expect(
await compileCss(css`
@theme {
--radius-lg: 0.5rem;
}
.radius {
border-radius: theme(borderRadius.lg);
}
`),
).toMatchInlineSnapshot(`
":root {
--radius-lg: .5rem;
}
.radius {
border-radius: .5rem;
}"
`)
})
describe('for v3 compatibility', () => {
test('theme(blur.DEFAULT)', async () => {
expect(