Skip to content

Instantly share code, notes, and snippets.

@CHINOBv
Created November 25, 2020 10:00
Show Gist options
  • Save CHINOBv/09e68417839c203545f91fafe2f31e5a to your computer and use it in GitHub Desktop.
Save CHINOBv/09e68417839c203545f91fafe2f31e5a to your computer and use it in GitHub Desktop.
Button Search with Animation
.search {
position: absolute;
padding: 5px;
& input {
display: inline-block;
border: 1px solid silver;
font-size: 18px;
outline: none;
background-color: #f1f1f1;
border-radius: 30px;
width: 0px;
height: 40px;
padding: 0 20px;
transition: all 0.6s ease;
color: #000;
}
&:hover input {
width: 240px;
}
& input:focus {
width: 240px;
}
&-button-fast {
position: absolute;
top: 0;
right: 0;
background-color: $primary;
width: 55px;
height: 55px;
line-height: 55px;
text-align: center;
color: #fff;
font-size: 20px;
border-radius: 50%;
cursor: pointer;
}
&-icon {
color: black;
display: block;
margin: auto;
font-size: 20px;
}
}
<div>
<div className="container">
<div className="search">
<input type="text" placeholder="Buscar"/>
<div className="search-button-fast">
<i className="fas fa-search"></i>
</div>
</div>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment