Skip to content

AldrinSeanPereira/product-preview-card-component-main

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Frontend Mentor - Product preview card component solution

This is a solution to the Product preview card 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 depending on their device's screen size
  • See hover and focus states for interactive elements

Screenshot

product-preview-card-component-main

Links

  • Solution URL: Link
  • Live Site URL: Link

My process

Built with

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

What I learned

I learned that my semantic and accessibility HTML skills were lacking

If you notice my GitHub commit history for this project, you will find how I had to change all my HTML and CSS

I also had to struggle a lot with the picture element which caused issues with alignment and making sure I used the correct CSS Grid concepts (for this project it seems to not be needed as much so I look forward to a future project that is more Grid heavy)

Concepts I learned:

  • BEM style of naming CSS
  • Accessibility in HTML and CSS (s tag, visually hidden classes, text before and after)
  • CSS Grid concepts especially for alignment (justify/align of items/content)
<div class="product-card__prices">
        <span class="product-card__new-price">$149.99</span>
        <s class="product-card__old-price gray-text">$169.99</s>
      </div>
/* screen reader accessibility text */
s::before {
    content: " [strike-through start] ";
}

s::after {
    content: " [strike-through end] ";
}

/* visually hiding accessibility text so only screen readers can find it */
s::before,
s::after {
    clip-path: inset(100%);
    clip: rect(1px, 1px, 1px, 1px);
    height: 1px;
    width: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
}

Continued development

Use this section to outline areas that you want to continue focusing on in future projects. These could be concepts you're still not completely comfortable with or techniques you found useful that you want to refine and perfect.

Note: Delete this note and the content within this section and replace with your own plans for continued development.

Useful resources

Author

Acknowledgments

A huge THANK YOU! to the frontend mentor help section, Alex K Marshall and Grace Snow for their help.

Releases

No releases published

Sponsor this project

 

Packages

No packages published