-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Website sidebar nested options support (#51)
* Initial support (lacking transitions) * Add carets, and transitions on submenu openings
- Loading branch information
1 parent
efe818b
commit b8bc2b3
Showing
5 changed files
with
168 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
// Sidebar menu | ||
// ----------------------------------------------- | ||
// ----------------------------------------------- | ||
|
||
.sidebar-menu { | ||
.sidebar-menu-item { | ||
display: flex; | ||
flex-direction: column; | ||
position: relative; | ||
|
||
&.active { | ||
> a, | ||
a.active { | ||
box-shadow: 3px 0 $brand-tertiary inset; | ||
} | ||
|
||
& > button { | ||
box-shadow: 3px 0 rgba($brand-tertiary, 0.5) inset; | ||
} | ||
} | ||
|
||
&.open { | ||
a { | ||
background: rgba($brand-primary, 0.3); | ||
} | ||
|
||
.caret::before { | ||
top: 4px; | ||
left: -6px; | ||
border-top: 6px solid rgba($white, 0.8); | ||
border-left: 6px solid transparent; | ||
border-right: 6px solid transparent; | ||
} | ||
|
||
.caret::after { | ||
left: -4px; | ||
top: 4px; | ||
border-top: 4px solid $brand-secondary; | ||
border-left: 4px solid transparent; | ||
border-right: 4px solid transparent; | ||
} | ||
|
||
.sub-menu { | ||
max-height: 600px; // This will suffice for 9 entries in a submenu tops | ||
} | ||
} | ||
|
||
button, | ||
a { | ||
text-align: left; | ||
padding: $base-point-grid * 2; | ||
width: 100%; | ||
font-size: 1rem; | ||
font-family: $base-font-family; | ||
color: $white; | ||
transition: background $base-duration $base-timing; | ||
|
||
&:hover { | ||
background: rgba($brand-primary, 0.15); | ||
color: $white; | ||
text-decoration: none; | ||
} | ||
} | ||
|
||
.caret { | ||
position: absolute; | ||
right: ($base-point-grid * 3); | ||
top: $base-point-grid * 2; | ||
pointer-events: none; | ||
} | ||
|
||
.caret::before { | ||
content: ''; | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
border-left: 6px solid rgba($white, 0.8); | ||
border-top: 6px solid transparent; | ||
border-bottom: 6px solid transparent; | ||
transition: border 0.3s ease, top 0.2s ease, left 0.2s ease; | ||
} | ||
|
||
.caret::after { | ||
content: ''; | ||
position: absolute; | ||
left: 0; | ||
top: 2px; | ||
border-left: 4px solid $brand-secondary; | ||
border-top: 4px solid transparent; | ||
border-bottom: 4px solid transparent; | ||
transition: border 0.3s ease, top 0.3s ease, left 0.3s ease; | ||
} | ||
|
||
|
||
.sub-menu { | ||
max-height: 0px; | ||
transition: max-height 0.6s ease-in-out; | ||
overflow: hidden; | ||
|
||
a { | ||
font-size: 0.875rem; | ||
padding-left: (($base-point-grid * 3)); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters