Is it somehow possible to combine this SCSS code with parametres or something similar? I just don't know how to do that. This code is about styling the different types of input fields in SCSS. I had do to it this way because I didn't want to delete the specific properties of the different types (e.g. type=password -> I wanted i to still mask the input in the field)
input[type=text]{
width:100%;
border:1px solid $nav-color;
border-radius:4px;
margin: 4px 0;
padding: 5px;
box-sizing:border-box;
transition:.3s;
&:focus{
border-color: $turquoise;
box-shadow: 0 0 4px 0 $turquoise;
}
}
.inputWithIcon{
position:relative;
input[type=text]{
padding-left:40px;
&:focus + i{
color:$turquoise;
}
}
i{
position:absolute;
left:0;
padding: 10px 7px;
color: $nav-color;
transition:.3s;
}
}
input[type=date]{
width:100%;
border:1px solid $nav-color;
border-radius:4px;
margin: 4px 0;
padding: 5px;
box-sizing:border-box;
transition:.3s;
&:focus{
border-color: $turquoise;
box-shadow: 0 0 4px 0 $turquoise;
}
}
.inputWithIcon{
position:relative;
input[type=date]{
padding-left:40px;
&:focus + i{
color:$turquoise;
}
}
i{
position:absolute;
left:0;
padding: 10px 8px;
color: $nav-color;
transition:.3s;
}
}
input[type=password]{
width:100%;
border:1px solid $nav-color;
border-radius:4px;
margin: 4px 0;
padding: 5px;
box-sizing:border-box;
transition:.3s;
&:focus{
border-color: $turquoise;
box-shadow: 0 0 4px 0 $turquoise;
}
}