Design comparison
SolutionDesign
Solution retrospective
Finally completed the faq accordion project. This was my first time using JavaScript on a project and positioning the images was also very hard.
Community feedback
- @pikapikamartPosted about 3 years ago
Hey, awesome work on this one. Layout in desktop is smaller than the design but it's fine for now I guess, it is responsive and the mobile state looks great.
Some suggestions would be:
- Avoid using
vh
unit onheight
property on a large container like themain
on this one , 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. - Also, don't use
width: 100vw
as this create an extra vertical scroll since this doesn't account the vertical scrollbar's size. - All the images used in here are just decorative since they are only vector. Decorative image must be hidden at all times by using
alt=""
and extraaria-hidden="true"
attribute on theimg
tag. - For every
button
it would be great to have a default attribute ofaria-expanded="false"
and when thebutton
is toggled, this will be set totrue
and vice-versa. You will be needing to use.setAttribute
. This way, users will know that is has expanded/shown something.
Aside from those, great work again on this one.
Marked as helpful0@Amandeep715Posted about 3 years ago@pikamart First of all thanks a lot for your feedback. It was very informative, actually this was my first time learning about ARIA and now look more information about it on MDN.
1 - Avoid using
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