Styling in Editor

I suggest that the visual editor should pick up basic styling from the active theme by default. I know that theme designers can incorporate this, but most don’t. It makes sense for the font, and for changes to blockquote styling etc could be automatically picked up by the visual editor.


Read-only archive: https://petitions.classicpress.net/posts/60/styling-in-editor

Author: Paul Taylor

Vote count: 3

Status: open

Tags:

  • request-modify-feature

Comments

I just want to make it clear how editor styles work.
The current editor is TinyMCE. It uses an iframe to render the content for the visual mode. Even if the theme’s style sheet is loaded into the iframe, very little of the styles will affect the content. Although a theme needs to style all HTML elements (so the content will be styled), the majority of the styles are for making menus, sidebars, footers, and the special parts of pages such as featured images and page titles look good. But none of that is in the editor’s iframe.
At the same time, a lot of themes have customizable colors or fonts, so only the defaults are in the stylesheet. The chosen ones are dynamic styles. It can be done, but the theme needs to do it, not core or the editor.

TinyMCE has a plugin called importcss that takes a stylesheet and makes a format menu out of the classes. This is of questionable value since it’s not so good to have your presentation tied to your markup. When you switch themes, you lose all that. And it only works on the stylesheet you point it to, so again, the theme would need to do it, especially for the dynamic parts.

One interesting thing is that the background color is a core option that the theme adds support for. Core could actually do this one, but the text color is not, so it’s unbalanced. A new theme_support value for colors and font could be added, but again, the theme would have to call it, so it might as well just load the stylesheet instead.

There is a Preview button.

5 Likes

As for my preference, and to communicate a “no” vote on this petition:
front end is not backend.

Big dot and silence after that :slight_smile:

I do not like Gutenberg because it tries to show me the front end in the backend. Why would I like a TinyMCE that shows me the background color of the front end? Or perhaps the same font? Nope thanks. Such theme gets actually uninstalled immediately, because it bothers me a lot. And I am happy there are many themes doing their job in the front end, very well, and leave the backend alone.

3 Likes