Closed ScribbleGhost closed 1 year ago
Normal is a legacy font size slug which was used in WordPress but has been replaced by "medium". The following CSS is added to the editor to preserve backwards compatibility:
// This CSS Custom Properties aren't used anymore as defaults,
// but we still need to keep them for backward compatibility.
.editor-styles-wrapper {
--wp--preset--font-size--normal: 16px;
--wp--preset--font-size--huge: 42px;
}
Normal is a legacy font size slug which was used in WordPress but has been replaced by "medium".
Hi @carolinan thanks, do you think this will be looked at if that's the case?
I think if these font size slugs are added to theme.json, that new value must be used instead of the above.
I was unable to reproduce this on both WordPress 6.1.1 and WordPress 6.2-RC4. I have changed the theme.json
in emptytheme as follows:
As shown below, the --wp--preset--font-size--normal
CSS variable is overridden and the fluid font size is applied. Am I missing something?
I was testing with Twenty Twenty Three, I changed one of the existing fluid sizes in theme.json to normal
. š¤
I was testing with Twenty Twenty Three, I changed one of the existing fluid sizes in theme.json to normal. š¤
I have also tried this method and the CSS variables seem to be overwritten correctly in both the front end and the editor( post editor and site editor) š¤
@ScribbleGhost
Could you provide all the code for theme.json
? Also, it would be great if you could check if this problem reproduces in WordPress 6.2.
@t-hamano I no longer have the theme.json file that didn't work, but this issue seems to have been resolved in WordPress 6.2 Here is an example that works.
{
"$schema": "https://schemas.wp.org/wp/6.2/theme.json",
"settings": {
"appearanceTools": true,
"layout": {
"contentSize": "620px",
"wideSize": "1000px"
},
"spacing": {
"units": [
"%",
"px",
"em",
"rem",
"vh",
"vw"
]
},
"typography": {
"fontFamilies": [
{
"fontFamily": "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif",
"name": "System Font",
"slug": "system-font"
}
],
"fluid": true,
"fontSizes": [
{
"fluid": {
"max": "22.5px",
"min": "20.0px"
},
"name": "Normal",
"size": "22.5px",
"slug": "normal"
}
]
}
},
"templateParts": [
{
"area": "header",
"name": "header"
},
{
"area": "footer",
"name": "footer"
}
],
"version": 2
}
Edit: It also seems that setting the minimum size as the "size"
is better than setting the largest (max) number as "size"
.
@ScribbleGhost
I also tested your code and could not reproduce it. How about closing this issue? If the problem remains, we can reopen this issue or submit a new one.
Closing this issue as we are unable to replicate it for now.
Description
Using the slug name
normal
as a fluid font size does not work in the full site editor.This will not work:
The site editor defaults to 16px for all text that is Normal.
However, if I change the name of the fontSizes slug to something different, for example
body-text
, the font will scale fluidly as intended in the site editor.This will work:
I have managed to replicate this problem across multiple themes, even new ones starting from scratch.
Step-by-step reproduction instructions
normal
.normal
)Screenshots, screen recording, code snippet
Environment info
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes