JSFiddle - React, Tailwind, and code Playground
by rigor789
HTML
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<div class="container">
<div class="Header">
<input type="text" placeholder="Start typing to filter">
<div class="Settings">
<i class="material-icons">settings</i>
</div>
</div>
<ul class="VerticalList">
<li class="entry">
<div class="entry-icon">
<span class="shortcut-badge">1</span>
<i class="material-icons">text_format</i>
</div>
<span class="entry-content">Foo very long entr overflow <strong class="highlight">bar</strong> and you will get annoyed</span>
</li>
<li class="entry is-active">
<div class="entry-icon">
<span class="shortcut-badge">2|ENTER</span>
<img src="http://lorempixel.com/128/128/abstract/?1" alt="">
</div>
<span class="entry-content">Foo2 <strong class="highlight">bar</strong></span>
</li>
</ul>
</div>
CSS
.container {
width: 350px;
height: 400px;
background: #222;
color: #eee;
font-family: Roboto, sans-serif;
overflow: hidden;
}
.Header {
height: 50px;
box-shadow: 0 4px 2px -2px rgba(33, 33, 33, 0.3);
position: relative;
z-index: 1;
background: #34495e;
}
.Header input {
border: none;
outline: none;
background: transparent;
box-sizing: border-box;
width: 300px;
height: 50px;
padding: 15px;
font-size: 16px;
color: #eee;
}
.Header input::-webkit-input-placeholder {
color: #eee;
}
.Settings {
position: absolute;
height: 50px;
width: 50px;
display: flex;
align-items: center;
justify-content: center;
top: 0;
right: 0;
cursor: pointer;
}
.Settings:hover {
background: rgba(0, 0, 0, 0.1);
}
.VerticalList {
display: flex;
flex-direction: column;
list-style: none;
margin: 0;
padding: 0;
}
.entry {
display: flex;
align-items: center;
padding-right: 15px;
}
.entry.is-active {
background: #263238;
}
.entry-icon {
min-width: 60px;
min-height: 60px;
width: 60px;
height: 60px;
margin-right: 15px;
display: flex;
align-items: center;
justify-content: center;
position: relative;
}
.shortcut-badge {
position: absolute;
font-family: monospace;
top: 3px;
left: 3px;
font-size: 10px;
padding: 2px 4px;
background: rgba(0, 0, 0, 0.5);
border-radius: 2px;
}
.entry-icon img {
width: 100%;
height: 100%;
}
.entry-icon {
background: #2c3e50;
}
.entry-content {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.highlight {
background: #e67e22;
padding: 2px;
border-radius: 2px;
font-weight: normal;
}