forked from github/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
search.scss
158 lines (134 loc) · 2.77 KB
/
search.scss
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
/* Search
------------------------------------------------------------------------------*/
/* Global styles
Gets applied to both the search input on homepage and in the header nav
Form and inputs using .ais- prefix gets added by Algolia InstantSearch.js */
.ais-SearchBox {
position: relative;
}
.ais-SearchBox-submit {
display: none;
}
.ais-SearchBox-form {
width: 100%;
display: flex;
}
.ais-SearchBox-input {
width: 100%;
padding: 10px $spacer-2 10px $spacer-5;
font-size: 16px;
@extend .form-control;
background: $white url("/assets/images/octicons/search.svg") no-repeat 6px;
}
.ais-SearchBox-reset {
width: 30px;
height: 100%;
position: absolute;
top: 0;
right: 0;
opacity: 0.5;
border: none;
outline: none;
background: none;
z-index: 1;
@include breakpoint(md) {
header & {
height: 30px;
}
}
.ais-SearchBox-resetIcon {
width: 12px;
height: 12px;
}
}
.ais-Hits-item {
list-style: none;
&:hover {
background: $blue-000;
}
}
/* activated by search-with-your-keyboard arrow navigation */
.ais-Hits-item.active {
background: $blue-000;
}
.search-result-intro {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
mark,
.ais-Highlight-highlighted
{
background: none;
color: inherit;
.search-result-title & {
color: $blue-500;
}
.search-result-intro & {
border-bottom: 1px solid $blue-500;
}
.search-result-content & {
text-decoration: none;
border-bottom: 1px dotted $gray-500;
}
}
.search-result-title em {
font-style: normal;
text-decoration: underline;
}
.search-result-intro em {
font-style: normal;
text-decoration: underline;
}
// Search in header
header {
.ais-SearchBox-form {
margin-bottom: 0;
}
@include breakpoint(md) {
#search-results-container {
display: none;
position: absolute;
top: 0;
right: 0;
width: 0;
border-radius: 3px;
background: $white;
box-shadow: 0 1px 15px $black-fade-15;
transition: width 0.3s ease-in-out;
&.js-open {
display: block;
width: 60vw;
max-width: 760px;
padding: $spacer-7 $spacer-4 $spacer-4 $spacer-4;
}
.ais-Hits {
margin-top: $spacer-4;
}
}
// Overlay is only shown on desktop search modal
.search-overlay-desktop.js-open {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: -1;
display: block;
content: " ";
background: $black-fade-15;
}
.ais-SearchBox-input {
min-width: $spacer-12 * 2;
}
.ais-SearchBox-input.js-open {
width: 55vw;
max-width: 710px;
position: absolute;
right: 0;
top: -26px;
z-index: 1;
transition: width 0.3s ease-in-out;
}
}
}