Skip to content

Commit

Permalink
Fix long strings of text without spaces overflow the block
Browse files Browse the repository at this point in the history
  • Loading branch information
arthur791004 committed Aug 25, 2021
1 parent cfc5d8b commit 690b83e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
3 changes: 3 additions & 0 deletions packages/block-library/src/heading/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ h3,
h4,
h5,
h6 {
// Break long strings of text without spaces so they don't overflow the block.
overflow-wrap: break-word;

&.has-background {
padding: $block-bg-padding--v $block-bg-padding--h;
}
Expand Down
11 changes: 8 additions & 3 deletions packages/block-library/src/list/style.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
ol.has-background,
ul.has-background {
padding: $block-bg-padding--v $block-bg-padding--h;
ol,
ul {
// Break long strings of text without spaces so they don't overflow the block.
overflow-wrap: break-word;

&.has-background {
padding: $block-bg-padding--v $block-bg-padding--h;
}
}
5 changes: 5 additions & 0 deletions packages/block-library/src/paragraph/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@
font-style: normal;
}

p {
// Break long strings of text without spaces so they don't overflow the block.
overflow-wrap: break-word;
}

// Prevent the dropcap from breaking out of the box when a background is applied.
p.has-drop-cap.has-background {
overflow: hidden;
Expand Down

0 comments on commit 690b83e

Please sign in to comment.