Skip to content

Commit 05902d9

Browse files
handymathis@gmail..comhandymathis@gmail..com
authored andcommitted
added base dropdown design
1 parent 898a60e commit 05902d9

File tree

5 files changed

+83
-0
lines changed

5 files changed

+83
-0
lines changed

dropdown/animations.scss

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
@import "./dropdown.scss";
2+
3+
.dropdown.active {
4+
display: flex;
5+
animation-name: showDropdown;
6+
animation-fill-mode: forwards;
7+
animation-duration: 1s;
8+
}
9+
10+
@keyframes showDropdown {
11+
from {
12+
top: -100%;
13+
opacity: 0.5;
14+
}
15+
to {
16+
top: 2.5%;
17+
opacity: 1;
18+
}
19+
}

dropdown/dropdown.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.dropdown {
2+
width: fit-content;
3+
height: fit-content;
4+
border-radius: 12px;
5+
padding: 10px 10px 10px 10px;
6+
display: none;
7+
position: absolute;
8+
top: -100%;
9+
overflow: hidden;
10+
}

dropdown/menu.scss

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
.dropdown-menu {
2+
display: flex;
3+
flex-direction: column;
4+
width: 100%;
5+
height: 100%;
6+
}
7+
8+
.dropdown-submenu {
9+
@extend .dropdown-menu;
10+
position: absolute;
11+
right: -100%;
12+
}
13+
14+
.dropdown-menu-item {
15+
width: 200px;
16+
height: 50px;
17+
display: flex;
18+
flex-direction: row;
19+
justify-content: center;
20+
align-items: center;
21+
border-radius: 7px;
22+
transition: .3s;
23+
}
24+
25+
.dropdown-menu-item:hover {
26+
filter: brightness(2);
27+
}

dropdown/theme.scss

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
@import "./dropdown.scss";
2+
@import "./menu.scss";
3+
4+
@mixin dropdownTheme($class-name, $bg-color, $text-color) {
5+
6+
.dropdown.#{$class-name} {
7+
background: $bg-color;
8+
box-shadow: 1px 1px 1px rgba(0,0,0,0.2);
9+
}
10+
11+
.#{$class-name} .dropdown-menu-item {
12+
color: $text-color;
13+
font-family: "Roboto", sans-serif;
14+
font-size: 1.2em;
15+
background: $bg-color;
16+
}
17+
}

main.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@
2727
@import "./cards/responsive.scss";
2828

2929

30+
// Dropdown
31+
@import "./dropdown/dropdown.scss";
32+
@import "./dropdown/menu.scss";
33+
@import "./dropdown/theme.scss";
34+
@import "./dropdown/animations.scss";
35+
36+
3037

3138
// Buttons
3239
@include buttonBase(btn-blue, #1d3bae, #264BD9, #fff);
@@ -62,3 +69,6 @@
6269
@include cardTheme(card-light, #fff, rgba(0,0,0,0.4), #000);
6370
@include cardTheme(card-grey, #303030, rgba(0,0,0,0.6), #fff);
6471
@include cardTheme(card-dark, #161616, rgba(0,0,0,0.6), #fff);
72+
73+
// Dropdown
74+
@include dropdownTheme(dropdown-dark, #232323, #fff);

0 commit comments

Comments
 (0)