Design comparison
Solution retrospective
Hey there! 👋🏻
The stack for this challenge was very simple:
- ⏭ Next.js
- ⚛️ React
- 🍃 TailwindCSS (w/JIT mode enabled)
- 🤯 Headless UI
I look forward to hearing your feedback on what I could do to improve my approach and/or the look of my challenge solution!
Community feedback
- @tedikoPosted over 3 years ago
Hello, Al Mondragón! 👋
Well done on this challenge! Your solution responds well. I don't know either React and TailwindCSS so I won't help much but here's my suggestions:
- After I open all accordions at once, they're overflowing your container.
- Try not to repeat your HTML code with image for each arrow. Easier way around is to use pseudo element
::before
on your accordion head element. Set it toposition: relative
and your pseudo element asposition: absolute
. Put your image usingcontent: url('image.svg')
. - I like that I can use my keyboard to navigate. Maybe add
:focus
pseudo class to these buttons. Useoutline
property to make your website more accessible to keyboard users. Focusable elements like anchor, buttons or inputs they have applied default:focus
pseudo class withoutline
property. These default styles are subtle and hardly visible tho. Furthermore every browser has a slightly different default style for the outline, so you probably want to change the default style. Read more about why we should change focus styles.
Good luck with that, have fun coding! 💪
1@AlMonPosted over 3 years agoHi tediko!
Thank you so much for your suggestions, I'll keep them in mind going forward. I specifically would like for you to elaborate on the SVG for the arrow being repeated as opposed to doing it with a class, are you thinking that it's best to keep things "DRY" or is there an alternative reason?
Thanks! Al
0@tedikoPosted over 3 years ago@AlMon Just to be clear, I'm not saying what you did is wrong. I believe it will be better for transparency in your HTML code if you don't repeat same code within five accordions. Furthermore, if You ever want replace this arrows (maybe not best example in this case, but..) the only thing to change will be one line of code in CSS.
1@AlMonPosted over 3 years ago@tediko You were perfectly clear and I really am thankful for your feedback, it's the only way I can possibly improve!
I shared your concern about being repetitive, which is why I am glad to let you know that -through React- I only have the icon in one part of my HTML. It's just repeated according to each Question and Answer that I provide. The benefit being that the code is only kept in one line, which was the goal of your original comment I believe.
Please keep your awesome comments coming, I really dig your feedback style and I think you'll see me around these parts quite often.
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