I am currently working on creating a mobile-friendly version of a menu. I have a list of items, and I want only the item with the class nav-current to be displayed initially. Using pseudo :after, I added an arrow after the link of that specific li element. My goal is to make all the list items visible when the arrow is clicked.
This is my HTML code:
<ul class="top-nav">
<li>
<a href=#>Textbla</a>
</li>
<li class="nav-current">
<a href=#>Textlpops</a>
</li>
<li>
<a href=#>Google Res</a>
</li>
</ul>
And here is my Sassy CSS:
$depends:none;
.top-nav {
float: none;
margin: 10px;
li,li.user-tools {
display:$depends;
float:none!important;
border-bottom: 1px solid #666;
&:last-child {
border-bottom:0 none;
}
&.nav-current {
display:block;
border-bottom:0 none;
a:after {
content:'arrow';
color:#1a1a1a;
position:absolute;
top:10px;
right:20px;
height:12px;
background: transparent url(../images/custom/arrow_down.png) no-repeat left top;
}
a:target:after {
$depends:block;
}
}
}
}
I am trying to achieve this without using any JavaScript, so I am looking for a solution solely in SASS or utilizing CSS3 tricks. Is there a way to accomplish this in SASS or are there any CSS3 features that could help me achieve this effect?