created label and input elements

This commit is contained in:
Yusuf Ipek
2021-05-03 14:33:25 +03:00
parent 29cf4280df
commit 29a78aeb3a
3 changed files with 53 additions and 0 deletions
+1
View File
@@ -13,6 +13,7 @@
@import "./sass/components/card";
@import "./sass/components/story";
@import "./sass/components/bg-video";
@import "./sass/components/form";
@import "./sass/layout/header";
@import "./sass/layout/grid";
+5
View File
@@ -13,6 +13,8 @@ $color-grey-light-1: #f7f7f7;
$color-grey-light-2: #eee;
$color-grey-dark: #777;
$color-grey-dark-2: #999;
$color-white: #fff;
$color-black: #000;
@@ -29,4 +31,7 @@ $gutter-horizontal: 6rem;
$shadow-default: 0 1.5rem 4rem rgba($color-black, 0.15);
$shadow-light: 0.5rem 1rem 2rem rgba($color-black, 0.2);
$border-radius-small: 0.2rem;
$border-radius-default: 0.3rem;
$bottom-border-green: 3px solid $color-primary;
$bottom-border-orange: 3px solid $color-secondary-dark;
+47
View File
@@ -0,0 +1,47 @@
.form {
&__group:not(:last-child) {
margin-bottom: 2rem;
}
&__input {
font-size: 1.5rem;
font-family: inherit;
padding: 1.5rem 2rem;
color: inherit;
border-radius: $border-radius-small;
background-color: rgba($color-white, 0.5);
border: none;
border-bottom: 3px solid transparent;
width: 90%;
display: block;
&:focus {
outline: none;
box-shadow: $shadow-light;
border-bottom: $bottom-border-green;
}
&:focus:invalid {
border-bottom: $bottom-border-orange;
}
&::-webkit-input-placeholder {
color: $color-grey-dark-2;
}
}
&__label {
font-size: 1.2rem;
font-weight: 700;
margin-left: 2rem;
margin-top: 0.7rem;
display: block;
transition: all 0.3s;
}
&__input:placeholder-shown + &__label {
opacity: 0;
visibility: hidden;
transform: translateY(-4rem);
}
}