Skip to content

AimanAnizan56/Stats-Preview-Card

Repository files navigation

Frontend Mentor - Stats preview card component solution

This is a solution to the Stats 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

Screenshot

  • Mobile View

  • Desktop View

Links

My process

Built with

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

What I learned

Before this, I use ::before selector to add color on the image :

.card {
    &__image {
        background-image: url('../images/image-header-mobile.jpg');
        &::before {
            content: '';
            background-color: var(--softviolet);
            display: block;
            width: 100%;
            height: 100%;
        }
    }
}

But, I found a way to make the css code shorter using the background-blend-mode as below :

.card {
    &__image {
        background-color: var(--softviolet);
        background-blend-mode: multiply;
        background-image: url('../images/image-header-mobile.jpg');
    }
}

Continued development

I found that flexbox can help me to create website layout. So, I think I should improve my knowledge on flexbox.

Useful resources

Author