JSFiddle - React, Tailwind, and code Playground
by helgatheviking
HTML
<div class="l-pos-relative">
<span class="Input__inline-text l-pos-left border-right border-light-grey t-bold">$</span>
<input name="amount" id="amount" value="203.40" placeholder="Enter Amount" class="Input p-left-7" required="">
<span class="Input__inline-text l-pos-right border-left border-light-grey t-bold">USD</span>
</div>
CSS
*, ::before, ::after {
box-sizing: inherit;
}
div {
font-size: 1rem;
}
.l-pos-relative {
position: relative !important;
}
.Input__inline-text {
position: absolute;
top: 0;
bottom: 0;
height: 40px;
padding: 0.5rem 1rem;
}
.t-bold {
font-weight: 600 !important;
}
.l-pos-left {
left: 0 !important;
}
.border-light-grey {
border-color:
#E0E4E8;
}
.border-right {
border-right-width: 1px;
border-right-style: solid;
}
input.Input::placeholder,
textarea.Input::placeholder {
color:
#E0E4E8;
}
.Input::placeholder {
color: #434F58;
}
element {}
.Input {
border: 1px solid #AFBFC9;
outline: none;
color:
#434F58;
font-size: 1rem;
line-height: calc(1em + 8px);
font-family: "Proxima Nova", sans-serif;
display: block;
margin: 0;
margin-top: 0px;
margin-top: 0.5rem;
width: 100%;
transition: all .2s ease-in-out;
border-radius: 3px;
padding: 0.4375rem 0.5rem;
padding-left: 0.5rem;
}
.p-left-7 {
padding-left: 3.5rem !important;
}
.Input__inline-text {
position: absolute;
top: 0;
bottom: 0;
height: 40px;
padding: 0.5rem 1rem;
}
.t-bold {
font-weight: 600 !important;
}
.l-pos-right {
right: 0 !important;
}
.border-light-grey {
border-color:
#E0E4E8;
}
.border-left {
border-left-width: 1px;
border-left-style: solid;
}
JavaScript
var json = '[]';
console.log(JSON.parse(json));