-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDropdown.module.css
More file actions
92 lines (85 loc) · 1.72 KB
/
Copy pathDropdown.module.css
File metadata and controls
92 lines (85 loc) · 1.72 KB
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
87
88
89
90
91
92
.dropdown {
display: inline-block;
position: relative;
text-overflow: ellipsis;
user-select: none;
white-space: nowrap;
}
.dropdownButton,
.dropdownButton:active,
.dropdownButton:focus,
.dropdownButton:hover {
align-items: center;
background: inherit;
border: none;
color: inherit;
cursor: pointer;
display: flex;
font-size: initial;
overflow-x: hidden;
padding: 0;
}
/* caret */
.dropdownButton::before {
content: "\25bc";
display: inline-block;
font-size: 10px;
margin-right: 4px;
transform: rotate(-90deg);
transition: transform 0.1s;
}
.dropdown:has([aria-expanded="true"]) .dropdownButton::before {
transform: rotate(0deg);
}
/* alignment */
.dropdownLeft .dropdownContent {
left: 0;
}
.dropdownContent {
background-color: #eee;
position: absolute;
right: 0;
border-radius: 6px;
box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
display: flex;
flex-direction: column;
max-height: 0;
max-width: 300px;
min-width: 160px;
transition: max-height 0.1s ease-out;
overflow-y: hidden;
z-index: 20;
}
.dropdown:has([aria-expanded="true"]) .dropdownContent {
max-height: 170px;
overflow-y: auto;
}
.dropdownContent > * {
display: block;
}
.dropdownContent a,
.dropdownContent button {
background: none;
border: none;
border-radius: 0;
color: inherit;
flex-shrink: 0;
font-size: 12px;
overflow: hidden;
text-overflow: ellipsis;
padding: 8px 16px;
text-align: left;
text-decoration: none;
width: 100%;
}
.dropdownContent a:active,
.dropdownContent a:focus,
.dropdownContent a:hover,
.dropdownContent button:active,
.dropdownContent button:focus,
.dropdownContent button:hover {
background-color: rgba(31, 30, 33, 0.1);
}
.dropdownContent input {
margin: 4px 8px;
}