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

contentSize in theme.json is applied differently in the editor and in the frontend #42290

Open
adamziel opened this issue Jul 10, 2022 · 6 comments
Labels
CSS Styling Related to editor and front end styles, CSS-specific issues. [Feature] Layout Layout block support, its UI controls, and style output. [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") [Type] Enhancement A suggestion for improvement.

Comments

@adamziel
Copy link
Contributor

adamziel commented Jul 10, 2022

Description

When ch units are used for the content width, the site editor doesn't interpret this correctly and as a result short lines end up being aligned to the right:

{
	"settings": {
		"appearanceTools": true,
		"layout": {
			"contentSize": "76ch",
			// ...
		}
	}
}

This happens in the editor:

CleanShot 2022-07-10 at 11 55 18@2x

While this happens on the frontend:

CleanShot 2022-07-10 at 11 54 09@2x

Note this issue is not so apparent when pixels are used because there is no visual difference between the class name applied to the wrapper and the children elements.

What do I expect to happen?

I'd like the editor to do the same thing as frontend – do not apply the max-width: 76ch to the heading blocks, just to the wrapper.

cc @scruffian @WordPress/block-themers

@carolinan
Copy link
Contributor

carolinan commented Jul 11, 2022

To clarify, are you saying that headings are aligned to the right when ch is used? I am not sure what "this happens" means, there is also a text size difference between the two images?
Can you add any additional testing instructions?

@draganescu draganescu added [Status] Needs More Info Follow-up required in order to be actionable. Needs Testing Needs further testing to be confirmed. CSS Styling Related to editor and front end styles, CSS-specific issues. [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") labels Jul 11, 2022
@github-actions
Copy link

Help us move this issue forward. This issue is being marked stale since it has no activity after 15 days of requesting more information. Please add info requested so we can help move the issue forward. Note: The triage policy is to close stale issues that need more info and no response after 2 weeks.

@github-actions github-actions bot added the [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. label Jul 27, 2022
@scruffian
Copy link
Contributor

When ch units are used for the content width, the site editor doesn't interpret this correctly and as a result short lines end up being aligned to the right.

@kathrynwp kathrynwp removed [Status] Needs More Info Follow-up required in order to be actionable. [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. labels Jul 27, 2022
@carolinan
Copy link
Contributor

Is this in any way related to ch not being added to settings.spacing.units?

@github-actions github-actions bot added the [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. label Aug 28, 2022
@kathrynwp kathrynwp removed the [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. label Sep 19, 2022
@github-actions
Copy link

Hi,
This issue has gone 30 days without any activity. This means it is time for a check-in to make sure it is still relevant. If you are still experiencing this issue with the latest versions, you can help the project by responding to confirm the problem and by providing any updated reproduction steps.
Thanks for helping out.

@github-actions github-actions bot added the [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. label Oct 20, 2022
@mikachan mikachan removed the [Status] Stale Gives the original author opportunity to update before closing. Can be reopened as needed. label Oct 21, 2022
@Mamaduka Mamaduka removed the Needs Testing Needs further testing to be confirmed. label Nov 1, 2022
@picard102
Copy link

So what I think they are expecting to happen is that the contentSize be applied to the content area as a wrapper rather than on each individual block. This is an issue when using the ch unit as it's relative to the font size set on each block. So the headings progressively get larger widths which causes the layout to look broken. Ideal the contentSize when using a unit like ch would be relative to the base font size.

Screenshot 2023-06-11 at 11 43 14 AM

@jordesign jordesign added [Type] Enhancement A suggestion for improvement. [Feature] Layout Layout block support, its UI controls, and style output. labels Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CSS Styling Related to editor and front end styles, CSS-specific issues. [Feature] Layout Layout block support, its UI controls, and style output. [Feature] Site Editor Related to the overarching Site Editor (formerly "full site editing") [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

9 participants