-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Design tools: Better handling of unset / inherited values #43082
Comments
I've thought about this a fair bit, and it seems to me that coming up with designs that will entertain the scenario outlined in the OP for every single control is probably not the best way to allocate resources. It would be a large undertaking (for both design and development), and given that this issue is one that should disappear over time, a holistic solution feels like a better way to tackle this. By far the simplest approach imo, would be to hide local controls when there is no determinate source value. So if you're editing a Group block in a post, and there are no styles for Group in theme.json or global styles, you'd see something like this: If you add a control – for example font-size – then it appears in the panel with a value set like so: The value would come from global styles if possible, but if not then a default custom value would be used: Most importantly, the control never appears as "unset". Instead, "unset" is communicated by the control not being present at all. This idea is inspired by CSS, where classes are able to inherit styles without declaring them. The main drawback to this approach is that controls you might expect to find on certain blocks by default will often be hidden. For example a paragraph block wouldn't have a font-size control visible by default. A group block wouldn't have a padding control. In both cases you'd need to add the control manually before setting a value. I don't find this to be a big problem personally, but am keen to hear thoughts and feedback on this idea. |
Thanks for the excellent thoughts outlined here 🙏
This feels like a big enough drawback to me. Especially because the indeterminate value as we've been able to test for padding in trunk for the past few weeks, hasn't felt substantially confusing. As more and more values are brought into theme.json, the problem should also shrink, so I'm not sure the value of hiding by default outweighs the downside at this point 🤔 |
I also encountered this issue with block spacing within a row while using Twenty Twenty-Two. In that case, with the sliders, it's very much not clear that values are unset. The sliders are at their minimum value by default, and the only way to achieve the true minimum spacing is by engaging the slider, moving it to a higher value, and then putting it back to the minimum. While I too hope that this problem will self-heal over time, I also think that this should fail gracefully in the meantime. Almost any sort of indicator could help communicate to the user "please play with this slider because what you're seeing doesn't match". |
This came up as a point of distraction with the FSE Outreach Program's Site Editor exploration:
It also ties in nicely with various feedback the outreach program has gotten over the many calls for testing. Folks want to know what the default values are, especially when it comes to continued customization. For example, trying to use the font size presets only to find that "medium" is actually smaller than the text they have currently. |
Although more and more people using theme.json to set default values would be great. There will still probably be custom styles set in a CSS file for some themes and the ability to unset these values I think is important, as the user may want to experiment with a control, and then undo the changes they made. From what I have seen with the Typography Size selection, it is tricky to unset, where you should just be able to click on the active size to untoggle its value. |
I'd like to reiterate how awkward this is in the slider used in spacing presets, where it appears to show "0" as the default when that is not the case, and then if you click on the control it then sets it to actually be 0, with no obvious way to revert. This is extremely unintuitive: CleanShot.2023-01-04.at.09.10.05-trimmed.mp4
I don't think this is feasible to expect. In a complex design, there are too many edge cases to account for unless you want to dumb everything down to fit the system as designed. Just a few that come to mind from CSS I've written:
These kind of subtle tweaks to design elements are not something that content editors should be routinely expected to make when authoring content (and them doing so would be lead to a ton of inconsistency in the design). They are also not easily expressed using ever more nested JSON objects. |
This came up in the nineteenth call for testing for the FSE Outreach Program:
In particular, we also need to think about how to display these variables when adding a background color as that inherently adds padding as this issue reflects #30725 |
We have multiple examples of this being a recurring pain point in the case of Twenty Twenty-Three, where users have a really hard time figuring out how to remove the margin above the header:
I have recorded the steps to do this and as you can see, it is not as intuitive as it should: Screen.Capture.on.2023-04-20.at.12-04-07.1.mp4I will add that even if that was fixed and and the controls were visible by default and did not default to This probably merits a separate issue but I would like to have some "visual aid" to help users identify where the spacing is coming from. |
Interesting. Might work. |
What's the difference between this issue and #49278? If they are a duplicate it sounds like we can break this down in to a few shippable releases:
Is there any other points of clarification we need before moving to dev? Who can help out with this piece to move it forward? |
This issue was mostly about how to handle unset style properties in the UI. In short: it's confusing how a control like background color communicates an unset/empty value when a background color is clearly being applied somewhere. A solution for that is captured in the designs shared in 49278. If we proceed with those, this issue can be closed. |
Another way we could consider handling unset/inherited values is by showing a "computed" style for properties: #57296 |
Experienced this earlier today with the Astra theme - which is, still hybrid? |
Hi folks, |
@colorful-tones as a heads up, what work is ready for this specific overaching issue is here: #37752 I'm going to add this to the 6.6 board as a "to do" as it's ready for dev and I've been attempting to track down dev help :) (Mamaduka is going to tackle it!). |
There was a lot of discussion on this in #42173, with no optimal outcome. Consensus was to explore a holistic solution.
The problem
It is possible for styles to be applied to blocks in ways that we cannot programatically detect. Confusion arises when what is printed on the canvas does not seem to match the configuration in the Inspector. As an extreme example take a look at this Group block and its settings:
Clearly text color, padding, background, border, and radius are all being applied. And yet the corresponding tools give no clear indication of this. Indeed many of them suggest they are unset (see: #37752).
It would be good explore an intuitive design convention we can apply consistently across these controls so that users have a better understanding of what is happening.
Existing patterns
The font-size control attempts to clarify things by communicating it is set to 'default'. But this is confusing because the label is ambiguous – does 'default' mean the default value from global styles, or the default value inherited from whatever stylesheet? In any case a text label may not be a feasible solution since not all controls display their value as text, e.g. color values are illustrated as swatches.
The padding preset control from the PR above attempts a kind of 'indeterminate' state, which is okay. But again I'm not sure how to apply that globally. What does an indeterminate color swatch look like?
I'm not aware of any other controls that attempt to tackle this problem.
I think its worth noting that this is a problem that will hopefully self-heal over time, as more theme developers migrate to theme.json and away from custom styles. But until then it would be good to at least explore potential solutions to this problem.
The text was updated successfully, but these errors were encountered: