-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve treatment of custom values in Gutenberg form fields #35558
Comments
Here's an idea. We could indicate that all or some of the values are being calculated dynamically showing a message and replacing the calculated field with a button.
Some questions:
|
Yeah, I think this makes sense. I'm not sure of the label here — "dynamic" doesn't seem specific enough, and "*" feels maybe a little vague. Maybe "custom"? 🤔
In general, no — I think these values would confuse more users.
Yes, I think so. Some sort of "revert" would be great. I'm not sure if this is possible though, since the value might just come from a pasted-in block pattern. In that case, I'm not sure we'd actually be saving it anywhere. |
I like that, @shaunandrews! Instead of "This value is calculated automatically", maybe something like "This is a custom dynamic value" or something like that? Either way, that's a small detail that I think we can refine — I'd love to see a PR to try this out. |
theme.json and block markup can accept a wide range of values that can't (and probably shouldn't appear in the Gutenberg UI. For example:
calc()
clamp()
min()
max()
minmax()
All of these are valid block markup. When they are used, Gutenberg currently just shows an empty form field in the UI. For example, here's some sample markup that uses a
max()
value for padding:Result:
We don't want to display these exact CSS calculations, since that'll be too complicated for the user. But we also shouldn't show a blank form field, since the user doesn't know that there's actually a value there. Is there something else we can display in cases like this?
The text was updated successfully, but these errors were encountered: