UNPKG

react-hartan

Version:

A simple components library for React

131 lines (111 loc) 2.42 kB
/* Form Styling */ /* the full form component container */ .formCard { background-color: #fff; border-radius: 1rem; padding: 2rem; width: 40rem; display: flex; flex-direction: column; box-shadow: rgba(0, 0, 0, 0.24) 0px 3px 8px; } /* the heading of the form inside form card */ .title { font-size: 2.5rem; font-weight: 600; text-align: center; } /* the form container inside form card */ .form { margin-top: 2rem; display: flex; flex-direction: column; } .group { position: relative; } input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; } .form .group label { font-size: 1.5rem; color: rgb(99, 102, 102); position: absolute; top: -1rem; left: 1rem; background-color: #fff; transition: all .3s ease; } .form .group input, .form .group textarea { padding: 1rem; border-radius: .5rem; border: .1rem solid rgba(0, 0, 0, 0.2); margin-bottom: 2rem; outline: 0; width: 100%; background-color: transparent; } .form .group input:placeholder-shown+label, .form .group textarea:placeholder-shown+label { top: 1rem; background-color: transparent; } .form .group input:focus, .form .group textarea:focus { border-color: #1e90ff; } .form .group input:focus+label, .form .group textarea:focus+label { top: -1rem; left: 1rem; background-color: #fff; color: #1e90ff; font-weight: 600; font-size: 1.5rem; } .form .group textarea { resize: none; height: 100px; } .form button { background-color: #1e90ff; color: #fff; border: none; border-radius: .5rem; padding: 1rem; font-size: 1.5rem; font-weight: 600; cursor: pointer; transition: all 0.3s ease; } .form button:hover { background: linear-gradient(90deg, rgba(30, 144, 255, 1) 0%, rgba(0, 212, 255, 1) 100%); } /* the container shown when user submits the form */ .submitted { display: flex; justify-content: center; align-items: center; position: fixed; background-color: #ffffff; height: 33rem; width: 36rem; } /* the suuccess logo inside the submitted container */ .submittedSVG { animation: slide-in .5s; } @keyframes slide-in { 0% { transform: scale(0); } 50% { transform: scale(1.3); } 100% { transform: scale(1); } }