This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Introduce Element.json #41748
Labels
[Feature] Block API
API that allows to express the block paradigm.
[Feature] Site Editor
Related to the overarching Site Editor (formerly "full site editing")
[Package] Edit Site
/packages/edit-site
[Type] New API
New API to be used by plugin developers or package users.
What problem does this address?
As of recently, the Site Editor supports button elements.
The idea was to have a building block that's can be managed and embedded in other blocks (such as search), but that isn't a Gutenberg block in itself and thus doesn't support features like reordering.
Here's a problem: how to surface the Button element in global styles UI?
@scruffian explored updating the relevant sidebar components in #41659, but it requires updating four files:
That's a lot of files and a lot of copypasted code!
Let's go a step further – how do we manage spacings, borders, and anything else that applies? How do we attach custom CSS?
This exact problem is already solved for blocks via
block.json
and the"supports"
config key.What is your proposed solution?
Let's introduce an
element.json
file – a declarative way of introducing and configuring elements.With
element.json
in place, the above PR could look as follows:Adding support for margins and would involve adding the relevant
spacing
and__experimentalBorder
configuration keys.cc @scruffian @draganescu @getdave @dmsnell @mcsf @gziolo @Mamaduka @noisysocks @tellthemachines @ellatrix @ramonjd @andrewserong @mtias
The text was updated successfully, but these errors were encountered: