I'm having trouble on setting borders on the first and last input-blocks.
EDIT: I'm using React on this.
I've tried:
.float-input-block:first-child {
border-radius: 0.8rem;
}
but nothing happened.
Here's my HTML:
<div className="float-input-block">
<input className="float-input" type="text" id={name} {...rest} />
<label className="float-label" htmlFor={name}>{label}</label>
</div>
Here's my CSS:
.float-input-block {
position: relative;
width: 31.1rem;
height: 7.2rem;
}
.float-input-block label {
font-size: 1.4rem;
}
.float-input {
width: 100%;
height: 100%;
/* border-radius: 0.8rem; Here it works, but applies to all the inputs */
background: var(--color-input-background);
border: 1px solid var(--color-line-in-white);
outline: 0;
padding: 0 1.6rem;
}
.float-input-block:first-child {
border-radius: 0.8rem;
}
.float-input-block:focus-within::after {
position: absolute;
width: 0.2rem;
height: 4.8rem;
left: 0;
top: 1.2rem;
content: '';
background: var(--color-primary-light);
}
.float-label {
display: block;
font-size: 1.4rem;
line-height: 2.4rem;
color: var(--color-text-complement);
opacity: 1;
transform: translate(1.8rem, -4.8rem);
transform-origin: 0 0;
transition: all 0.3s;
}
.float-input::placeholder {
color: transparent;
}
.float-input:focus + .float-label,
.float-input:not(:placeholder-shown) + .float-label {
transform: translate(1.7rem, -6.2rem) scale(0.71);
}
.eyeIcon, .eyeOffIcon {
transform: translate(27.4rem, -4.8rem);
}
.eyeOffIcon {
color: var(--color-primary);
}
@media(min-width: 1100px) {
.float-input-block {
width: 35.2rem;
height: 6.4rem;
}
.float-label {
transform: translate(1.8rem, -4.4rem);
font-size: 1.6rem;
}
.eyeIcon, .eyeOffIcon {
transform: translate(30.7rem, -4.4rem);
}
}
And how it should look like:
