Skip to content

Instantly share code, notes, and snippets.

@miniMAC
Created September 7, 2017 13:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miniMAC/5422f7185ef0eb595b387dc9cf343267 to your computer and use it in GitHub Desktop.
Save miniMAC/5422f7185ef0eb595b387dc9cf343267 to your computer and use it in GitHub Desktop.
/* Live Search */
.live-search-modal {
position: fixed;
z-index: 998;
top: 0;
left: 0;
right: 0;
bottom: 0;
width: 100%;
height: 100%;
background-color: rgba(0,0,0,0.9);
display: none;
}
.live-search-close {
text-align: right;
margin: 10px 5% 10px 10px;
font-size: 30px;
color: #fff;
cursor: pointer;
}
#live-search-form {
position: relative;
max-width: 500px;
margin: 0 auto;
}
#live-search-input {
width: 0%;
padding: .8rem;
margin-top: 0px;
max-width: 500px;
border: none;
-webkit-box-shadow: 0 2px 5px 0 rgba(0,0,0,.16), 0 2px 10px 0 rgba(0,0,0,.12);
box-shadow: 0 2px 5px 0 rgba(0,0,0,.16), 0 2px 10px 0 rgba(0,0,0,.12);
outline: none;
-webkit-transition: all 0.3s ease;
transition: all 0.3s ease;
}
#live-search-input.live-search-to-show {
width: 100%;
}
.live-search-reset-btn {
position: absolute;
background-color: transparent;
vertical-align: middle;
cursor: pointer;
width: 0;
height: 0;
border: none;
right: 24px;
top: 5px;
font-size: 24px;
color: #e6e6e6;
outline: none;
-webkit-box-shadow: none;
box-shadow: none;
-webkit-transition: all 0.3s ease;
transition: all 0.3s ease;
display: none;
}
.live-search-reset-btn:hover {
color: #cccccc;
}
.live-search-reset-btn:active,
.live-search-reset-btn:focus {
outline: none;
-webkit-box-shadow: none;
box-shadow: none;
color: #cccccc;
}
#live-search-input:not(:valid) ~ .live-search-reset-btn {
display: none;
}
.live-search-results {
display: none;
overflow: hidden;
overflow-y: scroll;
height: 70vh;
width: 90%;
margin: 0 auto;
max-width: 500px;
background-color: #fff;
-webkit-box-shadow: 0 2px 5px 0 rgba(0,0,0,.16), 0 2px 10px 0 rgba(0,0,0,.12);
box-shadow: 0 2px 5px 0 rgba(0,0,0,.16), 0 2px 10px 0 rgba(0,0,0,.12);
}
.live-search-results::-webkit-scrollbar-track {
background: transparent;
}
.live-search-results::-webkit-scrollbar {
width: 0px;
background: transparent;
}
.live-search-results::-webkit-scrollbar-thumb {
background: transparent;
}
.live-search-result {
opacity: 0;
padding: 1rem;
-webkit-transition: all 0.3s ease;
transition: all 0.3s ease;
}
.live-search-result:hover {
background-color: #f7f7f7;
}
.live-search-result a {
display: inherit;
color: #333;
}
.live-search-result img {
width: 80px;
height: 80px;
-webkit-border-radius: 3px;
border-radius: 3px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment