diff --git a/packages/block-library/src/post-title/block.json b/packages/block-library/src/post-title/block.json index ecb5053d6cd39e..5e7d3eee9dd11d 100644 --- a/packages/block-library/src/post-title/block.json +++ b/packages/block-library/src/post-title/block.json @@ -80,5 +80,8 @@ } } }, - "style": "wp-block-post-title" + "style": "wp-block-post-title", + "selectors": { + "typography": ".wp-block-post-title, .wp-block-post-title > a" + } } diff --git a/packages/block-library/src/post-title/style.scss b/packages/block-library/src/post-title/style.scss index abeb4454bcb2c5..5d0e3407105bd4 100644 --- a/packages/block-library/src/post-title/style.scss +++ b/packages/block-library/src/post-title/style.scss @@ -3,6 +3,30 @@ // 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) { + 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) { + letter-spacing: inherit; + } + &[style*="text-decoration"] :where(a) { + text-decoration: inherit; + } + a { display: inline-block; } diff --git a/packages/block-library/src/site-title/block.json b/packages/block-library/src/site-title/block.json index c75b1bc229beb9..dbb484c74a1e45 100644 --- a/packages/block-library/src/site-title/block.json +++ b/packages/block-library/src/site-title/block.json @@ -75,5 +75,8 @@ } }, "editorStyle": "wp-block-site-title-editor", - "style": "wp-block-site-title" + "style": "wp-block-site-title", + "selectors": { + "typography": ".wp-block-site-title > span, .wp-block-site-title > a" + } } diff --git a/packages/block-library/src/site-title/style.scss b/packages/block-library/src/site-title/style.scss index f292326cc3259f..8647f3d9b2947c 100644 --- a/packages/block-library/src/site-title/style.scss +++ b/packages/block-library/src/site-title/style.scss @@ -2,6 +2,30 @@ // 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) { + 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) { + letter-spacing: inherit; + } + &[style*="text-decoration"] :where(a) { + text-decoration: inherit; + } + :where(a) { color: inherit; }