Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Ensure `@tailwindcss/cli` in `--watch` mode rebuilds when the input CSS file changes in an ignored directory ([#20246](https://github.com/tailwindlabs/tailwindcss/pull/20246))
- Ensure `@variant` rules generated by `addBase` can use custom variants defined later ([#20247](https://github.com/tailwindlabs/tailwindcss/pull/20247))
- Ensure `@tailwindcss/vite` doesn't crash during HMR when scanned files or directories are deleted ([#20259](https://github.com/tailwindlabs/tailwindcss/pull/20259))
- Ensure `text-[--spacing(…)]` generates `font-size` instead of `color` ([#20260](https://github.com/tailwindlabs/tailwindcss/pull/20260))

## [4.3.1] - 2026-06-12

Expand Down
10 changes: 10 additions & 0 deletions packages/tailwindcss/src/utilities.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26518,6 +26518,7 @@ test('text', async () => {
'text-[color:var(--my-color)]/50',
'text-[color:var(--my-color)]/[0.5]',
'text-[color:var(--my-color)]/[50%]',
'text-[--alpha(red/20%)]',

// font-size / line-height / letter-spacing / font-weight
'text-sm',
Expand All @@ -26543,6 +26544,7 @@ test('text', async () => {
'text-[clamp(1rem,2rem,3rem)]',
'text-[clamp(1rem,var(--size),3rem)]',
'text-[clamp(1rem,var(--size),3rem)]/9',
'text-[--spacing(2)]',
],
css`
@theme {
Expand Down Expand Up @@ -26632,6 +26634,10 @@ test('text', async () => {
line-height: var(--leading-snug);
}

.text-\\[--spacing\\(2\\)\\] {
font-size: calc(var(--spacing) * 2);
}

.text-\\[12px\\] {
font-size: 12px;
}
Expand Down Expand Up @@ -26672,6 +26678,10 @@ test('text', async () => {
color: oklab(59.9824% -.067 -.124 / .5);
}

.text-\\[--alpha\\(red\\/20\\%\\)\\] {
color: oklab(62.7955% .224 .125 / .2);
}

.text-\\[color\\:var\\(--my-color\\)\\], .text-\\[color\\:var\\(--my-color\\)\\]\\/50 {
color: var(--my-color);
}
Expand Down
3 changes: 2 additions & 1 deletion packages/tailwindcss/src/utils/infer-data-type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,10 @@ const LENGTH_UNITS = [
]

const IS_LENGTH = new RegExp(`^${HAS_NUMBER.source}(${LENGTH_UNITS.join('|')})$`)
const IS_LENGTH_FN = /^(--spacing)\(/i

export function isLength(value: string): boolean {
return IS_LENGTH.test(value) || hasMathFn(value)
return IS_LENGTH.test(value) || IS_LENGTH_FN.test(value) || hasMathFn(value)
}

/* -------------------------------------------------------------------------- */
Expand Down
2 changes: 1 addition & 1 deletion packages/tailwindcss/src/utils/is-color.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ const NAMED_COLORS = new Set([
'accentcolortext',
])

const IS_COLOR_FN = /^(rgba?|hsla?|hwb|color|(ok)?(lab|lch)|light-dark|color-mix)\(/i
const IS_COLOR_FN = /^(rgba?|hsla?|hwb|color|(ok)?(lab|lch)|light-dark|color-mix|--alpha)\(/i

export function isColor(value: string): boolean {
return (
Expand Down