Coder Social home page Coder Social logo

aldrinseanpereira / product-preview-card-component-main Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 636 KB

product-preview-card-component-main

Home Page: https://timely-vacherin-484227.netlify.app/

License: Apache License 2.0

HTML 30.23% CSS 69.77%
css3 flexbox grid html5

product-preview-card-component-main's Introduction

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.

product-preview-card-component-main's People

Contributors

aldrinseanpereira avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.