Add a way to Extend the properties allowed in theme.json schema! (It is currently not possible to use them) #52299
Labels
CSS Styling
Related to editor and front end styles, CSS-specific issues.
Global Styles
Anything related to the broader Global Styles efforts, including Styles Engine and theme.json
[Type] Enhancement
A suggestion for improvement.
What problem does this address?
Hello!
I appreciate very much -> how I am able to extend spacing units in Theme.json, for it to allow us to work with the vast possibilities regarding height and width units... We can build the layout we need, because in fact there are 50 spacing units out there, many more than the ones that come pre-installed by default (px, em, rem...). And even very recent, new, modern Spacing Units are recognized, output and even recognized by the Editor, as long as they have been defined in Theme.json. For example:
Colors are also somewhat extensible in Theme.json, because although the new color spaces LAB and LCH are not possible to be used in the color components, they can be registered in Theme.json and they are going to be output correctly.
Although Theme.json is being somewhat extensible for Spacing Units and Color Spaces, at the same time, the system is very limited, it is a pain point, in how theme.json deals with properties.
Take for example the Logical Properties (margin-block, margin-inline, inset-block, inset-inline, padding-block, padding-inline, border-block, border-inline). These are fantastic properties that are already available in 97% of browsers, and therefore we use them to craft and deliver our projects to clients today.
And they have direct Physical equivalents: margin, padding, top/left/right/bottom, border.
How to work with them in Gutenberg, would you ask? Is it just a matter of writing them in theme.json.....? Yeah, but there is no place for it yet.
Now I need to be clear: I am not requesting a whole new set of components specific for Logical properties.
I just expected that the system would, at least, recognize other CSS properties...
OR a way for us to extend Theme.json, to make the system recognize MORE properties if we need.
A simple improvement below: a section in theme.json where I can declare that: hey, I am going to work with margin-blocks and margin-inlines, instead of the old "physical margins". For example, it could be as easy as writing this in theme.json:
OR IT COULD BE:
Logical margins would at least be recognized in Theme.json, when I set them to blocks:
Currently this is forbidden. Theme.json doesn't recognize these properties. Theme.json recognizes custom Spacing Units and new Color Spaces, but not "custom" properties, and there is no way to extend this small set of default properties.
Any improvement to this would be appreciated in a first moment.
I understand that, at a later time, you could then develop a way to map these custom properties to current properties, in order for them to be used in the Editor instead of the current ones.
Take for example, the need of logical margins instead of physical margins. A simple example:
If I set Logical Margins in Theme.json, the system would be smart enough to map these properties where "margins" are to be set by components in the Editor. But we don't need that in a first moment, just the need to be able to use many more properties, and some of them may never be common to be added to this project, so this feature request come in time...
What is your proposed solution?
The text was updated successfully, but these errors were encountered: