Skip to content
This repository has been archived by the owner on Nov 6, 2022. It is now read-only.

[Do not merge] Remove additional styles added to the block editor #479

Conversation

lukecarbis
Copy link
Member

@kienstra This is a small suggestion for the react refactor. It's kind of a hack, but it overcomes the problem of themes modifying the "style" of the Block Editor.

This is intended just as an idea – no need to merge if you don't think it's needed.

@lukecarbis lukecarbis changed the title Remove additional styles added to the block editor [Do not merge] Remove additional styles added to the block editor Nov 25, 2019
@lukecarbis
Copy link
Member Author

@kienstra I've just realised that this approach won't really work.

Sure, it cuts out any styles that are loaded on the editor screen.

But then, what about plugins that extend Gutenberg in various ways?

Yoast might want to load in the sidebar, ACF might try to insert custom fields somewhere, we don't really need the top toolbar, etc.

Maybe we should consider:

  1. Remove editor support when defining the post type (!)
  2. Hide or remove the "classic" metaboxes on the right hand side, so we've got a blank canvas
  3. Add a react <div> to render react stuff in
  4. Add Gutenberg's sidebar component (inspector? I don't know what it's called)
  5. Add our own custom component

This would prevent any extra editor css loading, and it would also stop plugins from extending the block editor interface.

Thoughts?

@kienstra
Copy link
Collaborator

kienstra commented Nov 26, 2019

Good thoughts

Hi @lukecarbis,
That's a good idea to consider this. Other plugins adding meta boxes or scripts to the 'Edit Block' UI would probably be either useless or harmful.

  1. Add Gutenberg's sidebar component (inspector? I don't know what it's called)

It looks like the <SettingsSidebar> component imports the components it uses.

So to use that, we'd have to fork all of those components (or the ones we want).

nent-ssidebar

For the top toolbar, of course the block icon makes no sense for the 'Edit Block' UI. But undo and redo should work in #478, once it's finished:

pr-rea

Also, we could filter out all meta boxes but ours.

One great thing about Gutenberg is that it has a good API for getting and changing the post content client-side.

As you know, the classic editor, like we're using right now, relies on traditional form elements for POST requests, like <input name="foo" id="foo">.

It's probably possible to build our new UI on the classic editor foundation. I might even find a blocker that makes that necessary.

But for now, it looks like Gutenberg gives a lot of advantages for a React-based UI.

@lukecarbis lukecarbis closed this Dec 2, 2019
@lukecarbis lukecarbis deleted the update/469-remove-editor-styles branch December 2, 2019 00:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants