Introduction

About this Style Guide

This entire project was originally created by Diego Toda de Oliveira. I loved the template so much, I decided to clone it, remove the more complex/particular sections, and add a few of my own to make it a more complete template. The following text is all by Diego.

This is a simple style guide to get a project started. It contains some basic styles for Typography in general, buttons, and a few components. I usually don't overdo more than that since every project is unique. But a good approach in general is:

  • For things that require variations and will be reused across multiple sections / pages, create some global classes (like spacing, font sizes, opacity, etc;
  • If you reuse sections with columns on multiple sections, consider creating some global classes for grids in general.
  • CSS Grid is well supported now, and a lot easier / cleaner to use compare to the old way of building columns. Flexbox is also good.

About CSS units

All sizes (font size, spacing, etc) on this template are based on a 8px grid system. You can find some references about this system here and here. I prefer to use px to set up the base unit and EMs to define the sizes and scale.

Basically it works like this:

  • Define the base font-size on the Body element (16px)
  • Font sizes, padding, spacing, etc, defined in EMs

Why EMs and not REMs?

REM is awesome and is your friend. But I prefer to use EMs as a size unit because it allows you to set the scale of your components individually, since it's relative to the parent element, not the root element.

Consider this scenario: you have a box component, which all elements are sized using EMs. On mobile, the component feels too small. How do you fix that?

  • With REMs, you would need to change the scale of all the elements inside that box individually.
  • With EMs, all you have to do is change the font-size of the box element that holds all the content. You can change the size using PX or EMs, it doesn't matter. On place to change the scale is more maintainable.

Typography

Heading 1

Heading 1

Heading 2

Heading 2

Heading 3

Heading 3

Heading 4

Heading 3

Text / 2XLarge
This is some text inside of a div block.
Text / XLarge
This is some text inside of a div block.
Text / Large
This is some text inside of a div block.
Text / Big
This is some text inside of a div block.
Text / Regular
This is some text inside of a div block.
Text / Small
This is some text inside of a div block.
Paragraphs

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere.

Paragraph / Big

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere.

Paragraph / Small

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse varius enim in eros elementum tristique. Duis cursus, mi quis viverra ornare, eros dolor interdum nulla, ut commodo diam libero vitae erat. Aenean faucibus nibh et justo cursus id rutrum lorem imperdiet. Nunc ut sem vitae risus tristique posuere.

Text Light
This is some text inside of a div block.
Text Mark
This is some text inside of a div block.

Buttons

Button
Button
Big
Button
Small