-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdropdown.css
More file actions
77 lines (65 loc) · 1.48 KB
/
Copy pathdropdown.css
File metadata and controls
77 lines (65 loc) · 1.48 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
.dropdown {
position: relative;
display: inline-block;
}
.dropdown-control:not([aria-controls]) {
display: none;
}
.dropdown-control {
position: relative;
display: flex;
align-items: center;
background: hsl(0, 0%, 93%);
border: 1px solid hsl(0, 0%, 62%);
border-bottom-width: 0;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
padding: .5rem .75rem;
}
.dropdown-control[aria-expanded="false"] {
border-radius: 4px;
border-bottom-width: 1px;
}
.dropdown-control[aria-expanded="true"] {
z-index: 99;
}
.dropdown-control-caret {
display: block;
border: solid hsl(0, 0%, 66%);
border-width: 0 2px 2px 0;
height: .33rem;
margin-left: .5rem;
pointer-events: none;
transform: translateY(-20%) rotate(45deg);
width: .33rem;
}
.dropdown-control[aria-expanded="true"] .dropdown-control-caret {
transform: translateY(20%) rotate(-135deg);
}
.dropdown-target {
border: 1px solid hsl(0, 0%, 62%);
border-radius: 4px;
box-shadow: 1px 1px 2px hsl(0, 0%, 82%);
display: block;
background: #eee;
padding: .5rem .75rem;
}
.dropdown-target[aria-hidden="true"] {
display: none;
}
.dropdown-target[aria-hidden="false"] {
border-top-left-radius: 0;
min-width: 100%;
position: absolute;
top: 2rem;
left: 0;
z-index: 98;
}
.dropdown-target ul {
padding: 0;
margin: 0;
list-style: none;
}
.dropdown-target li:not(:last-child) {
margin-bottom: .25rem;
}