Skip to content

Commit 6138d69

Browse files
Warn when @tailwindcss/line-clamp plugin is being used (#10862)
* Warn if line-clamp plugin is installed * Replace line-clamp in standalone CLI * Update import * Remove line-clamp plugin if found * update lockfiles * Update changelog
1 parent 4b44daf commit 6138d69

File tree

5 files changed

+84
-62
lines changed

5 files changed

+84
-62
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3737
- Mark `rtl` and `ltr` variants as stable and remove warnings ([#10764](https://github.com/tailwindlabs/tailwindcss/pull/10764))
3838
- Use `inset` instead of `top`, `right`, `bottom`, and `left` properties ([#10765](https://github.com/tailwindlabs/tailwindcss/pull/10765))
3939
- Make `dark` and `rtl`/`ltr` variants insensitive to DOM order ([#10766](https://github.com/tailwindlabs/tailwindcss/pull/10766))
40+
- Warn when `@tailwindcss/line-clamp` plugin is being used ([#10862](https://github.com/tailwindlabs/tailwindcss/pull/10862))
4041

4142
## [3.2.7] - 2023-02-16
4243

src/util/normalizeConfig.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,5 +297,22 @@ export function normalizeConfig(config) {
297297
}
298298
}
299299

300+
// Warn if the line-clamp plugin is installed
301+
if (config.plugins.length > 0) {
302+
let plugin
303+
try {
304+
plugin = require('@tailwindcss/line-clamp')
305+
} catch {}
306+
307+
if (plugin && config.plugins.includes(plugin)) {
308+
log.warn('line-clamp-in-core', [
309+
`The @tailwindcs/line-clamp plugin is now part of Tailwind CSS v3.3`,
310+
`Remove it from your config to silence this warning`,
311+
])
312+
313+
config.plugins = config.plugins.filter((p) => p !== plugin)
314+
}
315+
}
316+
300317
return config
301318
}

standalone-cli/package-lock.json

Lines changed: 59 additions & 60 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

standalone-cli/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
"@tailwindcss/aspect-ratio": "^0.4.0",
1313
"@tailwindcss/container-queries": "^0.1.0",
1414
"@tailwindcss/forms": "^0.5.2",
15-
"@tailwindcss/line-clamp": "^0.4.0",
1615
"@tailwindcss/typography": "^0.5.4",
1716
"fs-extra": "^10.1.0",
1817
"jest": "^27.2.5",

standalone-cli/standalone.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
let Module = require('module')
22
let origRequire = Module.prototype.require
3+
let log = require('tailwindcss/lib/util/log').default
34

45
let localModules = {
56
'tailwindcss/colors': require('tailwindcss/colors'),
@@ -11,7 +12,12 @@ let localModules = {
1112
'@tailwindcss/aspect-ratio': require('@tailwindcss/aspect-ratio'),
1213
'@tailwindcss/container-queries': require('@tailwindcss/container-queries'),
1314
'@tailwindcss/forms': require('@tailwindcss/forms'),
14-
'@tailwindcss/line-clamp': require('@tailwindcss/line-clamp'),
15+
'@tailwindcss/line-clamp': () => {
16+
log.warn('line-clamp-in-core', [
17+
`The @tailwindcs/line-clamp plugin is now part of Tailwind CSS v3.3`,
18+
`Remove it from your config to silence this warning`,
19+
])
20+
},
1521
'@tailwindcss/typography': require('@tailwindcss/typography'),
1622

1723
// These are present to allow them to be specified in the PostCSS config file

0 commit comments

Comments
 (0)