Skip to content
  • Unlock Pro
  • Log in with GitHub
Solution
Submitted 5 months ago

Article preview component

P
skhbabez•510
@skhbabez
A solution to the Article preview component challenge
View live sitePreview (opens in new tab)View codeCode (opens in new tab)

Solution retrospective


What are you most proud of, and what would you do differently next time?

I am proud of how I Used absolute Positioning and z-index to create the toast, while having the button still appear on mobile.

.card {
  position: relative;
}
.share-links {
  position: absolute;
  bottom: 0;
}
.share-btn {
  z-index: 1;
}
What challenges did you encounter, and how did you overcome them?

One issue I faced was inverting the share button color. Since i loaded the svg as an image i had to use a trick I found on stackoverflow to change it through css,

.share-btn-dark {
  --share-btn-color: brightness(0) invert(1); /*used with filter*/
What specific areas of your project would you like help with?

I encountered one issue with overflow that I could not figure out how to solve gracefully. I initially had overflow on the card itself enabled, but this led to an issue with the toast being cut off. But using overflow on the image container for the header image did not work either for some reason. So I just added additional border radius to the image and share links container. Is there a way to handle this better while still keeping the border radius of the card intact (not having the internal containers overflow)? Otherwise, any additional criticism is welcome.

Code
Loading...

Please log in to post a comment

Log in with GitHub

Community feedback

No feedback yet. Be the first to give feedback on skhbabez's solution.

Join 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

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner
  • Use cases

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License