17 Replies
I hope this helps you. 😀
I think It works. Thank you
👍
It seems like the first after class is thicker than others. Do you know how to fix it ?
Can you share your code, along with the HTML and the rest of the styling for the list on codepen or something similar. That way it would be easier for someone to help you debug.
couldn't this just be a single pseudo with a left and bottom border?
It could also be done with a gradient background
on the size inconsistency sometimes if you go with
.8px
instead of 1px
things will even out. This is what the browser does when you say ask for a border-width: 1px;
if you check the computed panel in dev tools you'll see it actually renders at .8px
. I have no idea why.Great tip; I’ve been defaulting to 2px just because 1px gets weird I didn’t think about going the other way
I try to check the computed panel on different browsers (firefox, chrome, edge) and I see it renders at
1px
. However, you're right. When I set the height to .8px
, all after element will even out. Thanks👍 , might be different depending on 2x, 3x etc monitors? Screen shot from my new-ish 2x laptop in Firefox:
can confirm that on my old 1x monitor from 2008 that just won't die I get
1px
computed at 1px
Hi guys, It's me again 😅. I wonder how to handle this case?
A bit "hacky" but I got something like this working by giving the "tree" items a class name and only applying the tree lines to those elements.
The left-hand line of these items extends upwards way beyond the height of the element to allow for the different heights. This does however require that the parent element has
overflow: hidden
to prevent the line from flowing all the way up the page outside of the list container.
https://codepen.io/cbolson/pen/XWvXYMB
This is quite a common design pattern so I am sure that there is a more standard way of achieving this 🤔If you need it to expand and collapse, I came across this
https://codepen.io/AleksandrHovhannisyan/pen/PoaayLO
Thanks guy. I've done it 😅