-
Notifications
You must be signed in to change notification settings - Fork 263
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Multiline text overflow ellipsis (#480)
### Description 1. Support multiline text overflow ellipsis(webkit-line-clamp + webkit-box-orient). 2. Fixed a bug where overflow: 'hidden' should not be inherited by child elements. 3. Support the 'line-clamp' property, including custom block ellipsis. I added display: block here because whether it's required by the CSS draft or needed to implement this feature (must be different from display: flex), it seems I have to do so. One thing I want to discuss here is whether we can set the default display to flex, because this is more in line with the original behavior of the browser and does not seem to cause any problems (can pass all unit tests). https://github.com/vercel/satori/assets/22126563/5ec006a7-9cfb-4fc4-9000-adc9fb042c17 https://github.com/vercel/satori/assets/22126563/d672942e-e2c9-423c-8bcf-23a932e7cfb3 Closes: #253 --------- Co-authored-by: Shu Ding <[email protected]>
- Loading branch information
Showing
12 changed files
with
374 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+17.5 KB
...test-tsx-line-clamp-should-not-work-when-display-is-not-set-to-block-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+5.11 KB
...ld-replace-custom-block-ellipsis-with-default-ellipsis-when-too-long-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+16.9 KB
...p-test-tsx-test-line-clamp-test-tsx-line-clamp-should-work-correctly-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+4.36 KB
...amp-test-tsx-line-clamp-should-work-correctly-when-text-align-center-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+13.4 KB
...overflow-is-not-hidden-and-overflow-property-should-not-be-inherited-1-snap.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
e479559
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
satori-playground – ./
og-playground.vercel.app
og-playground.vercel.sh
satori-playground.vercel.sh
satori-playground-git-main.vercel.sh
satori-playground.vercel.app