Design comparison
Solution retrospective
Hello!!
Any Feedback is welcomed. Code for Js was from a youtube video with a similar challenge that frontend mentor has that also has an accordion challenge. Thanks!
Community feedback
- @javascriptor1Posted 12 months ago
Hi Marian ,
Excellent work. One requirement is missing. If you check the readme file again, you will see this requirement :
- Navigate the questions and hide/show answers using keyboard navigation alone
You have used non interactive element (div tag) which users can't navigate through a keyboard. The functionality can be achieved using the details tag.
You forgot to apply the active state element when hovering over the question.
In addition, the question is not aligned in the middle between the two lines.
Also, avoid using figure tag for logos as it's not the best or right option. Unless you have figure caption to be combined with the photo, don't use a figure and use img tag or inline svg directly.
Best of luck
2 - @AGutierrezRPosted 12 months ago
Hello there 👋. Good job on completing the challenge!
I have some suggestions about your code that might interest you.
For the
wrapper-question
element:- Set a
padding
for this element to give it some room to breathe, this will allow you to remove thepadding
from the.answer
element - If the
answer
element is not visible you should hide it with adisplay: none
(or add thehidden
attribute to the element) instead of aheight: 0
, the reason for this is that although the elements height is0
, its padding/margin still count in the layout. You could play with classes and theclick
plusanimationend
events if you want an animation (of course CSS included).
For the
.question
element.- You could use the
svg
markup instead of importing it as a content in the::after
of the.question
- The
.question
element could be a flex container with ajustify-content: space-between
to separate the title from the icon.
I hope you find this helpful 😁. Most importantly, your submitted solution is fantastic!
Happy coding!
1 - Set a
- @Vaib215Posted 12 months ago
You can implement this by native HTML element pair:
detail
andsummary
1
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