Skip to content

Commit b92d170

Browse files
Bump to Tailwind CSS v4.1.1 (#1294)
1 parent 6b306ba commit b92d170

File tree

29 files changed

+213
-162
lines changed

29 files changed

+213
-162
lines changed

packages/tailwindcss-language-server/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"@tailwindcss/forms": "0.5.3",
4141
"@tailwindcss/language-service": "workspace:*",
4242
"@tailwindcss/line-clamp": "0.4.2",
43-
"@tailwindcss/oxide": "^4.0.15",
43+
"@tailwindcss/oxide": "^4.1.0",
4444
"@tailwindcss/typography": "0.5.7",
4545
"@types/braces": "3.0.1",
4646
"@types/color-name": "^1.1.3",
@@ -84,7 +84,7 @@
8484
"rimraf": "3.0.2",
8585
"stack-trace": "0.0.10",
8686
"tailwindcss": "3.4.17",
87-
"tailwindcss-v4": "npm:tailwindcss@4.0.6",
87+
"tailwindcss-v4": "npm:tailwindcss@4.1.1",
8888
"tsconfck": "^3.1.4",
8989
"tsconfig-paths": "^4.2.0",
9090
"typescript": "5.3.3",

packages/tailwindcss-language-server/src/project-locator.test.ts

+29-23
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ testFixture('v4/workspaces', [
123123
'{URL}/packages/admin/**',
124124
'{URL}/packages/admin/app.css',
125125
'{URL}/packages/admin/package.json',
126+
'{URL}/packages/admin/tw.css',
126127
],
127128
},
128129
{
@@ -147,8 +148,8 @@ testLocator({
147148
'package.json': json`
148149
{
149150
"dependencies": {
150-
"tailwindcss": "^4.0.15",
151-
"@tailwindcss/oxide": "^4.0.15"
151+
"tailwindcss": "4.1.0",
152+
"@tailwindcss/oxide": "4.1.0"
152153
}
153154
}
154155
`,
@@ -164,7 +165,7 @@ testLocator({
164165
content: [
165166
'/*',
166167
'/package.json',
167-
'/src/**/*.{aspx,astro,cjs,cts,eex,erb,gjs,gts,haml,handlebars,hbs,heex,html,jade,js,jsx,liquid,md,mdx,mjs,mts,mustache,njk,nunjucks,php,pug,py,razor,rb,rhtml,rs,slim,svelte,tpl,ts,tsx,twig,vue}',
168+
'/src/**/*.{aspx,astro,cjs,css,cts,eex,erb,gjs,gts,haml,handlebars,hbs,heex,html,jade,js,json,jsx,liquid,md,mdx,mjs,mts,mustache,njk,nunjucks,php,pug,py,razor,rb,rhtml,rs,slim,svelte,tpl,ts,tsx,twig,vue}',
168169
'/src/components/example.html',
169170
'/src/index.html',
170171
],
@@ -178,8 +179,8 @@ testLocator({
178179
'package.json': json`
179180
{
180181
"dependencies": {
181-
"tailwindcss": "^4.0.15",
182-
"@tailwindcss/oxide": "^4.0.15"
182+
"tailwindcss": "4.1.0",
183+
"@tailwindcss/oxide": "4.1.0"
183184
}
184185
}
185186
`,
@@ -197,7 +198,7 @@ testLocator({
197198
content: [
198199
'/*',
199200
'/package.json',
200-
'/src/**/*.{aspx,astro,cjs,cts,eex,erb,gjs,gts,haml,handlebars,hbs,heex,html,jade,js,jsx,liquid,md,mdx,mjs,mts,mustache,njk,nunjucks,php,pug,py,razor,rb,rhtml,rs,slim,svelte,tpl,ts,tsx,twig,vue}',
201+
'/src/**/*.{aspx,astro,cjs,css,cts,eex,erb,gjs,gts,haml,handlebars,hbs,heex,html,jade,js,json,jsx,liquid,md,mdx,mjs,mts,mustache,njk,nunjucks,php,pug,py,razor,rb,rhtml,rs,slim,svelte,tpl,ts,tsx,twig,vue}',
201202
'/src/components/example.html',
202203
'/src/index.html',
203204
],
@@ -211,8 +212,8 @@ testLocator({
211212
'package.json': json`
212213
{
213214
"dependencies": {
214-
"tailwindcss": "^4.0.15",
215-
"@tailwindcss/oxide": "^4.0.15"
215+
"tailwindcss": "4.1.0",
216+
"@tailwindcss/oxide": "4.1.0"
216217
}
217218
}
218219
`,
@@ -245,36 +246,40 @@ testLocator({
245246
content: [
246247
'/*',
247248
'/admin/foo.bin',
248-
'/admin/{**/*.bin,**/*.{aspx,astro,cjs,cts,eex,erb,gjs,gts,haml,handlebars,hbs,heex,html,jade,js,jsx,liquid,md,mdx,mjs,mts,mustache,njk,nunjucks,php,pug,py,razor,rb,rhtml,rs,slim,svelte,tpl,ts,tsx,twig,vue}}',
249+
'/admin/tw.css',
250+
'/admin/ui.css',
251+
'/admin/{**/*.bin,**/*.{aspx,astro,bin,cjs,css,cts,eex,erb,gjs,gts,haml,handlebars,hbs,heex,html,jade,js,json,jsx,liquid,md,mdx,mjs,mts,mustache,njk,nunjucks,php,pug,py,razor,rb,rhtml,rs,slim,svelte,tpl,ts,tsx,twig,vue}}',
249252
'/package.json',
250253
'/shared.html',
251-
'/web/**/*.{aspx,astro,cjs,cts,eex,erb,gjs,gts,haml,handlebars,hbs,heex,html,jade,js,jsx,liquid,md,mdx,mjs,mts,mustache,njk,nunjucks,php,pug,py,razor,rb,rhtml,rs,slim,svelte,tpl,ts,tsx,twig,vue}',
254+
'/web/**/*.{aspx,astro,bin,cjs,css,cts,eex,erb,gjs,gts,haml,handlebars,hbs,heex,html,jade,js,json,jsx,liquid,md,mdx,mjs,mts,mustache,njk,nunjucks,php,pug,py,razor,rb,rhtml,rs,slim,svelte,tpl,ts,tsx,twig,vue}',
255+
'/web/app.css',
252256
],
253257
},
254258
{
255259
config: '/web/app.css',
256260
content: [
257261
'/*',
258-
'/admin/**/*.{aspx,astro,cjs,cts,eex,erb,gjs,gts,haml,handlebars,hbs,heex,html,jade,js,jsx,liquid,md,mdx,mjs,mts,mustache,njk,nunjucks,php,pug,py,razor,rb,rhtml,rs,slim,svelte,tpl,ts,tsx,twig,vue}',
262+
'/admin/**/*.{aspx,astro,bin,cjs,css,cts,eex,erb,gjs,gts,haml,handlebars,hbs,heex,html,jade,js,json,jsx,liquid,md,mdx,mjs,mts,mustache,njk,nunjucks,php,pug,py,razor,rb,rhtml,rs,slim,svelte,tpl,ts,tsx,twig,vue}',
263+
'/admin/app.css',
264+
'/admin/tw.css',
265+
'/admin/ui.css',
259266
'/package.json',
260267
'/shared.html',
261268
'/web/bar.bin',
262-
'/web/{**/*.{aspx,astro,cjs,cts,eex,erb,gjs,gts,haml,handlebars,hbs,heex,html,jade,js,jsx,liquid,md,mdx,mjs,mts,mustache,njk,nunjucks,php,pug,py,razor,rb,rhtml,rs,slim,svelte,tpl,ts,tsx,twig,vue},*.bin}',
269+
'/web/{**/*.{aspx,astro,bin,cjs,css,cts,eex,erb,gjs,gts,haml,handlebars,hbs,heex,html,jade,js,json,jsx,liquid,md,mdx,mjs,mts,mustache,njk,nunjucks,php,pug,py,razor,rb,rhtml,rs,slim,svelte,tpl,ts,tsx,twig,vue},*.bin}',
263270
],
264271
},
265272
],
266273
})
267274

268275
testLocator({
269-
// TODO: Enable once v4.1 is released
270-
options: { skip: true },
271276
name: 'automatic content detection with negative custom sources',
272277
fs: {
273278
'package.json': json`
274279
{
275280
"dependencies": {
276-
"tailwindcss": "0.0.0-insiders.3e53e25",
277-
"@tailwindcss/oxide": "0.0.0-insiders.3e53e25"
281+
"tailwindcss": "4.1.0",
282+
"@tailwindcss/oxide": "4.1.0"
278283
}
279284
}
280285
`,
@@ -293,7 +298,7 @@ testLocator({
293298
'/*',
294299
'/package.json',
295300
'/src/index.html',
296-
'/src/{**/*.html,**/*.{aspx,astro,cjs,cts,eex,erb,gjs,gts,haml,handlebars,hbs,heex,html,jade,js,json,jsx,liquid,md,mdx,mjs,mts,mustache,njk,nunjucks,php,pug,py,razor,rb,rhtml,rs,slim,svelte,tpl,ts,tsx,twig,vue}}',
301+
'/src/{**/*.html,**/*.{aspx,astro,cjs,css,cts,eex,erb,gjs,gts,haml,handlebars,hbs,heex,html,jade,js,json,jsx,liquid,md,mdx,mjs,mts,mustache,njk,nunjucks,php,pug,py,razor,rb,rhtml,rs,slim,svelte,tpl,ts,tsx,twig,vue}}',
297302
],
298303
},
299304
],
@@ -303,7 +308,7 @@ testFixture('v4/missing-files', [
303308
//
304309
{
305310
config: 'app.css',
306-
content: ['{URL}/*', '{URL}/package.json'],
311+
content: ['{URL}/*', '{URL}/i-exist.css', '{URL}/package.json'],
307312
},
308313
])
309314

@@ -314,7 +319,8 @@ testFixture('v4/path-mappings', [
314319
content: [
315320
'{URL}/*',
316321
'{URL}/package.json',
317-
'{URL}/src/**/*.{aspx,astro,cjs,cts,eex,erb,gjs,gts,haml,handlebars,hbs,heex,html,jade,js,jsx,liquid,md,mdx,mjs,mts,mustache,njk,nunjucks,php,pug,py,razor,rb,rhtml,rs,slim,svelte,tpl,ts,tsx,twig,vue}',
322+
'{URL}/src/**/*.{aspx,astro,cjs,css,cts,eex,erb,gjs,gts,haml,handlebars,hbs,heex,html,jade,js,json,jsx,liquid,md,mdx,mjs,mts,mustache,njk,nunjucks,php,pug,py,razor,rb,rhtml,rs,slim,svelte,tpl,ts,tsx,twig,vue}',
323+
'{URL}/src/a/file.css',
318324
'{URL}/src/a/my-config.ts',
319325
'{URL}/src/a/my-plugin.ts',
320326
'{URL}/tsconfig.json',
@@ -326,7 +332,7 @@ testFixture('v4/invalid-import-order', [
326332
//
327333
{
328334
config: 'tailwind.css',
329-
content: ['{URL}/*', '{URL}/package.json'],
335+
content: ['{URL}/*', '{URL}/a.css', '{URL}/b.css', '{URL}/package.json'],
330336
},
331337
])
332338

@@ -338,7 +344,7 @@ testLocator({
338344
'package.json': json`
339345
{
340346
"dependencies": {
341-
"tailwindcss": "^4.0.2"
347+
"tailwindcss": "4.1.0"
342348
}
343349
}
344350
`,
@@ -386,7 +392,7 @@ testLocator({
386392
'package.json': json`
387393
{
388394
"dependencies": {
389-
"tailwindcss": "4.0.6"
395+
"tailwindcss": "4.1.0"
390396
}
391397
}
392398
`,
@@ -415,7 +421,7 @@ testLocator({
415421
},
416422
expected: [
417423
{
418-
version: '4.0.6',
424+
version: '4.1.0',
419425
config: '/src/articles/articles.css',
420426
content: [],
421427
},

packages/tailwindcss-language-server/src/util/v4/design-system.ts

+8
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,14 @@ export async function loadDesignSystem(
219219
Object.assign(design, {
220220
dependencies: () => dependencies,
221221

222+
// TODOs:
223+
//
224+
// 1. Remove PostCSS parsing — its roughly 60% of the processing time
225+
// ex: compiling 19k classes take 650ms and 400ms of that is PostCSS
226+
//
227+
// - Replace `candidatesToCss` with a `candidatesToAst` API
228+
// First step would be to convert to a PostCSS AST by transforming the nodes directly
229+
// Then it would be to drop the PostCSS AST representation entirely in all v4 code paths
222230
compile(classes: string[]): (postcss.Root | null)[] {
223231
let css = design.candidatesToCss(classes)
224232
let errors: any[] = []

packages/tailwindcss-language-server/tests/colors/colors.test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ defineTest({
334334

335335
expect(c.project).toMatchObject({
336336
tailwind: {
337-
version: '4.0.6',
337+
version: '4.1.1',
338338
isDefaultVersion: true,
339339
},
340340
})
@@ -373,7 +373,7 @@ defineTest({
373373

374374
expect(c.project).toMatchObject({
375375
tailwind: {
376-
version: '4.0.6',
376+
version: '4.1.1',
377377
isDefaultVersion: true,
378378
},
379379
})

packages/tailwindcss-language-server/tests/completions/completions.test.js

+13-13
Original file line numberDiff line numberDiff line change
@@ -313,8 +313,8 @@ withFixture('v4/basic', (c) => {
313313
let result = await completion({ lang, text, position, settings })
314314
let textEdit = expect.objectContaining({ range: { start: position, end: position } })
315315

316-
expect(result.items.length).toBe(13172)
317-
expect(result.items.filter((item) => item.label.endsWith(':')).length).toBe(317)
316+
expect(result.items.length).toBe(19283)
317+
expect(result.items.filter((item) => item.label.endsWith(':')).length).toBe(346)
318318
expect(result).toEqual({
319319
isIncomplete: false,
320320
items: expect.arrayContaining([
@@ -488,7 +488,7 @@ withFixture('v4/basic', (c) => {
488488
})
489489

490490
// Make sure `@slot` is NOT suggested by default
491-
expect(result.items.length).toBe(7)
491+
expect(result.items.length).toBe(8)
492492
expect(result.items).not.toEqual(
493493
expect.arrayContaining([
494494
expect.objectContaining({ kind: 14, label: '@slot', sortText: '-0000000' }),
@@ -627,7 +627,7 @@ withFixture('v4/basic', (c) => {
627627

628628
expect(resolved).toEqual({
629629
...item,
630-
detail: 'background-color: oklch(0.637 0.237 25.331);',
630+
detail: 'background-color: oklch(63.7% 0.237 25.331);',
631631
documentation: '#fb2c36',
632632
})
633633
})
@@ -692,7 +692,7 @@ defineTest({
692692
// ^
693693
let completion = await document.completions({ line: 0, character: 23 })
694694

695-
expect(completion?.items.length).toBe(12289)
695+
expect(completion?.items.length).toBe(19236)
696696
},
697697
})
698698

@@ -714,7 +714,7 @@ defineTest({
714714
// ^
715715
let completion = await document.completions({ line: 0, character: 22 })
716716

717-
expect(completion?.items.length).toBe(12289)
717+
expect(completion?.items.length).toBe(19236)
718718
},
719719
})
720720

@@ -736,7 +736,7 @@ defineTest({
736736
// ^
737737
let completion = await document.completions({ line: 0, character: 31 })
738738

739-
expect(completion?.items.length).toBe(12289)
739+
expect(completion?.items.length).toBe(19236)
740740
},
741741
})
742742

@@ -765,7 +765,7 @@ defineTest({
765765
// ^
766766
let completion = await document.completions({ line: 0, character: 20 })
767767

768-
expect(completion?.items.length).toBe(12289)
768+
expect(completion?.items.length).toBe(19236)
769769
},
770770
})
771771

@@ -796,7 +796,7 @@ defineTest({
796796
// ^
797797
let completion = await document.completions({ line: 1, character: 22 })
798798

799-
expect(completion?.items.length).toBe(12289)
799+
expect(completion?.items.length).toBe(19236)
800800
},
801801
})
802802

@@ -886,24 +886,24 @@ defineTest({
886886
// ^
887887
let completionA = await document.completions({ line: 0, character: 13 })
888888

889-
expect(completionA?.items.length).toBe(12289)
889+
expect(completionA?.items.length).toBe(19236)
890890

891891
// return <Test className={cn("")} />;
892892
// ^
893893
let completionB = await document.completions({ line: 3, character: 30 })
894894

895-
expect(completionB?.items.length).toBe(12289)
895+
expect(completionB?.items.length).toBe(19236)
896896

897897
// return <Test className={cn("")} />;
898898
// ^
899899
let completionC = await document.completions({ line: 7, character: 30 })
900900

901-
expect(completionC?.items.length).toBe(12289)
901+
expect(completionC?.items.length).toBe(19236)
902902

903903
// let y = cva("");
904904
// ^
905905
let completionD = await document.completions({ line: 10, character: 13 })
906906

907-
expect(completionD?.items.length).toBe(12289)
907+
expect(completionD?.items.length).toBe(19236)
908908
},
909909
})

0 commit comments

Comments
 (0)