Generateurv2/frontend/styles/input.module.scss

113 lines
1.8 KiB
SCSS
Raw Normal View History

2022-06-11 23:39:03 +02:00
@import "./variables";
/* .input {
//padding: 0.4em 0.25em;
width: 100%;
background: transparent;
color: #afb5bb;
//font-size: 1.55em;
&:focus + label span {
transform: translate3d(0, -90%, 0);
}
& + label {
position: absolute;
width: 100%;
text-align: left;
pointer-events: none;
left: 0;
& span{
transition: transform .3s;
}
}
} */
.input-container {
position: relative;
2022-06-24 13:42:16 +02:00
margin-top: 10px;
2022-06-11 23:39:03 +02:00
width: 100%;
2022-06-24 13:42:16 +02:00
display: flex;
flex-direction: column;
2022-06-11 23:39:03 +02:00
}
.input {
background-color: transparent;
border: none;
padding: 10px 10px 10px 5px;
border-bottom: 1px solid $input-border;
width: 100%;
2022-06-24 13:42:16 +02:00
font-size: 0.9em;
2022-06-11 23:39:03 +02:00
font-weight: 500;
color: white;
& ~ label {
font-size: 1em;
font-weight: normal;
position: absolute;
pointer-events: none;
left: 5px;
top: 10px;
transition: 0.3s ease all;
font-weight: 400;
color: #8e8e8e;
2022-06-24 13:42:16 +02:00
opacity: 0.4;
2022-06-11 23:39:03 +02:00
}
&:focus {
outline: none;
}
&:focus ~ label,
&:valid ~ label {
2022-06-24 13:42:16 +02:00
top: -0.8em;
2022-06-11 23:39:03 +02:00
font-size: 12px;
color: $contrast;
opacity: 1;
font-weight: 600;
}
2022-06-24 13:42:16 +02:00
&:disabled ~ label {
color: grey;
}
2022-06-11 23:39:03 +02:00
&:focus ~ .bar:before {
width: 100%;
}
}
.bar {
position: relative;
display: block;
width: 100%;
&:before {
content: "";
height: 2px;
width: 0;
bottom: 0px;
position: absolute;
background: $contrast;
transition: 0.3s ease all;
left: 0%;
}
}
2022-06-24 13:42:16 +02:00
.error {
2022-06-11 23:39:03 +02:00
color: $red;
2022-06-24 13:42:16 +02:00
& input {
2022-06-11 23:39:03 +02:00
color: $red;
border-bottom: 1px solid $red;
2022-06-24 13:42:16 +02:00
&:focus ~ label,
&:valid ~ label {
2022-06-11 23:39:03 +02:00
color: $red;
}
2022-06-24 13:42:16 +02:00
&:focus ~ .bar::before {
2022-06-11 23:39:03 +02:00
background-color: $red;
}
}
2022-06-24 13:42:16 +02:00
}
.password-toggler {
position: absolute;
top: 50%;
transform: translate(-50%, -50%);
right: 0;
width: 20px;
height: 20px;
cursor: pointer;
}