-
Notifications
You must be signed in to change notification settings - Fork 297
/
_search.scss
134 lines (118 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
/*************************
* Search field
*/
.bd-search {
position: relative;
padding: 1rem 15px;
margin-right: -15px;
margin-left: -15px;
.icon {
position: absolute;
color: var(--pst-color-border);
left: 25px;
}
input {
background-color: var(--pst-color-background);
border-radius: 0.2rem;
border: 1px solid var(--pst-color-border);
padding-left: 2.5rem;
color: var(--pst-color-border);
// Inner-text of the search bar
&::placeholder {
color: var(--pst-color-border);
}
// Background should always be same color regardless of active or not
&:active,
&:focus {
background-color: var(--pst-color-background);
color: var(--pst-color-text-base);
}
// Remove the little "x" that pops up when you start typing
&::-webkit-search-cancel-button,
&::-webkit-search-decoration {
-webkit-appearance: none;
appearance: none;
}
}
// Shows off the keyboard shortcuts for the button
.search-button__kbd-shortcut {
position: absolute;
right: 2em;
color: var(--pst-color-border);
}
}
/*************************
* Search button
*/
// Search link icon should be a bit bigger since it is separate from icon links
.search-button {
display: flex;
align-items: center;
align-content: center;
padding: 0;
color: var(--pst-color-text-muted);
&:hover {
color: var(--pst-color-primary);
}
i {
font-size: 1.3rem;
}
}
// __search-container will only show up when we use the search pop-up bar
.search-button__search-container,
.search-button__overlay {
display: none;
}
.search-button__wrapper.show {
.search-button__search-container {
display: flex;
// Center in middle of screen just underneath header
position: fixed;
z-index: $zindex-modal;
top: 30%;
left: 50%;
transform: translate(-50%, -50%);
right: 1rem;
margin-top: 0.5rem;
width: 90%;
max-width: 800px;
}
.search-button__overlay {
display: flex;
position: fixed;
z-index: $zindex-modal-backdrop;
background-color: black;
opacity: 0.5;
width: 100%;
height: 100%;
top: 0px;
left: 0px;
}
form.bd-search {
flex-grow: 1;
padding-top: 0;
padding-bottom: 0;
}
// Font and input text a bit bigger
i,
input {
font-size: 1.5rem;
}
}
/**
* Button behavior on mobile / wide so it shows up in the header on mobile.
*/
// The navbar end version should only show on wide screens
.navbar-end__search-button-container {
display: none;
@include media-breakpoint-up($breakpoint-header) {
display: flex;
}
}
// The one next to the hamburger menu only shows on narrow screens
.search-button-container--mobile {
margin-left: auto;
@include media-breakpoint-up($breakpoint-header) {
display: none;
}
}