This is a solution to the Intro component with sign up form challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.
Users should be able to:
- View the optimal layout for the site depending on their device's screen size
- See hover states for all interactive elements on the page
- Receive an error message when the
form
is submitted if:- Any
input
field is empty. The message for this error should say "[Field Name] cannot be empty" - The email address is not formatted correctly (i.e. a correct email address should have this structure:
[email protected]
). The message for this error should say "Looks like this is not an email"
- Any
- Live Site URL: https://dresroldan.github.io/signupform/
- Semantic HTML5 markup
- CSS custom properties
- Flexbox
- CSS Grid
- Mobile-first workflow
- Javascript
:root {
--red: hsl(0, 100%, 74%);
--green: hsl(154, 59%, 51%);
--blue: hsl(248, 32%, 49%);
--darkBlue: hsl(249, 10%, 26%);
--grayBlue: hsl(246, 25%, 77%);
--border-radius: 7px;
--box-shadow: 0 6px rgba(0, 0, 0, 0.2);
--font-weight: 600;
}
A custom property is most commonly thought of as a variable in CSS. They help follow the DRY programming principle.
To develop this component even further, I would like to add an instant feedback feature to let users know if their input values are valid as the user finishes typing. Currently the form only shows the error or success after the user clicks on the claim your free trial button. An event listener would need to be attached to the input event of each field to validate the user's entries.
- Javascript Form Validation - This helped me understand form validation using Javascript. HTML5 has built in validation features but isn't as customizable as Javascript validation.
- Website - Andrés Roldán
- Frontend Mentor - @dresroldan