-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Try optimizing the default column width #7112
Conversation
This PR does a few things. - Primarily it changes the _default_ column width. It used to be 608, now it's 580px. 580px is about the width of 70 characters, which is widely suggested as the maximum amount of characters per column for readibility. Don't worry, you can still customize this width with an editor style, we've recently made that easier to do: https://wordpress.org/gutenberg/handbook/extensibility/theme-support/#changing-the-width-of-the-editor - It retires a text-editor width variable, and uses the same content width variable, so the two editors are the same widths. - It removes a few ToDo's.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😂 Thanks Matt, appreciated! I'm going to await some thoughts on the specific width as well! |
Seems about right. https://baymard.com/blog/line-length-readability |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The content width change makes sense to me 👍
Seems the default max-width will also have to be changed in https://github.com/WordPress/gutenberg/blob/master/editor/store/defaults.js#L62. Unless I'm missing something https://wordpress.org/gutenberg/handbook/extensibility/theme-support/#changing-the-width-of-the-editor seems to be missing the fact that Also, allowing plugins and themes to set arbitrary max-width for the editor will need more UI tests. What happens to the UI when it is 380px wide? What about 870px or 1024px? :) Generally thinking that allowing plugins and themes to (drastically) change the editor appearance is not a good idea. Gutenberg is not WYSIWYG, it doesn't have to be. Letting themes and plugins change some of the styles is fine, allowing "arbitrary CSS" -- not so much. Background: about 1/4 of the problems reported in support forums with the classic editor are caused by editor-style.css :) Edit: actually this is probably worth a new issue. |
Addressed feedback in #7112 (comment). Updates the default column width to match that of the JS constant.
Thank you! PR in #7198.
I'm not sure how to do that — can you help me here? Thanks.
I disagree that allowing themers to style the editor is a bad idea, especially in an editor whose main concept is to allow greater visual freedom, the disconnect between the admin and the end result can be jarring, and for that reason, direct manipulation and WYSIWYG have been part of the Gutenberg vision for more than a year. Of course we need to ensure a good, accessible, basic layout style. We can even consider a user option to turn off an theme editor style if people prefer the default Gutenberg style, just like how web browsers let you override website styles. That could be worth a new ticket. |
Should we expose another filter on PHP side to make it customizable, similar to what we do with colors? |
I'm not sure what the variable does. I'm guessing it is used when inserting images to preset dimensions perhaps. In any case, if it's an important variable for themers, we should ideally make it as easy as possible for them to customize. |
Uh, sorry, I opened #7180 for using either CSS or the
I don't mean we should completely disallow that, but imho it would be much better to have some strict restrictions on what can be added/changed. There are several reasons:
|
Addressed feedback in #7112 (comment). Updates the default column width to match that of the JS constant.
This PR does a few things.
I'm open to suggestions as to the width of the main column — this is a suggestion for now. But it would be nice to choose a nice and round number other than 608, and apply it to both the visual and the text editor.
Screenshots, before:
Screenshots, after: