Replies: 3 comments 5 replies
-
I think this is a good idea, but I'm not sure it should follow the same structure as block.json. Options like |
Beta Was this translation helpful? Give feedback.
-
What a fascinating idea @adamziel! I quite like the idea of defining it in an |
Beta Was this translation helpful? Give feedback.
-
My initial reaction here is that blocks are infinite in number and infinitely configurable, while elements are a handful with a handful of configurations. It seems a really heavy solution. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
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
Beta Was this translation helpful? Give feedback.
All reactions