Skip to content

Commit

Permalink
Typography: Make title blocks apply typographic styles consistently (#…
Browse files Browse the repository at this point in the history
…65307)

Co-authored-by: aaronrobertshaw <aaronrobertshaw@git.wordpress.org>
Co-authored-by: andrewserong <andrewserong@git.wordpress.org>
Co-authored-by: vcanales <vcanales@git.wordpress.org>
Co-authored-by: justintadlock <greenshady@git.wordpress.org>
Co-authored-by: richtabor <richtabor@git.wordpress.org>
  • Loading branch information
6 people authored Sep 18, 2024
1 parent f77a466 commit d67b83f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 50 deletions.
5 changes: 1 addition & 4 deletions packages/block-library/src/post-title/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,5 @@
}
}
},
"style": "wp-block-post-title",
"selectors": {
"typography": ".wp-block-post-title, .wp-block-post-title > a"
}
"style": "wp-block-post-title"
}
25 changes: 4 additions & 21 deletions packages/block-library/src/post-title/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,14 @@
// This block has customizable padding, border-box makes that more predictable.
box-sizing: border-box;

&[style*="font-weight"] :where(a) {
font-weight: inherit;
}
&[class*="-font-family"] :where(a),
&[style*="font-family"] :where(a) {
:where(a) {
display: inline-block;
font-family: inherit;
}
&[class*="-font-size"] :where(a),
&[style*="font-size"] :where(a) {
font-size: inherit;
}
&[style*="line-height"] :where(a) {
line-height: inherit;
}
&[style*="font-style"] :where(a) {
font-style: inherit;
}
&[style*="letter-spacing"] :where(a) {
font-weight: inherit;
letter-spacing: inherit;
}
&[style*="text-decoration"] :where(a) {
line-height: inherit;
text-decoration: inherit;
}

a {
display: inline-block;
}
}
5 changes: 1 addition & 4 deletions packages/block-library/src/site-title/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,5 @@
}
},
"editorStyle": "wp-block-site-title-editor",
"style": "wp-block-site-title",
"selectors": {
"typography": ".wp-block-site-title > span, .wp-block-site-title > a"
}
"style": "wp-block-site-title"
}
25 changes: 4 additions & 21 deletions packages/block-library/src/site-title/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,14 @@
// This block has customizable padding, border-box makes that more predictable.
box-sizing: border-box;

&[style*="font-weight"] :where(a) {
font-weight: inherit;
}
&[class*="-font-family"] :where(a),
&[style*="font-family"] :where(a) {
:where(a) {
color: inherit;
font-family: inherit;
}
&[class*="-font-size"] :where(a),
&[style*="font-size"] :where(a) {
font-size: inherit;
}
&[style*="line-height"] :where(a) {
line-height: inherit;
}
&[style*="font-style"] :where(a) {
font-style: inherit;
}
&[style*="letter-spacing"] :where(a) {
font-weight: inherit;
letter-spacing: inherit;
}
&[style*="text-decoration"] :where(a) {
line-height: inherit;
text-decoration: inherit;
}

:where(a) {
color: inherit;
}
}

1 comment on commit d67b83f

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flaky tests detected in d67b83f.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/10913435671
📝 Reported issues:

Please sign in to comment.