{"id":15726986,"url":"https://github.com/elidrissidev/article-preview-component","last_synced_at":"2026-05-11T02:20:20.832Z","repository":{"id":133022762,"uuid":"401091373","full_name":"elidrissidev/article-preview-component","owner":"elidrissidev","description":"This is a solution to the Article preview component challenge on Frontend Mentor. ","archived":false,"fork":false,"pushed_at":"2021-08-29T17:52:52.000Z","size":1033,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-06T07:13:43.459Z","etag":null,"topics":["css","frontendmentor","html","javascript","parcel","tailwindcss"],"latest_commit_sha":null,"homepage":"https://article-preview-component-eosin-nu.vercel.app","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elidrissidev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-29T16:38:40.000Z","updated_at":"2021-08-29T17:52:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"bc47f08a-f95e-4161-b19a-49a22c29ddf2","html_url":"https://github.com/elidrissidev/article-preview-component","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elidrissidev%2Farticle-preview-component","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elidrissidev%2Farticle-preview-component/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elidrissidev%2Farticle-preview-component/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elidrissidev%2Farticle-preview-component/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elidrissidev","download_url":"https://codeload.github.com/elidrissidev/article-preview-component/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246403903,"owners_count":20771527,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["css","frontendmentor","html","javascript","parcel","tailwindcss"],"created_at":"2024-10-03T23:00:20.117Z","updated_at":"2026-05-11T02:20:20.772Z","avatar_url":"https://github.com/elidrissidev.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Frontend Mentor - Article preview component solution\n\nThis is a solution to the [Article preview component challenge on Frontend Mentor](https://www.frontendmentor.io/challenges/article-preview-component-dYBN_pYFT). Frontend Mentor challenges help you improve your coding skills by building realistic projects. \n\n## Table of contents\n\n- [Overview](#overview)\n  - [The challenge](#the-challenge)\n  - [Screenshot](#screenshot)\n  - [Links](#links)\n- [My process](#my-process)\n  - [Built with](#built-with)\n  - [What I learned](#what-i-learned)\n  - [Continued development](#continued-development)\n  - [Useful resources](#useful-resources)\n- [Author](#author)\n- [License](#license)\n\n## Overview\n\n### The challenge\n\nUsers should be able to:\n\n- View the optimal layout for the component depending on their device's screen size\n- See the social media share links when they click the share icon\n\n### Screenshot\n\n| Mobile (375px) | Mobile Share Menu (375px) | Desktop (1440px) |\n| --- | --- | --- |\n| ![Mobile](./screenshot-mobile.png) | ![Mobile Share Menu](./screenshot-mobile-share.png) | ![Desktop](./screenshot-desktop.png) |\n\n### Links\n\n- [Solution URL](https://www.frontendmentor.io/solutions/article-preview-component-using-tailwind-css-and-fully-accessible-t09-t7GBu)\n- [Live Site URL](https://article-preview-component-elidrissidev.vercel.app/)\n\n## My process\n\n### Built with\n\n- Semantic HTML5 markup\n- CSS custom properties\n- Flexbox\n- Mobile-first workflow\n- [Tailwind CSS](https://tailwindcss.com/)\n- [Parcel](https://parceljs.org/)\n\n### What I learned\n\nI 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`.\n\nApparently there was also a semantic HTML element for displaying dates and times `\u003ctime\u003e`, it isn't auto-completed by Emmet on VSCode so I never knew it existed until now :D. \n\n### Continued development\n\nOn 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.\n\n### Useful resources\n\n- [Parent onClick is not triggered when the child element is clicked inside button](https://stackoverflow.com/a/43411649) - This answer helped me fix an annoying issue where the `\u003csvg\u003e` inside the share menu toggle button was being set as `event.target` when I click the button in the center (within the svg element's box). Setting `pointer-events: none` on the `svg` did the trick so now wherever I click on the button, `event.target` is always gonna be the button element.\n- [How can I center an absolutely positioned element in a div?](https://stackoverflow.com/a/23384995) - This one trick I already knew and used in the past, but forgot about it and I used it to center the `absolute` share menu on desktop on top of the toggle button.\n\n## Author\n\n- Website - [Mohamed ELIDRISSI](https://www.elidrissi.dev)\n- Frontend Mentor - [@elidrissidev](https://www.frontendmentor.io/profile/elidrissidev)\n\n## Acknowledgments\n\nThis project is licensed under the [MIT License](LICENSE.txt).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felidrissidev%2Farticle-preview-component","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felidrissidev%2Farticle-preview-component","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felidrissidev%2Farticle-preview-component/lists"}