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

-webkit-line-clamp has pixel value instead of unit value #2

Closed
lukebennett88 opened this issue Jan 7, 2021 · 3 comments
Closed

-webkit-line-clamp has pixel value instead of unit value #2

lukebennett88 opened this issue Jan 7, 2021 · 3 comments

Comments

@lukebennett88
Copy link
Contributor

I just tried adding this plugin to a project. I was replacing an existing plugin with the same API (https://github.com/JamesHRowe/tailwindcss-line-clamp/blob/master/index.js).

However the outputted CSS looks like this with the new plugin:

.line-clamp-3 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3px;
}

image

I just had a look at the source of both hoping I could figure it out and submit a PR, but from what I can tell, they both look pretty similar and I can't see why px would be getting appended to the value.

Hopefully it's something simple!

@adamwathan
Copy link
Member

Make sure in your config file your line clamp settings are in quotes ("3" not 3) or PostCSS will convert it to a pixel value. We can probably coerce them to strings internally to avoid this but that is likely your problem 👍🏻

@lukebennett88
Copy link
Contributor Author

That makes sense! Thanks Adam 🙌

@RobinMalfait
Copy link
Member

Hey! Thank you for your bug report!
Much appreciated! 🙏

As Adam mentioned, for now you have to use the string. But I merged the PR that makes your config a bit cleaner, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants