JSFiddle - React, Tailwind, and code Playground

by watsuyo_2

HTML

<div class="cp_iptxt">
	<textarea class="ef" type="text" placeholder="">
</div>

CSS

.cp_iptxt {
	position: relative;
	width: 80%;
	margin: 40px 3%;
}
.cp_iptxt input[type='text'] {
	font: 15px/24px sans-serif;
	box-sizing: border-box;
	width: 100%;
	letter-spacing: 1px;
	padding-left: 4em;
}
.cp_iptxt input[type='text']:focus {
	outline: none;
}
.ef {
	padding: 4px 0;
	border: 0;
	border-bottom: 1px solid #1b2538;
	background-color: transparent;
}
.ef ~ .focus_line {
	position: absolute;
	bottom: 0;
	left: 0;
	width: 0;
	height: 2px;
	transition: 0.4s;
	background-color: #da3c41;
}
.ef:focus ~ .focus_line,
.cp_iptxt.ef ~ .focus_line {
	width: 100%;
	transition: 0.4s;
}
.ef ~ label {
	position: absolute;
	z-index: -1;
	top: 4px;
	left: 0;
	width: 100%;
	transition: 0.3s;
	letter-spacing: 0.5px;
	color: #aaaaaa;
}
.ef:focus ~ label, .cp_iptxt.ef ~ label {
	font-size: 12px;
	top: -16px;
	transition: 0.3s;
	color: #da3c41;
}