Giter Club home page Giter Club logo

fm-fylo-landing-page-with-two-column-layout's Introduction

Frontend Mentor - Fylo landing page with two column layout solution

This is my solution to the Fylo landing page with two column layout challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.

Table of contents

Note: Delete this note and update the table of contents based on what sections you keep.

Overview

The challenge

Users should be able to:

  • View the optimal layout for the site depending on their device's screen size
  • See hover states for all interactive elements on the page

Screenshot

Mobile

Mobile screenshot is available here.

Links

My process

  1. Start by writing basic HTML structure.

  2. Setup layout and containers using flexbox. In this stage, we try not to add any margin or padding because layout should not depend on those properties.

  3. Import fonts and apply them by considering inheritance and cascading features in CSS.

  4. (Optional) Apply fluid typography system. This project uses an excellent package from @davidhellmann for fluid types.

  5. Style important elements like buttons and inputs. Make sure SVGs are in good shape. See if it's worth compressing them (don't forget images, either).

  6. Style sections and prepare for desktop responsive design

  7. (Optional) Customize scrollbar, but please note that Firefox and Chrome have different syntax, and you should be careful here.

  8. Add spacing to elements. Prefer padding to margin if possible or use gap in flex containers because I believe in most cases there are better alternatives, read more here and also this article about margin collapse to get the full context.

  9. Final touches and test on different browsers. Test with edge case scenarios to see if it still works. Catch any potential bugs.

  10. Now it's time to write JavaScript. See what's needed and don't make a js-fatigue situation please :)

  11. Refactor code and reuse any code if feasible.

  12. Write good documents (also can be written as project progresses).

  13. Deploy and go online.

Built with

  • Semantic HTML5 markup
  • Mobile-first workflow
  • Flexbox
  • TailwindCSS - Main framework for CSS styling
  • TailwindCSS Fluid Type - Bring fluid typography to TailwindCSS
  • PostCSS - Post process styles
  • Vite - Next Generation Frontend Tooling (Builder)

What I learned

This project has a convention in naming CSS classes.

Tailwind custom class names must start with an asterisk (*).

For example, this project has a *bar class:

/* only tailwind classes are allowed */
/* `\` is used to escape `*` character */

.\*bar {
  @apply rounded px-6 py-3 shadow-lg
}

This convention makes it much easier to debug styles because we know when a class name starts with * it must be a custom tailwind class.

All CSS styles should use vanilla tailwind but, if for some reason we want to write vanilla CSS then here's the second convention:

Vanilla CSS class names must be prefixed with an underline (_) to indicate this class is not comming from tailwind.

/* notice the "_" sign to differentiate from a custom tailwind class */

._visually-hidden:not(:focus):not(:active) {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

With this rule in mind, no one should mistake tailwind's hidden class with _visually-hidden since it starts with _ character.

Useful resources

If you want to learn how to create a beautiful scrollbar, then read this great blog post from Ahmad Shadeed.

For SVG compression, I used SVGOMG.

Looking for a good SVG icon? Then check out Icônes built by Anthony Fu. This project's brand icons are designed by Ionicons (the original repo).

Author

fm-fylo-landing-page-with-two-column-layout's People

Contributors

devmor-j avatar

Stargazers

 avatar

Watchers

 avatar  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.