Skip to content

elidrissidev/article-preview-component

Repository files navigation

Frontend Mentor - Article preview component solution

This is a solution to the Article preview component challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.

Table of contents

Overview

The challenge

Users should be able to:

  • View the optimal layout for the component depending on their device's screen size
  • See the social media share links when they click the share icon

Screenshot

Mobile (375px) Mobile Share Menu (375px) Desktop (1440px)
Mobile Mobile Share Menu Desktop

Links

My process

Built with

  • Semantic HTML5 markup
  • CSS custom properties
  • Flexbox
  • Mobile-first workflow
  • Tailwind CSS
  • Parcel

What I learned

I learned more about accessibility in this challenge, a topic I'm always interested in. I learned about linking toggle buttons with the element they toggle: aria-controls, and how to indicate the current toggle state: aria-pressed and aria-expanded.

Apparently there was also a semantic HTML element for displaying dates and times <time>, it isn't auto-completed by Emmet on VSCode so I never knew it existed until now :D.

Continued development

On this challenge I spent a good chunk of time on the share menu especially the desktop one and although I ended up creating two menus and toggling their display property between mobile and desktop, I'd like to continue to learn about how I can better re-use mobile elements to style them for desktop without duplicating them, although sometimes duplicating them is the best/only option.

Useful resources

Author

Acknowledgments

This project is licensed under the MIT License.