Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn when @tailwindcss/line-clamp plugin is being used #10862

Merged
merged 6 commits into from
Mar 24, 2023
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 @@ -37,6 +37,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Mark `rtl` and `ltr` variants as stable and remove warnings ([#10764](https://github.com/tailwindlabs/tailwindcss/pull/10764))
- Use `inset` instead of `top`, `right`, `bottom`, and `left` properties ([#10765](https://github.com/tailwindlabs/tailwindcss/pull/10765))
- Make `dark` and `rtl`/`ltr` variants insensitive to DOM order ([#10766](https://github.com/tailwindlabs/tailwindcss/pull/10766))
- Warn when `@tailwindcss/line-clamp` plugin is being used ([#10862](https://github.com/tailwindlabs/tailwindcss/pull/10862))

## [3.2.7] - 2023-02-16

Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions src/util/normalizeConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,5 +297,22 @@ export function normalizeConfig(config) {
}
}

// Warn if the line-clamp plugin is installed
if (config.plugins.length > 0) {
let plugin
try {
plugin = require('@tailwindcss/line-clamp')
} catch {}

if (plugin && config.plugins.includes(plugin)) {
log.warn('line-clamp-in-core', [
`The @tailwindcs/line-clamp plugin is now part of Tailwind CSS v3.3`,
`Remove it from your config to silence this warning`,
])

config.plugins = config.plugins.filter((p) => p !== plugin)
}
}

return config
}
119 changes: 59 additions & 60 deletions standalone-cli/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion standalone-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"@tailwindcss/aspect-ratio": "^0.4.0",
"@tailwindcss/container-queries": "^0.1.0",
"@tailwindcss/forms": "^0.5.2",
"@tailwindcss/line-clamp": "^0.4.0",
"@tailwindcss/typography": "^0.5.4",
"fs-extra": "^10.1.0",
"jest": "^27.2.5",
Expand Down
8 changes: 7 additions & 1 deletion standalone-cli/standalone.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
let Module = require('module')
let origRequire = Module.prototype.require
let log = require('tailwindcss/lib/util/log').default

let localModules = {
'tailwindcss/colors': require('tailwindcss/colors'),
Expand All @@ -11,7 +12,12 @@ let localModules = {
'@tailwindcss/aspect-ratio': require('@tailwindcss/aspect-ratio'),
'@tailwindcss/container-queries': require('@tailwindcss/container-queries'),
'@tailwindcss/forms': require('@tailwindcss/forms'),
'@tailwindcss/line-clamp': require('@tailwindcss/line-clamp'),
'@tailwindcss/line-clamp': () => {
log.warn('line-clamp-in-core', [
`The @tailwindcs/line-clamp plugin is now part of Tailwind CSS v3.3`,
`Remove it from your config to silence this warning`,
])
},
'@tailwindcss/typography': require('@tailwindcss/typography'),

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