Design comparison
Solution retrospective
Any feedback appreciate. Let me know what is wrong in code, I'm still learning :) Thanks!
Community feedback
- @pikapikamartPosted about 3 years ago
Hey, awesome work on this one. Desktop layout looks really nice, it is responsive and the mobile state looks fine but there is a horizontal scrollbar at the moment because the layout is being hidden.
Some suggestions would be:
- Always have a
main
element to wrap the main content of your page. On this one, the.container
should be using themain
instead ofdiv
. - Avoid using
height: 100vh
on a large container like the.container
tag as this limits the element's height based on the remaining screen's height. Instead usemin-height: 100vh
, this takes full height but lets the element expand if needed. - Adjusting the
font-size
of thep
tag for the hero-section since it is really hard to read by now. - The "try it free..." is not really an interactive component, it is just like a banner for the form so using only
div
withp
tag inside would be better. - Those
ion-icon
( I don't really know this tag ), the error-icon is not really meaningful so hiding it would be better, do not usearia-label
to it. Also animg
would be nice withalt=""
andaria-hidden="true"
. - Your
input
tag lacks an associatedlabel
tag on it. Since there are visible-label, thelabel
would be a screen-reader only label, meaning it would make user of likesr-only
class. The text-content should describe what theinput
needs like the value on theplaceholder
. - Right now, those error are seen visually bot not really connected to the
input
. A proper approach looks like these:
if ( input is wrong ) input.setAttribute("aria-invalid", "true"); input.setAttribute("aria-describedBy", id of the error-message); else input.removeAttribute("aria-invalid"); input.removeAttribute("aria-describedBy");
The error-message element should have an
id
attribute which is referenced by thearia-describedBy
attribute on theinput
element. By doing that, your user will know that theinput
is wrong because ofaria-invalid
and they will know what kind of error they made because of thearia-describedBy
- Another idea to implement to further improve accessibility is to have an
aria-live
element that will announce if theform
submission is a success or not. Have a look at this simple accessible form snippet that I have . If you have queries about this, just let me know okay^^ - Your
button
should havetype="submit"
, always be explicit on what yourbutton
should be especially when it is inside aform
. Since by default abutton
inside aform
turns totype="submit"
. So imagine you have a close-button right with no specifiedtype="button"
, instead of closing theform
, it would submit theform
. - Adding
cursor: pointer
to thebutton
so that it will feel more natural on desktop layout.\
Aside from those, great job again on this one.
Marked as helpful1 - Always have a
Please log in to post a comment
Log in with GitHubJoin 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