Skip to content
Submitted 19 days ago

social-links-profile-flex

A solution to the Social links profile challenge

Solution retrospective


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

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

I’m most proud of how the links behave. They are real <a> elements, not buttons, because they navigate. They open in a new tab, so each one has a visually hidden “(opens in a new tab)” span that screen readers read with the label. The hover style only applies on devices that can hover, so a touch screen doesn’t leave a green button behind after you come back from the new tab. The design shows no focus state, so I made one: a green outline with an offset, which looks different from hover. I also measured against the design instead of eyeballing. The name is 24px, the avatar is 88px, and I picked the bold weights by rendering them in devtools and comparing widths.

What I’d do differently: my first CSS draft was written from memory. The name was 2rem, the avatar 6rem, and the bio 1.125rem. All three were wrong against the design. Next time I’ll measure first, then write.

What challenges did you encounter, and how did you overcome them?

Two layout mistakes in my first draft. I put the button class on the <li>, not the <a>. That would have made the clickable area just the label text, and the focus ring would have hugged the text instead of the button. I moved the styles to .social-links a with display: block. Separately, align-items: center on the card turned off stretch, so the link list shrank to its widest label. Adding width: 100% to the list fixed it.

Lighthouse gave me 99 / 100 / 100 / 91. The 91 turned out to be SEO, and adding a meta description brought it to 100. Performance stays at 99 because of render-blocking requests. I left it, since a 438 ms font request on a static card is fine for now.

What specific areas of your project would you like help with?

My main question is about the new-tab warning. WCAG advice is to warn all users, but the design has no icon, so I hid the text visually and only screen reader users get the warning. I chose to match the design. Would you accept that, or add a visible cue even though it departs from the design? Second, I used one breakpoint at 27rem, which is where the card reaches its max width, instead of a conventional value like 48rem. Does that hold up, or would you use a different approach?

Code
Loading...

Please log in to post a comment

Log in

Community feedback

No feedback yet. Be the first to give feedback on Tarek Elzoghby | طارق الزغبي’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