-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support loading plugins in CSS (#1044)
This adds support for `@plugin` and `@config` in v4 which is coming in v4.0.0-alpha.21
- Loading branch information
1 parent
3c3c193
commit c2c7cc7
Showing
20 changed files
with
281 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
packages/tailwindcss-language-server/tests/fixtures/v4/css-loading-js/app.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
@import 'tailwindcss'; | ||
|
||
/* Load ESM versions */ | ||
@config './esm/my-config.mjs'; | ||
@plugin './esm/my-plugin.mjs'; | ||
|
||
/* Load Common JS versions */ | ||
@config './cjs/my-config.cjs'; | ||
@plugin './cjs/my-plugin.cjs'; | ||
|
||
/* Load TypeScript versions */ | ||
@config './ts/my-config.ts'; | ||
@plugin './ts/my-plugin.ts'; | ||
|
||
/* Attempt to load files that do not exist */ | ||
@config './missing-confg.mjs'; | ||
@plugin './missing-plugin.mjs'; |
9 changes: 9 additions & 0 deletions
9
packages/tailwindcss-language-server/tests/fixtures/v4/css-loading-js/cjs/my-config.cjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module.exports = { | ||
theme: { | ||
extend: { | ||
colors: { | ||
'cjs-from-config': 'black', | ||
}, | ||
}, | ||
}, | ||
} |
16 changes: 16 additions & 0 deletions
16
packages/tailwindcss-language-server/tests/fixtures/v4/css-loading-js/cjs/my-plugin.cjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
const plugin = require('tailwindcss/plugin') | ||
|
||
module.exports = plugin( | ||
() => { | ||
// | ||
}, | ||
{ | ||
theme: { | ||
extend: { | ||
colors: { | ||
'cjs-from-plugin': 'black', | ||
}, | ||
}, | ||
}, | ||
}, | ||
) |
9 changes: 9 additions & 0 deletions
9
packages/tailwindcss-language-server/tests/fixtures/v4/css-loading-js/esm/my-config.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export default { | ||
theme: { | ||
extend: { | ||
colors: { | ||
'esm-from-config': 'black', | ||
}, | ||
}, | ||
}, | ||
} |
16 changes: 16 additions & 0 deletions
16
packages/tailwindcss-language-server/tests/fixtures/v4/css-loading-js/esm/my-plugin.mjs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import plugin from 'tailwindcss/plugin' | ||
|
||
export default plugin( | ||
() => { | ||
// | ||
}, | ||
{ | ||
theme: { | ||
extend: { | ||
colors: { | ||
'esm-from-plugin': 'black', | ||
}, | ||
}, | ||
}, | ||
}, | ||
) |
17 changes: 17 additions & 0 deletions
17
packages/tailwindcss-language-server/tests/fixtures/v4/css-loading-js/package-lock.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
packages/tailwindcss-language-server/tests/fixtures/v4/css-loading-js/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"dependencies": { | ||
"tailwindcss": "file:tailwindcss.tgz" | ||
} | ||
} |
Binary file added
BIN
+94.4 KB
packages/tailwindcss-language-server/tests/fixtures/v4/css-loading-js/tailwindcss.tgz
Binary file not shown.
11 changes: 11 additions & 0 deletions
11
packages/tailwindcss-language-server/tests/fixtures/v4/css-loading-js/ts/my-config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import type { Config } from 'tailwindcss' | ||
|
||
export default { | ||
theme: { | ||
extend: { | ||
colors: { | ||
'ts-from-config': 'black', | ||
}, | ||
}, | ||
}, | ||
} satisfies Config |
17 changes: 17 additions & 0 deletions
17
packages/tailwindcss-language-server/tests/fixtures/v4/css-loading-js/ts/my-plugin.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import type { PluginAPI } from 'tailwindcss' | ||
import plugin from 'tailwindcss/plugin' | ||
|
||
export default plugin( | ||
(api: PluginAPI) => { | ||
// | ||
}, | ||
{ | ||
theme: { | ||
extend: { | ||
colors: { | ||
'ts-from-plugin': 'black', | ||
}, | ||
}, | ||
}, | ||
}, | ||
) |
Oops, something went wrong.