Tip calculator app

Please log in to post a comment
Log in with GitHubCommunity feedback
- P@DarkstarXDD
Hey, your solution looks good, however i have few suggestions.
- Instead of
input type="text"
, you can useinput type="number"
for thebill
,custom
andpeople count
. That way the user won't be able to enter any text entries at all. You can still do your validation in JS, but as a first layer of filtering i think it's far better to limit what the user can enter into the input fields. - The inputs needs labels. The elements
bill
,number of people
should actually belabel
elements and theirfor
attributes should point to the input element they are labelling. Currently you have them asp
elements. - The icon images needs empty
alt
attributes.alt=""
. They are decorative images so no need any descriptive alt text but still the alt attribute needs to be their with an empty string. Otherwise some screen readers may read the file path of the icon as the alt text. - The error elements should have
aria-live
attributes. So when that element is populated with the error message it will be announced to screen reader users. - Ideally the tip buttons should be radio buttons (
input type="radio"
) rather than normal buttons. For this design you will need to custom style the radio buttons if you went that way. There are few ways you can do that. How i have done it is visually hide the radio button and style the label to look like radio buttons and based on the checked and focus states of the radio button i styled the label. - I would put the logo image inside the
main
as well. Usually the logo image along with a navbar lives in theheader
landmark element but in this design i think it's fine to have it inside themain
. Either way it should be inside an landmark element. Be it aheader
or themain
. Currently it's not inside any.
- Instead of
Join our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord