You’re not wrong, but the fault lies at the different way these components are setup, one using the d-icon and the other not lending itself to that atm. Would love to see that changed so feel free to help out if you know how.
With the new styling it will need more space, but I agree the current padding is too much.
This has been an ongoing debate amongst designers since the inception of the toggle. There is no right or wrong answer.
This was one of the ideas from the design session I personally liked a lot. It solves (some of) sam’s and cvx’s remarks. I’ll give this a go in the next iteration.
I think the chevron would be better on the left. I think most people won’t see it on the right. It looks like regular text (kind of like a code block) unless the mouse passes over it. I almost missed it.
(14. ) The recent addition of a click handler means clicking a link, using the copy code button, trying to expand an image, or even attempting to select any text will result in collapsing the details block…
I fully agree with this. I (nearly) missed reading multiple detail blocks in the past couple of days. I think it’s because they look similar to code blocks on first glance.
Strange, clicking a link does work for me. I closes the details but the link also opens. Haven’t tried the other scenarios. And I agree it can do with some more refined JS work
About the position of the chevron, @jordan-vidrine wdyt?
Shall I do another iteration? Maybe how I had it in mind orginally, with the regular triangle instead of chevron and only a bg on opened?
Yeah I really liked the idea of being able to hover anywhere > highlight > click to close, instead of only being able to click on the summary part, but I had overlooked the propagation of other clicks
Some nitpicky thoughts about the latest iteration…
Should the arrow be aligned by the baseline rather than centering? this feels better to me than centering on multi-line examples… but this may be subjective:
if we pad the entire container, we should maybe try to remove any padding from the last element… this could be too tricky because we have many content types… but perhaps something like:
details > :last-child {
padding-bottom: 0;
}
I agree that we should go a shade darker when this is within a quote, so the background isn’t lost
then a quote can override it… maybe we could even have a generic “needs to be darker” in a quote variable? can’t recall if we have other situations like this…
I like using something like rgba(var(--primary-rgb),0.25) for this purpose as it just makes whatever it’s current background of the element it is included in a bit darker.
The actual clickable area of the summary element is smaller than the element that changes the cursor and highlights on hover
Because of that on-hover background color and the following change when you expand an element – there’s a brief background color flash when expanding an element
edit:
A discrepancy between a rendered post and the composer: