Skip to content

Commit

Permalink
Enhance content wrapping with text-wrap (#119)
Browse files Browse the repository at this point in the history
Enhance content with text-wrap

Balance headings and captions.
Prevent orphans in longer form content.
  • Loading branch information
adamwoodnz authored Dec 18, 2023
1 parent 3e45255 commit f238779
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
// Create balanced text blocks
h1,
h2,
h3,
h4,
h5,
h6,
caption,
figcaption {
text-wrap: var(--wp--custom--heading--typography--text-wrap);
}

// Prevent orphans
p,
ul,
ol,
blockquote {
text-wrap: var(--wp--custom--body--typography--text-wrap);
}

// Links
a {
cursor: pointer;
Expand Down
6 changes: 4 additions & 2 deletions source/wp-content/themes/wporg-parent-2021/theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,8 @@
},
"body": {
"typography": {
"lineHeight": 1.875
"lineHeight": 1.875,
"textWrap": "pretty"
},
"short-text": {
"typography": {
Expand Down Expand Up @@ -328,7 +329,8 @@
"typography": {
"fontFamily": "var(--wp--preset--font-family--eb-garamond)",
"fontWeight": 400,
"lineHeight": 1.3
"lineHeight": 1.3,
"textWrap": "balance"
},
"cta": {
"typography": {
Expand Down

0 comments on commit f238779

Please sign in to comment.