Skip to content

Instantly share code, notes, and snippets.

@ShariqAnsari88
Created January 10, 2023 15:46
Show Gist options
  • Save ShariqAnsari88/dcd38dacec36e6801fc313586bbd0e69 to your computer and use it in GitHub Desktop.
Save ShariqAnsari88/dcd38dacec36e6801fc313586bbd0e69 to your computer and use it in GitHub Desktop.
React Form Validation & Handling
:root {
font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
font-size: 16px;
line-height: 24px;
font-weight: 400;
color-scheme: light dark;
color: rgba(255, 255, 255, 0.87);
background-color: #242424;
font-synthesis: none;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
-webkit-text-size-adjust: 100%;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
background-color: #ffffff;
background-image: radial-gradient(#444cf7 0.5px, #e5e5f7 0.5px);
background-size: 10px 10px;
}
#root {
width: 100%;
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}
form {
width: 500px;
padding: 25px;
background: white;
border-radius: 12px;
box-shadow: 10px 10px 5px 0px rgba(0, 0, 0, 0.05);
-webkit-box-shadow: 10px 10px 5px 0px rgba(0, 0, 0, 0.05);
-moz-box-shadow: 10px 10px 5px 0px rgba(0, 0, 0, 0.05);
}
.button {
appearance: none;
background-color: #000000;
border: 2px solid #1a1a1a;
border-radius: 8px;
box-sizing: border-box;
color: #ffffff;
cursor: pointer;
display: inline-block;
font-family: Roobert, -apple-system, BlinkMacSystemFont, "Segoe UI",
Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji",
"Segoe UI Symbol";
font-size: 16px;
font-weight: 600;
line-height: normal;
margin: 0;
margin-top: 20px;
min-height: 40px;
min-width: 0;
outline: none;
padding: 16px 24px;
text-align: center;
text-decoration: none;
transition: all 300ms cubic-bezier(0.23, 1, 0.32, 1);
user-select: none;
-webkit-user-select: none;
touch-action: manipulation;
width: 100%;
will-change: transform;
}
.button:disabled {
pointer-events: none;
}
.button:hover {
box-shadow: rgba(0, 0, 0, 0.25) 0 8px 15px;
transform: translateY(-2px);
}
.button:active {
box-shadow: none;
transform: translateY(0);
}
::placeholder {
color: black;
opacity: 0.5;
}
.inputField {
width: 100%;
display: flex;
flex-direction: column;
margin-bottom: 10px;
}
.inputField label {
color: black;
min-width: 150px;
}
.inputField span {
font-size: 14px;
}
.inputField input {
background: transparent;
outline: 0;
border: 1px solid rgba(0, 0, 0, 0.25);
height: 55px;
border-radius: 8px;
padding: 0 10px;
color: black;
font-size: 16px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment