-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstyle.css
86 lines (79 loc) · 1.71 KB
/
style.css
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
html {
box-sizing: border-box;
font-family: sans-serif;
}
*,
*::after,
*::before {
box-sizing: inherit;
margin: 0;
padding: 0;
}
/* ----------- body element's style's */
.container {
height: 100vh;
background-color: #23232b;
display: flex;
justify-content: center;
align-items: flex-start;
padding-top: 80px;
}
.dropdown-menu {
display: grid;
grid-template-rows: 40px max-content;
gap: 10px;
}
.dropdown-toggle {
all: unset;
background-color: dodgerblue;
color: white;
width: 150px;
padding: 10px;
display: flex;
justify-content: space-between;
align-items: center;
border-radius: 5px;
}
.dropdown-toggle::after {
content: " ";
width: 6px;
height: 6px;
border-width: 0 2.3px 2.3px 0;
border-style: solid;
transform: rotate(45deg);
transition: 0.4s;
}
.dropdown-list {
background-color: white;
color: #444;
list-style: none;
display: grid;
grid-template-rows: repeat(4, 40px);
border-radius: 5px;
overflow: hidden;
height: 0;
transition: 0.4s;
}
.dropdown-list__item {
display: flex;
align-items: center;
padding-left: 10px;
transition: 0.4s, transform 0.4s var(--delay);
transform: translateX(-100%);
user-select: none;
cursor: pointer;
}
.dropdown-list__item:hover {
background-color: dodgerblue;
color: #fff;
}
/* ------------- function */
.dropdown-toggle:focus::after {
transform: rotate(225deg);
}
.dropdown-toggle:focus ~ .dropdown-list {
height: 160px;
}
.dropdown-toggle:focus ~ .dropdown-list .dropdown-list__item {
transform: translateX(0);
}