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

Font has unexpectedly changed to Times New Roman #45

Open
bobbingwide opened this issue Jul 23, 2024 · 4 comments
Open

Font has unexpectedly changed to Times New Roman #45

bobbingwide opened this issue Jul 23, 2024 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@bobbingwide
Copy link
Owner

On seriouslybonkers.com the font-family for several fields has changed from "Tahoma, Arial, sans serif"
to "Times New Roman".

I don't know why
theme is SB v0.5.0

image

@bobbingwide bobbingwide added the bug Something isn't working label Jul 23, 2024
@bobbingwide bobbingwide self-assigned this Jul 23, 2024
@bobbingwide
Copy link
Owner Author

bobbingwide commented Jul 23, 2024

This appears to be something to do with Gutenberg
In s.b//bigram the active version of Gutenberg was 18.1.2
When deactivated the font family changes.

In live, the version of Gutenberg is 18.8.0... but Gutenberg isn't activated.
Activating Gutenberg and clearing the cache doesn't resolve the issue.

@bobbingwide
Copy link
Owner Author

Updating to Gutenberg 18.8.0 resolved the additional issue of links being underlined,
but not the font problem.
This fix is coming in WordPress 6.6.1

image

@bobbingwide
Copy link
Owner Author

bobbingwide commented Jul 23, 2024

In the following CSS, which is inline, the var for font-family, -wp--preset--font-family--opensans, is undefined.

:root :where(body) {
    background-color: var(--wp--preset--color--background);
    color: var(--wp--preset--color--foreground);
    font-family: var(--wp--preset--font-family--opensans);
    padding-top: 0px;
    padding-right: 0px;
    padding-bottom: 0px;
    padding-left: 0px;
}

It seems that theme.json was wrong. There are two font family definitions.

"fontFamilies": [
					{
						"fontFamily": "Tahoma, Arial, sans-serif",
						"slug": "tahoma-arial"
					},
					{
						"fontFamily": "Helvetica Neue, Helvetica, Arial, sans-serif",
						"slug": "helvetica-arial"
					}

				],

The fix is to correct style.typography.fontFamily to use one of the defined values.

"typography": {
			"fontFamily": "var(--wp--preset--font-family--tahoma-arial)"
		},

This works regardless of whether or not Gutenberg ( 18.8.0 ) is activated.

@bobbingwide
Copy link
Owner Author

bobbingwide commented Jul 23, 2024

I've made the following changes on live:

  • updated the theme.json file
  • updated to WordPress 6.6.1
  • deactivated Gutenberg 18.8.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant