JSFiddle - React, Tailwind, and code Playground
Nice half pixel border for focused inputs.
by nilloc
HAML
.line
.box.focused
height:
%span.input 20px ⌄
<!-- downarrow is just quick and dirty placeholder -->
SCSS
:root {
--line-end-size: 20px;
--line-width: 1px;
}
div {
position: absolute;
display: inline-block;
top: 20px;
left: 20px;
box-sizing: border-box;
font-family: helvetica;
font-size: 10px;
}
.line {
height: 1px;
width: 200px;
border-top: 1px solid #4A90E2;
overflow: visible;
}
.line::before,
.line::after {
content: " ";
position: absolute;
border-left: 1px solid #4A90E2;
height: calc(var(--line-end-size) + var(--line-width));
width: var(--line-width);
top: cal(var(--line-end-size) / 2px);
left: 0;
}
.line::after {
left: unset;
right: -1px;
}
.box {
top: 21px;
left: 50px;
height: 20px;
padding-top: 2px;
padding-left: 4px;
padding-right: 1px;
}
.focused {
background-color: #4A90E2;
border-radius: 3px;
color: white;
font-weight: bold;
border: 0.5px solid white;
}
.input {
background-color: white;
color: hsla(0, 0%, 20%, 1);
padding: 2px;
padding-bottom: 3px;
border: 0.5px solid #D8D8D8;
/* box-shadow: 0 1px 1px 0 rgba(0,0%,0%,0.2); */
border-radius: 2px;
}