Skip to content

Commit 085861d

Browse files
committed
Implement basic SideMenu component
1 parent cf7c27d commit 085861d

File tree

4 files changed

+37
-0
lines changed

4 files changed

+37
-0
lines changed

app/components/side-menu.hbs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<ul role="list" local-class="list" ...attributes>
2+
{{yield (hash Item=(component "side-menu/item"))}}
3+
</ul>

app/components/side-menu.module.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.list {
2+
list-style: none;
3+
margin: 0;
4+
padding: 0;
5+
6+
> * + * {
7+
margin-top: 8px;
8+
}
9+
}

app/components/side-menu/item.hbs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<li>
2+
<a href={{@link.url}} local-class="link {{if @link.isActive "active"}}" {{on "click" @link.transitionTo}}>{{yield}}</a>
3+
</li>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
.link {
2+
display: block;
3+
padding: 10px 12px;
4+
border-radius: 6px;
5+
color: var(--main-color-light);
6+
transition: all 300ms ease-in;
7+
8+
&:hover {
9+
background-color: var(--main-bg-dark);
10+
color: var(--main-color);
11+
transition: none;
12+
}
13+
}
14+
15+
.active {
16+
background-color: var(--main-bg-dark);
17+
color: var(--main-color);
18+
19+
&:hover {
20+
background-color: #e5e1cd;
21+
}
22+
}

0 commit comments

Comments
 (0)