Skip to content

Commit 8508642

Browse files
Merge branch 'main' into fix/color-mix-recursion
2 parents 620f104 + 5a77c9d commit 8508642

File tree

28 files changed

+174
-31
lines changed

28 files changed

+174
-31
lines changed

Diff for: CHANGELOG.md

+10-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
- Ensure the `color-mix(…)` polyfill creates fallbacks for theme variables that reference other theme variables ([#17562](https://github.com/tailwindlabs/tailwindcss/pull/17562))
1313

14+
## [4.1.3] - 2025-04-04
15+
16+
### Fixed
17+
18+
- Show warning when using unsupported bare value data type in `--value(…)` ([#17464](https://github.com/tailwindlabs/tailwindcss/pull/17464))
19+
- PostCSS: Ensure changes to the input CSS file don't generate stale output when using Turbopack ([#17554](https://github.com/tailwindlabs/tailwindcss/pull/17554))
20+
- Ensure classes are detected in Ruby's `%w` syntax in Slim templates ([#17557](https://github.com/tailwindlabs/tailwindcss/pull/17557))
21+
1422
## [4.1.2] - 2025-04-03
1523

1624
### Fixed
@@ -3634,7 +3642,8 @@ No release notes
36343642

36353643
- Everything!
36363644

3637-
[unreleased]: https://github.com/tailwindlabs/tailwindcss/compare/v4.1.2...HEAD
3645+
[unreleased]: https://github.com/tailwindlabs/tailwindcss/compare/v4.1.3...HEAD
3646+
[4.1.3]: https://github.com/tailwindlabs/tailwindcss/compare/v4.1.2...v4.1.3
36383647
[4.1.2]: https://github.com/tailwindlabs/tailwindcss/compare/v4.1.1...v4.1.2
36393648
[4.1.1]: https://github.com/tailwindlabs/tailwindcss/compare/v4.1.0...v4.1.1
36403649
[4.1.0]: https://github.com/tailwindlabs/tailwindcss/compare/v4.0.17...v4.1.0

Diff for: crates/node/npm/android-arm-eabi/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tailwindcss/oxide-android-arm-eabi",
3-
"version": "4.1.2",
3+
"version": "4.1.3",
44
"repository": {
55
"type": "git",
66
"url": "git+https://github.com/tailwindlabs/tailwindcss.git",

Diff for: crates/node/npm/android-arm64/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tailwindcss/oxide-android-arm64",
3-
"version": "4.1.2",
3+
"version": "4.1.3",
44
"repository": {
55
"type": "git",
66
"url": "git+https://github.com/tailwindlabs/tailwindcss.git",

Diff for: crates/node/npm/darwin-arm64/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tailwindcss/oxide-darwin-arm64",
3-
"version": "4.1.2",
3+
"version": "4.1.3",
44
"repository": {
55
"type": "git",
66
"url": "git+https://github.com/tailwindlabs/tailwindcss.git",

Diff for: crates/node/npm/darwin-x64/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tailwindcss/oxide-darwin-x64",
3-
"version": "4.1.2",
3+
"version": "4.1.3",
44
"repository": {
55
"type": "git",
66
"url": "git+https://github.com/tailwindlabs/tailwindcss.git",

Diff for: crates/node/npm/freebsd-x64/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tailwindcss/oxide-freebsd-x64",
3-
"version": "4.1.2",
3+
"version": "4.1.3",
44
"repository": {
55
"type": "git",
66
"url": "git+https://github.com/tailwindlabs/tailwindcss.git",

Diff for: crates/node/npm/linux-arm-gnueabihf/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tailwindcss/oxide-linux-arm-gnueabihf",
3-
"version": "4.1.2",
3+
"version": "4.1.3",
44
"repository": {
55
"type": "git",
66
"url": "git+https://github.com/tailwindlabs/tailwindcss.git",

Diff for: crates/node/npm/linux-arm64-gnu/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tailwindcss/oxide-linux-arm64-gnu",
3-
"version": "4.1.2",
3+
"version": "4.1.3",
44
"repository": {
55
"type": "git",
66
"url": "git+https://github.com/tailwindlabs/tailwindcss.git",

Diff for: crates/node/npm/linux-arm64-musl/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tailwindcss/oxide-linux-arm64-musl",
3-
"version": "4.1.2",
3+
"version": "4.1.3",
44
"repository": {
55
"type": "git",
66
"url": "git+https://github.com/tailwindlabs/tailwindcss.git",

Diff for: crates/node/npm/linux-x64-gnu/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tailwindcss/oxide-linux-x64-gnu",
3-
"version": "4.1.2",
3+
"version": "4.1.3",
44
"repository": {
55
"type": "git",
66
"url": "git+https://github.com/tailwindlabs/tailwindcss.git",

Diff for: crates/node/npm/linux-x64-musl/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tailwindcss/oxide-linux-x64-musl",
3-
"version": "4.1.2",
3+
"version": "4.1.3",
44
"repository": {
55
"type": "git",
66
"url": "git+https://github.com/tailwindlabs/tailwindcss.git",

Diff for: crates/node/npm/win32-arm64-msvc/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tailwindcss/oxide-win32-arm64-msvc",
3-
"version": "4.1.2",
3+
"version": "4.1.3",
44
"repository": {
55
"type": "git",
66
"url": "git+https://github.com/tailwindlabs/tailwindcss.git",

Diff for: crates/node/npm/win32-x64-msvc/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tailwindcss/oxide-win32-x64-msvc",
3-
"version": "4.1.2",
3+
"version": "4.1.3",
44
"repository": {
55
"type": "git",
66
"url": "git+https://github.com/tailwindlabs/tailwindcss.git",

Diff for: crates/node/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tailwindcss/oxide",
3-
"version": "4.1.2",
3+
"version": "4.1.3",
44
"repository": {
55
"type": "git",
66
"url": "git+https://github.com/tailwindlabs/tailwindcss.git",

Diff for: crates/oxide/src/extractor/pre_processors/slim.rs

+47
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,28 @@ impl PreProcessor for Slim {
5656
}
5757
}
5858

59+
// Handle Ruby syntax with `%w[]` arrays embedded in Slim directly.
60+
//
61+
// E.g.:
62+
//
63+
// ```
64+
// div [
65+
// class=%w[bg-blue-500 w-10 h-10]
66+
// ]
67+
// ```
68+
b'%' if matches!(cursor.next, b'w' | b'W')
69+
&& matches!(cursor.input.get(cursor.pos + 2), Some(b'[' | b'(' | b'{')) =>
70+
{
71+
result[cursor.pos] = b' '; // Replace `%`
72+
cursor.advance();
73+
result[cursor.pos] = b' '; // Replace `w`
74+
cursor.advance();
75+
result[cursor.pos] = b' '; // Replace `[` or `(` or `{`
76+
bracket_stack.push(cursor.curr);
77+
cursor.advance(); // Move past the bracket
78+
continue;
79+
}
80+
5981
// Any `[` preceded by an alphanumeric value will not be part of a candidate.
6082
//
6183
// E.g.:
@@ -281,4 +303,29 @@ mod tests {
281303
"#;
282304
Slim::test_extract_contains(input, vec!["flex", "items-center"]);
283305
}
306+
307+
// https://github.com/tailwindlabs/tailwindcss/issues/17542
308+
#[test]
309+
fn test_embedded_ruby_percent_w_extraction() {
310+
let input = r#"
311+
div[
312+
class=%w[bg-blue-500 w-10 h-10]
313+
]
314+
div[
315+
class=%w[w-10 bg-green-500 h-10]
316+
]
317+
"#;
318+
319+
let expected = r#"
320+
div
321+
class= bg-blue-500 w-10 h-10]
322+
]
323+
div
324+
class= w-10 bg-green-500 h-10]
325+
]
326+
"#;
327+
328+
Slim::test(input, expected);
329+
Slim::test_extract_contains(input, vec!["bg-blue-500", "bg-green-500", "w-10", "h-10"]);
330+
}
284331
}

Diff for: packages/@tailwindcss-browser/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tailwindcss/browser",
3-
"version": "4.1.2",
3+
"version": "4.1.3",
44
"description": "A utility-first CSS framework for rapidly building custom user interfaces.",
55
"license": "MIT",
66
"main": "./dist/index.global.js",

Diff for: packages/@tailwindcss-cli/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tailwindcss/cli",
3-
"version": "4.1.2",
3+
"version": "4.1.3",
44
"description": "A utility-first CSS framework for rapidly building custom user interfaces.",
55
"license": "MIT",
66
"repository": {

Diff for: packages/@tailwindcss-node/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tailwindcss/node",
3-
"version": "4.1.2",
3+
"version": "4.1.3",
44
"description": "A utility-first CSS framework for rapidly building custom user interfaces.",
55
"license": "MIT",
66
"repository": {

Diff for: packages/@tailwindcss-postcss/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tailwindcss/postcss",
3-
"version": "4.1.2",
3+
"version": "4.1.3",
44
"description": "PostCSS plugin for Tailwind CSS, a utility-first CSS framework for rapidly building custom user interfaces",
55
"license": "MIT",
66
"repository": {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/* the content for this file is set in the tests */

Diff for: packages/@tailwindcss-postcss/src/index.test.ts

+22
Original file line numberDiff line numberDiff line change
@@ -420,3 +420,25 @@ describe('concurrent builds', () => {
420420
expect(await promise2).toContain('.red')
421421
})
422422
})
423+
424+
test('does not register the input file as a dependency, even if it is passed in as relative path', async () => {
425+
let processor = postcss([
426+
tailwindcss({ base: `${__dirname}/fixtures/example-project`, optimize: { minify: false } }),
427+
])
428+
429+
let result = await processor.process(`@tailwind utilities`, { from: './input.css' })
430+
431+
expect(result.css.trim()).toMatchInlineSnapshot(`
432+
".underline {
433+
text-decoration-line: underline;
434+
}"
435+
`)
436+
437+
// Check for dependency messages
438+
expect(result.messages).not.toContainEqual({
439+
type: 'dependency',
440+
file: expect.stringMatching(/input.css$/g),
441+
parent: expect.any(String),
442+
plugin: expect.any(String),
443+
})
444+
})

Diff for: packages/@tailwindcss-postcss/src/index.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -223,10 +223,12 @@ function tailwindcss(opts: PluginOptions = {}): AcceptedPlugin {
223223
if (compiler.features & Features.Utilities) {
224224
DEBUG && I.start('Register dependency messages')
225225
// Add all found files as direct dependencies
226+
// Note: With Turbopack, the input file might not be a resolved path
227+
let resolvedInputFile = path.resolve(base, inputFile)
226228
for (let file of context.scanner.files) {
227229
let absolutePath = path.resolve(file)
228230
// The CSS file cannot be a dependency of itself
229-
if (absolutePath === result.opts.from) {
231+
if (absolutePath === resolvedInputFile) {
230232
continue
231233
}
232234
result.messages.push({

Diff for: packages/@tailwindcss-standalone/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tailwindcss/standalone",
3-
"version": "4.1.2",
3+
"version": "4.1.3",
44
"private": true,
55
"description": "Standalone CLI for Tailwind CSS",
66
"license": "MIT",

Diff for: packages/@tailwindcss-upgrade/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tailwindcss/upgrade",
3-
"version": "4.1.2",
3+
"version": "4.1.3",
44
"description": "A utility-first CSS framework for rapidly building custom user interfaces.",
55
"license": "MIT",
66
"repository": {

Diff for: packages/@tailwindcss-vite/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tailwindcss/vite",
3-
"version": "4.1.2",
3+
"version": "4.1.3",
44
"description": "A utility-first CSS framework for rapidly building custom user interfaces.",
55
"license": "MIT",
66
"repository": {

Diff for: packages/tailwindcss/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "tailwindcss",
3-
"version": "4.1.2",
3+
"version": "4.1.3",
44
"description": "A utility-first CSS framework for rapidly building custom user interfaces.",
55
"license": "MIT",
66
"repository": {

Diff for: packages/tailwindcss/src/utilities.test.ts

+29-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { describe, expect, test } from 'vitest'
1+
import { describe, expect, test, vi } from 'vitest'
22
import { compile } from '.'
33
import { compileCss, optimizeCss, run } from './test-utils/run'
44

@@ -26530,6 +26530,34 @@ describe('custom utilities', () => {
2653026530
expect(await compileCss(input, ['tab-foo'])).toEqual('')
2653126531
})
2653226532

26533+
test('bare values with unsupported data types should result in a warning', async () => {
26534+
let spy = vi.spyOn(console, 'warn').mockImplementation(() => {})
26535+
let input = css`
26536+
@utility paint-* {
26537+
paint: --value([color], color);
26538+
}
26539+
26540+
@tailwind utilities;
26541+
`
26542+
26543+
expect(await compileCss(input, ['paint-#0088cc', 'paint-red'])).toMatchInlineSnapshot(`""`)
26544+
expect(spy.mock.calls).toMatchInlineSnapshot(`
26545+
[
26546+
[
26547+
"Unsupported bare value data type: "color".
26548+
Only valid data types are: "number", "integer", "ratio", "percentage".
26549+
",
26550+
],
26551+
[
26552+
"\`\`\`css
26553+
--value([color],color)
26554+
^^^^^
26555+
\`\`\`",
26556+
],
26557+
]
26558+
`)
26559+
})
26560+
2653326561
test('resolve literal values', async () => {
2653426562
let input = css`
2653526563
@utility tab-* {

0 commit comments

Comments
 (0)