I have a list of links that when hovered have a stylish underline using :after - however, I need to add another effect when an item is active/ hovered on (pictured below).
When active, a "cut out triangle" should be at the end of the element to connect it visually to the wide expanded content to the right.
I'm already adding an :after class on the link elements, so not sure how I can achieve this design?
.content-links {
width: 25%;
background-color: #fafafa;
padding-left: 5.6rem;
padding-top: 8rem;
min-height: 100vh;
}
.content-links ul li {
margin-bottom: 32px;
}
.content-links li {
list-style: none;
}
.content-links a {
text-decoration: none;
font-size: 16px;
line-height: 24px;
}
li a:after {
z-index: 1;
position: absolute;
bottom: -8px;
left: 0;
right: 0;
margin: auto;
width: 0%;
content: '.';
color: transparent;
background: black;
height: 3px;
}
li a {
position: relative;
}
li a:hover {
color: green;
font-weight: 600;
}
li a:hover:after,
li a:active:after {
transition: all 0.2s;
width: 100%;
}
.content-panel {
background-color: red;
}
<div class="content-links">
<ul>
<li>
<a href="#">Festivals</a>
</li>
<li>
<a href="#">Events</a>
</li>
<li>
<a href="#">Concerts</a>
</li>
</ul>
</div>
<div class="content-panel"></div>
EDIT: having explored :after and :before further, I'm not sure this is the most effective way of making this happen, I intended on using a triangle like so:
width: 0;
height: 0;
border-top: 25px solid transparent;
border-right: 50px solid #555;
border-bottom: 25px solid transparent;
but achieving both the borders (to make it look like a part of the container on the right) and actually the positioning (to be totally responsive) is proving to be a little hacky.

:before?:after?