Skip to content

Commit

Permalink
πŸ› Change word-break style of description (#253)
Browse files Browse the repository at this point in the history
* πŸ› Change `word-break` style of description

Use `break-word` instead of `break-all` to avoid
breaking in the middle of the words in description.

* Create short-trains-push.md

* Update short-trains-push.md

---------

Co-authored-by: Wei He <[email protected]>
  • Loading branch information
Sec-ant and wei authored Apr 12, 2024
1 parent 1a51c72 commit 0e8a230
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/short-trains-push.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"socialify": minor
---

Change `word-break` style of description
2 changes: 1 addition & 1 deletion src/components/preview/__snapshots__/card.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ exports[`Card #2 renders 1`] = `
</p>
<p
class="card-description-wrapper"
style="display: flex; justify-content: center; width: 100%; margin-top: 10px; margin-bottom: 0px; font-size: 17px; line-height: 1.4; max-height: 3em; overflow: hidden; word-break: break-all; white-space: pre-wrap;"
style="display: flex; justify-content: center; width: 100%; margin-top: 10px; margin-bottom: 0px; font-size: 17px; line-height: 1.4; max-height: 3em; overflow: hidden; word-break: break-word; white-space: pre-wrap;"
>
TEST DESCRIPTION
</p>
Expand Down
2 changes: 1 addition & 1 deletion src/components/preview/card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export const Card = (config: Configuration) => {
lineHeight: 1.4,
maxHeight: '3em',
overflow: 'hidden',
wordBreak: 'break-all',
wordBreak: 'break-word',
whiteSpace: 'pre-wrap'
}}>
{config.description.value}
Expand Down

0 comments on commit 0e8a230

Please sign in to comment.