Skip to content

AldrinSeanPereira/social-proof-section-master

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Frontend Mentor - Social proof section solution

This is a solution to the Social proof section 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 for the section depending on their device's screen size

Screenshot

screenshot of desktop version

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

This project surprised me in areas I never expected

  • Creating the stars for the reviews
  • Learning about Developer Tools which is extremely helpful for CSS Grid layout
  • using CSS Grid for the layouts especially for the ratings and testimonies

The code for the stars is just insanely interesting

<div class="ratings__stars" style="--rating: 5;" aria-label="Rating of this product is 5 out of 5."></div>
.ratings__stars {
    --percent: calc(var(--rating) / 5 * 100%);

    display: inline-block;
    font-size: var(--star-size);
    font-family: Times;
    /* make sure ★ appears correctly */
    line-height: 1;

    display: flex;
    justify-content: center;
    align-items: center;

    margin-bottom: var(--space-5px);
}

.ratings__stars::before {
    content: '★★★★★';
    letter-spacing: var(--star-spacing);
    background: linear-gradient(90deg,
            var(--star-background) var(--percent),
            var(--star-color) var(--percent));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

The code for background images was also a new learning point

background-color: var(--color-White);
    background-image: url(images/bg-pattern-top-mobile.svg),
        url(images/bg-pattern-bottom-mobile.svg);
    background-repeat: no-repeat, no-repeat;
    background-position: top center, bottom center;

CSS Grid code was posiible only because I used the Developer tools to see what line had what number and had to use trial-and-error to set a good positioning value

Useful resources

Author

Acknowledgments

I sincerely thank frontend mentor for this project and for the platform they have provided for learning.

Releases

No releases published

Sponsor this project

 

Packages

No packages published