Skip to content

Commit

Permalink
Remove Tailwind CSS v3.3 warning (#28)
Browse files Browse the repository at this point in the history
* Remove Tailwind CSS v3.3 warning

* Update changelog
  • Loading branch information
reinink committed Mar 30, 2023
1 parent 9b1fc08 commit 645c7b6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 22 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

- Nothing yet!
- Remove Tailwind CSS v3.3 warning ([#28](https://github.com/tailwindlabs/tailwindcss-line-clamp/pull/28))

## [0.4.3] - 2023-03-30

Expand Down
13 changes: 8 additions & 5 deletions package-lock.json

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

3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,5 @@
"setupFilesAfterEnv": [
"<rootDir>/jest/customMatchers.js"
]
},
"dependencies": {
"semver": "^7.3.8"
}
}
13 changes: 0 additions & 13 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
const semver = require('semver')
const tailwindPkg = require('tailwindcss/package.json')
const plugin = require('tailwindcss/plugin')

const baseStyles = {
Expand All @@ -10,17 +8,6 @@ const baseStyles = {

const lineClamp = plugin(
function ({ matchUtilities, addUtilities, theme, variants }) {
if (semver.gte(tailwindPkg.version, '3.3.0')) {
console.log(
`\u001b[31m${[
'As of Tailwind CSS v3.3, the `@tailwindcss/line-clamp` plugin is now included by default.',
'Remove it from the `plugins` array in your configuration to eliminate this warning.',
].join('\n')}\u001b[0m`
)

return
}

const values = theme('lineClamp')

matchUtilities(
Expand Down

0 comments on commit 645c7b6

Please sign in to comment.