JSFiddle - React, Tailwind, and code Playground
by tonyleeper
HTML
<div class="ribbon">
<input type="text" />
<button class="search">s</button>
<button class="close">c</button>
</div>
CSS
* {
padding: 0;
margin: 0;
box-sizing: border-box;
}
.close {
display: none;
}
.ribbon {
font-size: 0;
height: 50px;
line-height: 50px;
border: 1px solid black;
border-radius: 5px;
}
button {
width: 27px;
height: 27px;
line-height: 27px;
vertical-align: middle;
border: 1px solid #aaa;
border-radius: 0;
border-bottom-right-radius: 2px;
border-top-right-radius: 2px;
background: -webkit-linear-gradient(top,#f4f4f4 4%,#e2e2e2 4%,#e2e2e2 96%,#d6d6d6 96%);
}
input {
font-size: 12px;
height: 27px;
vertical-align: middle;
border: 1px solid #aaa;
border-right: 0;
border-radius: 0;
border-bottom-left-radius: 2px;
border-top-left-radius: 2px;
}
JavaScript
/**
Search button layout
*/
$("button").on("touchstart", function (e) {
$("button").toggle().focus();
});