FAQ Accordion Component- responsive mobile first, styled with Sass
Design comparison
Solution retrospective
Hi all,
I think i did ok with this one. Things that could be improved are the implementation of the shadow as a background image on mobile devices. The shadow moves when the accordion is expanded. I positioned it so it still looks ok, but i feel it's not ideal.
I also went round in circles with using overflow: hidden on the illustration. I got the main image and background how it should be, but i couldn't get the illustration box to escape this. I could only get overflow: hidden to work on the parent container, but nowhere else. If i removed it here then the other images wouldn't work. I'd appreciate tips on refactoring this.
I also am trying to refine my styles for really small devices, such as Galaxy Fold, so any tips on this would be handy also!
Overall i enjoyed making this component!
thanks, Evan
Community feedback
- @stfnpczkPosted over 2 years ago
Hi Evan,
one way to make the box float a little bit outside the card, is to put the box in a separate div that is outside of the accordion-container and put the
z-index
property on it.Marked as helpful0
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