Overflow with flexbox resulting in hacky use of calc
I'm having issues finding a more elegant solution that does not result in flexbox children overflowing by not respecting its parent's width.
Specifically
sidebar-profile-name
is overflowing the sidebar with longer names where I'd rahter have it cut off as to not extend onto multiple lines.
HTML (Vue 3 with Nuxt)
CSS (SCSS)
6 Replies
Without my hacky solution
maybe what you are looking for is
word-break
For use in the
sidebar-profile-name
? Quickly reading up on it, that causes the username to slip onto two lines, correct? - which I don't want (added that as an explicit requirement in my post after your hint).if you want it clipped like that i don't think there is a better solution 🙂
Alright, thanks a lot. I was questioning my sanity as I usually find the more complex solutions where there's an easier one.
but one thing i would use
overflox-x: hidden;
and text-overflow: ellipsis;
and add title attribute with the name so when you hover you can read the whole thing