Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

theme.json: Code block typography fontFamily isn't working #31135

Closed
danieldudzic opened this issue Apr 23, 2021 · 0 comments · Fixed by #31742
Closed

theme.json: Code block typography fontFamily isn't working #31135

danieldudzic opened this issue Apr 23, 2021 · 0 comments · Fixed by #31742
Assignees
Labels
[Block] Code Affects the Code Block [Status] In Progress Tracking issues with work in progress

Comments

@danieldudzic
Copy link

Here's the markup for the code block:

<pre class="wp-block-code"><code></code></pre>

When setting a fontFamily:

"core/code": {
	"typography": {
		"fontFamily": "var(--wp--preset--font-family--base)"
	}
}

The style gets applied to .wp-block-code, but that's the <pre> tag, and this causes the user agent stylesheet
to take precedence:

code


The solution here would be to apply font-family to .wp-block-code code rather than .wp-block-code.

cc: Automattic/themes#3640

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Code Affects the Code Block [Status] In Progress Tracking issues with work in progress
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants