forked from primer/view_components
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathauto_complete.pcss
More file actions
111 lines (95 loc) · 2.73 KB
/
Copy pathauto_complete.pcss
File metadata and controls
111 lines (95 loc) · 2.73 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
/* autocomplete */
/* This file can be deprecated when AutoComplete is upstreamed to PVC + rolled out to dotcom https://github.com/github/primer/issues/796
** AutoComplete relies on FormControl, Overlay and ActionList CSS */
/* Stacked label (default) */
.autocomplete-label-stacked {
display: block;
margin-bottom: var(--base-size-6);
}
/* Inline label (non-default) */
.autocomplete-label-inline {
display: inline;
margin-right: var(--base-size-6);
}
/* Switch to stacked at smaller viewport */
@media (max-width: 543.98px) {
.autocomplete-label-inline {
display: block;
margin-bottom: var(--base-size-6);
}
}
/* Wrapper for the input and result elements to ensure alignment */
.autocomplete-body {
position: relative;
display: inline;
}
/* Wrapper and conditional styles for when an icon is added */
.autocomplete-embedded-icon-wrap {
display: inline-flex;
padding: var(--base-size-4) var(--base-size-8);
align-items: center;
&:focus-within {
border-color: var(--borderColor-accent-emphasis);
@mixin focusBoxShadowInset;
}
& .form-control {
padding: 0;
margin-left: var(--base-size-8);
border: none;
box-shadow: none;
&:focus {
box-shadow: none;
}
&:focus-visible {
box-shadow: none;
}
}
}
/* A pop up list of items used to show autocompleted results */
.autocomplete-results {
position: absolute;
left: 0;
z-index: 99;
width: max-content;
min-width: 100%;
max-height: 20em;
overflow-y: auto;
font-size: var(--text-codeBlock-size);
list-style: none;
background: var(--overlay-bgColor);
border: var(--borderWidth-thin) solid var(--borderColor-default);
border-radius: var(--borderRadius-medium);
box-shadow: var(--shadow-resting-medium);
}
/* One of the items that appears within an autocomplete group
** Bold black text on white background */
.autocomplete-item {
display: block;
width: 100%;
padding: var(--base-size-4) var(--base-size-8);
overflow: hidden;
font-weight: var(--base-text-weight-semibold);
color: var(--fgColor-default);
text-align: left;
text-decoration: none;
text-overflow: ellipsis;
white-space: nowrap;
cursor: pointer;
background-color: var(--overlay-bgColor);
border: 0;
/* `color` is inherited, so setting it on the item recolors descendants
** without a universal `… *` descendant rule (which forces a slow
** style-recalc match attempt against every element on the page). */
&:hover {
color: var(--fgColor-onEmphasis);
text-decoration: none;
background-color: var(--bgColor-accent-emphasis);
}
&.selected,
&[aria-selected='true'],
&.navigation-focus {
color: var(--fgColor-onEmphasis);
text-decoration: none;
background-color: var(--bgColor-accent-emphasis);
}
}