@tailwindcss/line-clamp
Advanced tools
Comparing version 0.0.0-insiders.d2320ea to 0.0.0-insiders.df16d50
@@ -10,2 +10,36 @@ # Changelog | ||
- Nothing yet! | ||
## [0.4.4] - 2023-03-30 | ||
### Changed | ||
- Remove Tailwind CSS v3.3 warning ([#28](https://github.com/tailwindlabs/tailwindcss-line-clamp/pull/28)) | ||
## [0.4.3] - 2023-03-30 | ||
### Changed | ||
- Warn when used in Tailwind CSS v3.3+ ([#26](https://github.com/tailwindlabs/tailwindcss-line-clamp/pull/26)) | ||
## [0.4.2] - 2022-09-02 | ||
### Fixed | ||
- Update TypeScript types ([#23](https://github.com/tailwindlabs/tailwindcss-line-clamp/pull/23)) | ||
## [0.4.1] - 2022-09-01 | ||
### Added | ||
- Add typescript types ([#22](https://github.com/tailwindlabs/tailwindcss-line-clamp/pull/22)) | ||
## [0.4.0] - 2022-04-27 | ||
This release of `@tailwindcss/line-clamp` is designed for Tailwind CSS v3.0+, and is not compatible with earlier versions. | ||
### Added | ||
- Add support for arbitrary values ([#10](https://github.com/tailwindlabs/tailwindcss-line-clamp/pull/10)) | ||
## [0.3.1] - 2021-12-09 | ||
@@ -49,3 +83,8 @@ | ||
[unreleased]: https://github.com/tailwindlabs/tailwindcss-line-clamp/compare/v0.3.1...HEAD | ||
[unreleased]: https://github.com/tailwindlabs/tailwindcss-line-clamp/compare/v0.4.4...HEAD | ||
[0.4.4]: https://github.com/tailwindlabs/tailwindcss-line-clamp/compare/v0.4.3...v0.4.4 | ||
[0.4.3]: https://github.com/tailwindlabs/tailwindcss-line-clamp/compare/v0.4.2...v0.4.3 | ||
[0.4.2]: https://github.com/tailwindlabs/tailwindcss-line-clamp/compare/v0.4.1...v0.4.2 | ||
[0.4.1]: https://github.com/tailwindlabs/tailwindcss-line-clamp/compare/v0.4.0...v0.4.1 | ||
[0.4.0]: https://github.com/tailwindlabs/tailwindcss-line-clamp/compare/v0.3.1...v0.4.0 | ||
[0.3.1]: https://github.com/tailwindlabs/tailwindcss-line-clamp/compare/v0.3.0...v0.3.1 | ||
@@ -52,0 +91,0 @@ [0.3.0]: https://github.com/tailwindlabs/tailwindcss-line-clamp/compare/v0.2.1...v0.3.0 |
{ | ||
"name": "@tailwindcss/line-clamp", | ||
"version": "0.0.0-insiders.d2320ea", | ||
"version": "0.0.0-insiders.df16d50", | ||
"main": "src/index.js", | ||
"types": "src/index.d.ts", | ||
"license": "MIT", | ||
@@ -16,5 +17,19 @@ "repository": "https://github.com/tailwindlabs/tailwindcss-line-clamp", | ||
}, | ||
"scripts": { | ||
"test": "jest" | ||
}, | ||
"devDependencies": { | ||
"jest": "^27.4.4", | ||
"postcss": "^8.2.2", | ||
"prettier": "^2.5.1", | ||
"tailwindcss": "^3.0.23" | ||
}, | ||
"peerDependencies": { | ||
"tailwindcss": ">=2.0.0 || >=3.0.0 || >=3.0.0-alpha.1" | ||
}, | ||
"jest": { | ||
"setupFilesAfterEnv": [ | ||
"<rootDir>/jest/customMatchers.js" | ||
] | ||
} | ||
} |
@@ -5,2 +5,4 @@ # @tailwindcss/line-clamp | ||
> **Warning** | ||
> As of Tailwind CSS v3.3 the `line-clamp` utilities are now included in the framework by default and this plugin is no longer required. | ||
@@ -32,3 +34,3 @@ ## Installation | ||
Use the `line-clamp-{n}` utilities to specify how many lines of text should be visible before truncating:: | ||
Use the `line-clamp-{n}` utilities to specify how many lines of text should be visible before truncating: | ||
@@ -35,0 +37,0 @@ ```html |
const plugin = require('tailwindcss/plugin') | ||
const baseStyles = { | ||
overflow: 'hidden', | ||
display: '-webkit-box', | ||
'-webkit-box-orient': 'vertical', | ||
} | ||
const lineClamp = plugin( | ||
function ({ addUtilities, theme, variants, e }) { | ||
function ({ matchUtilities, addUtilities, theme, variants }) { | ||
const values = theme('lineClamp') | ||
matchUtilities( | ||
{ | ||
'line-clamp': (value) => ({ | ||
...baseStyles, | ||
'-webkit-line-clamp': `${value}`, | ||
}), | ||
}, | ||
{ values } | ||
) | ||
addUtilities( | ||
[ | ||
Object.entries(values).map(([key, value]) => { | ||
return { | ||
[`.${e(`line-clamp-${key}`)}`]: { | ||
overflow: 'hidden', | ||
display: '-webkit-box', | ||
'-webkit-box-orient': 'vertical', | ||
'-webkit-line-clamp': `${value}`, | ||
}, | ||
} | ||
}), | ||
{ | ||
@@ -20,0 +26,0 @@ '.line-clamp-none': { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
19378
12
231
85
4