How do I overflow/breakout a side menu item label?

Hello, slowly improving my CSS knowledge but trying to work out a "classic" case of breaking out a collapsed side menu's label on hover. I'm not sure how I can achieve this with the current styling and HTML I've put in place so far. From what I've read, I need to make a parent element position: relative and then make the label element position: absolute to break it out? I could be totally wrong here of course 😄 . CSS & HTML can be viewed at the link below: https://scorado-examples-nextjs-a3t5m8myz-scorado.vercel.app/ CSS source: https://github.com/scorado-ltd/scorado-examples-nextjs-cosmos/blob/feature/framework-styling/src/feature/framework/navigation/sideMenu/index.module.scss Any help is most appreciated!
GitHub
scorado-examples-nextjs-cosmos/src/feature/framework/navigation/sid...
Contribute to scorado-ltd/scorado-examples-nextjs-cosmos development by creating an account on GitHub.
No description
19 Replies
MarkBoots
MarkBoots•11mo ago
unfortunatly we are not authorized to see the vercel app (team only) in this case you'll probably get away with making the SideMenu__itemLabel positioned absolute, relative to the ideMenu__item you can position the label by setting the top/right/bottom/left (or inset) properties so for example
.ideMenu__item{
position: relative;
}
.SideMenu__itemLabel{
position: absolute;
left: 100%;
}
.ideMenu__item{
position: relative;
}
.SideMenu__itemLabel{
position: absolute;
left: 100%;
}
can not test it
Maynards
MaynardsOP•11mo ago
Ah, I can change that in Vercel!
Maynards
MaynardsOP•11mo ago
A bit of additional info in the mean time... I'm definitely not understanding what's going on, if I change the width of the only element that has overflow-x: hidden then I start to see the content. Even if I change just the overflow-x on that to visible, it doesn't make any difference. Only changing the width does.
No description
MarkBoots
MarkBoots•11mo ago
ohw, you have overflow hidden on it... that's makes it difficult.
Maynards
MaynardsOP•11mo ago
That Vercel link should be visible now Even if I change that overflow-x to visible, it doesn't seem to make a difference
MarkBoots
MarkBoots•11mo ago
you cant have any overflow hidden on it, even the y axis has to be gone for that
Maynards
MaynardsOP•11mo ago
Oooh, I see
MarkBoots
MarkBoots•11mo ago
it is creating a container it can not escape
Maynards
MaynardsOP•11mo ago
That is indeed a problem then <:mace_laughing:1176448783480012840>
MarkBoots
MarkBoots•11mo ago
there is a future feature in the making to have a clip-margin for overflow. but don't know the status of that
Maynards
MaynardsOP•11mo ago
Any suggestion on an alternative route for this?
MarkBoots
MarkBoots•11mo ago
yea, removing the scroll and let js control the scrolling if nessessary (with margin-top/bottom) but I don't have an out of the box solution for that
Maynards
MaynardsOP•11mo ago
How would I hide the menu items that overflow when the browser height is reduced though?
Maynards
MaynardsOP•11mo ago
Essentially this behaviour
No description
MarkBoots
MarkBoots•11mo ago
unfortunately i don't have much time now to dive into it too much. I can look at it tommorrow. Or maybe someone else can jump in (for me it's past midnight now)
Maynards
MaynardsOP•11mo ago
NP, it's almost midnight here as well 🙂 I hear bed calling also! Appreciate enlightening me with the fact overflow-y was causing the issue.
Coder_Carl
Coder_Carl•11mo ago
The quick and dirty answer to this is to just wrap the menu items inside a div that sits inside the menu div. the menu items div has the overflow rather than the parent that currently has it this allows you to have the menu items still appear as needed
Maynards
MaynardsOP•11mo ago
I'm not sure that would work for me because there will likely be other kinds of menu items that all need to be within the same scrollable area. I'll have a play around though <a:kylo_approvesThumbsUp:1176520048538570804>.
No description
Maynards
MaynardsOP•11mo ago
I've ended up going down the JavaScript root Have a separate element outside of the overflow hidden element and then position it next to the menu items using the mouse events.
Want results from more Discord servers?
Add your server