dieudonneallognon / nft-preview-card-component

NFT preview card component

Home Page:https://dieudonneallognon.github.io/nft-preview-card-component/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Frontend Mentor - NFT preview card component solution

This is a solution to the NFT 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 states for interactive elements

Screenshot

Links

My process

Built with

  • Semantic HTML5 markup
  • CSS custom properties
  • Flexbox
  • Less CSS Precompiler
  • Gulp task Manager
  • Mobile-first workflow

What I learned

  • Less CSS Precompiler

Aiming to gain more productivity while coding, I used the less css precompiler to reduce the amount of time and lines of css code I write. I have then an index.less file which is transpiled in index.css.

/* index.less */

html {
    min-width: 375px !important;
    min-height: 664px !important;
    max-width: 1440px;

    width: 100%;
    height: 100%;
    margin: auto;

    body {
        background-color: var(--main-very-dark-blue);
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        height: 100%;
        max-width: 375px;
        margin: auto;
        ...;
    }
}

Since code transpiling is not automatic, I used The Gulp task manager to watch my less file and automate the transpilation process when a the less file when it detects modification

/* gulpfile.js */

exports.watch = () => watch("src/*.less", compileCss);

Author

About

NFT preview card component

https://dieudonneallognon.github.io/nft-preview-card-component/


Languages

Language:Less 79.5%Language:HTML 14.8%Language:JavaScript 5.7%