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

Add support of block-overflow #1057

Closed
colorcube opened this issue Feb 11, 2020 · 3 comments · Fixed by #1300
Closed

Add support of block-overflow #1057

colorcube opened this issue Feb 11, 2020 · 3 comments · Fixed by #1300
Labels
feature New feature that should be supported sponsored Issues sponsored to be resolved faster

Comments

@colorcube
Copy link

With very limited space or fixed layouts the possibilities to handle too long text are not enough (overflow).

For example it would be nice to be able to limit a text to 3 lines.

overflow:hidden is not really a solution to the problem because you need a fixed height. If my text is only 2 lines high, I'll get an empty line. That's not always what I want. Even setting a fixed height is not as easy as it sounds. For example the height of UL-LI is not predictable if you have LI margins different to line height and sometimes a LI has two lines.

text-overflow: ellipsis; is implemented in weasyprint but it is very limited.

I know this issue is a very general one and describes not only one problem. As I don't know the solution(s) yet I would like to discuss the problem here. I'm aware that maybe CSS itself has no solution.

What's needed (I guess):

  • make text-overflow work with white-space: normal
  • make text-overflow work with UL/OL
  • possibility to use max-height with text-overflow
  • the box shrink to the displayed lines/text and not max-height
  • setting the max-height to x lines would be nice (that's way out of CSS spec I guess)

For a more visual description here's an image of text-overflow: ellipsis; and what the limitations are

text-overflow

@liZe liZe changed the title Better handling of overflow text Add support of block-overflow Feb 11, 2020
@liZe liZe added the feature New feature that should be supported label Feb 11, 2020
@liZe
Copy link
Member

liZe commented Feb 11, 2020

Hi!

What you want is break-overflow. It’s currently supported by browsers using the -webkit-line-clamp property (even in Firefox), but in a very limited way.

We should follow the specs and do better with WeasyPrint!

@liZe liZe added the sponsored Issues sponsored to be resolved faster label Jan 16, 2021
@rainer-maucher
Copy link

Hi there thanks for your awesome work on WeasyPrint. I would courrently have a big need on the feature requested here. - Can you give a forecast if it will be implemented and or when? - Or if already happened how i can use it? - I dont manage to get it to work...

@grewn0uille
Copy link
Member

Hello @rainer-maucher! We have already worked on this feature, it should be merged very soon ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature that should be supported sponsored Issues sponsored to be resolved faster
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants