Open fabiankaegy opened 1 month ago
@jameskoster @jasmussen @richtabor Would love to hear your thoughts on this. And I think this could use some design help to figure out how to best present it :)
This would be a small improvement over using theme.json>settings>custom, or trying to keep consistency using a ref in theme.json.
@carolinan Yeah we already do this in our themes in code. But we often still need to select from different options for what radius should be used on a component level... Like for example two different groups may need different radii. And that is not something that we can really accomplish with just the defaults... Yeah we can hard code it in a pattern but then we loose the ability to change it site wide when the radius needs to be tweaked
Agree this would be a nice improvement.
The UI will need some thought. Hopefully we can reuse elements of the spacing controls. I suppose it would need to support:
Does that sound right? Perhaps something like this could work:
The UI will need some thought. Hopefully we can reuse elements of the spacing controls. I suppose it would need to support:
I like that this follows closely to the https://github.com/WordPress/gutenberg/issues/63963 concepts pitched. We could reuse that certainly.
Like for example two different groups may need different radii. And that is not something that we can really accomplish with just the defaults... Yeah we can hard code it in a pattern but then we loose the ability to change it site wide when the radius needs to be tweaked
A short-term option could also be to leverage block style variations. They'd be editable via Global Styles, should the need to change them arise, with the changes automatically applied anywhere the variation was applied.
Tiny nitpick, the footprint of the icons inside the 24x24 base in these feel a bit too large:
Can we maybe build upon custom theme.json settings to expose custom presets instead of, or in addition to, using a scale? (similarly to what we have with colors currently)
For example:
Another way to do it might be adding "Var" to the units drop-down and then manually typing the var name to the input field (maybe in the future have a dropdown or autocomplete).
For example, a design might have "soft corners" (let's say border-radius: 12px
) that need to be applied to many but not all elements.
We can create: "globalBorderRadius": "12px"
custom setting in theme.json
(or through the UI).
It isn't a small-medium-large sort of thing.
Let's say in the future the designer wants to switch from 12px
to 10px
, it doesn't make sense to redefine what small or medium is. Instead, we can just change the globalBorderRadius
setting.
Another way of seeing it is as bringing custom CSS properties (variables) into the editor UI. In the context of border-radius It can be applied either to each corner individually, or to all corners tighter,
This is how I understand the original message by @fabiankaegy, but maybe I'm missing something.
Like spacing, color, aspect ratios etc. Border Radii are something that should be applied consistently throughout a design. Instead of having to always manually enter the raw px value it would be great to be able to use a variable instead. Ideally this would work similar to the spacing control where you can either provide a variable or enter the raw value.