article-preview-component

Solution retrospective
It took me a while to re-design the HTML and CSS when starting mobile design after finishing desktop design (basically where the wrapper/container divs should be). I should inspect the design images more carefully and think more thoroughly before I start writing codes.
What challenges did you encounter, and how did you overcome them?What I learned:
- how to make triangle shape by setting border properties on a div.
- more familiar with "position: absolute", "transform: ...", "object-position" CSS properties.
- the use of <svg>. I should use <svg> tag instead of import the svg by <img> or <object>, so that I can change the "fill" property (the color of curved arrow on share-button) by CSS.
- Any click event on <object> element would be captured by whatever is inside the <object> element, and doesn't bubble it back out. So in order to make icon-facebook (which is imported by <object> element) part of <a> element and clickable, I just have to add "pointer-events: none" to the <object> element.
- I should use "visibility: hidden" instead of "display: none" on div.share-links-wrapper when share-button not active. If I pop up the div.share-links-wrapper by changing "display: none" to "display: flex", the layout was re-calculated and cause a transient whole layout shift during transition.
- to make an element visible when overlapped with "position: absolute" element, I just need to set "position: relative" and increase the Z-index on the element.
What's the exact layout method that align the drawers image and the article content? I use grid with "grid-template-columns: auto auto", but the widths of the two components were not the same as example.
Please log in to post a comment
Log in with GitHubCommunity feedback
- @tiedej2000
excellent execution :)
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