Essential CSS
JavaScript Roadmap
Learn JavaScript
Mastering Web Typography
Practical Astro
Understanding Async JS
Unorthodox Tailwind
API Masterclass
Build and Deploy
The Beginner Freelancer
Real World Node
Profile Billing Logout
Unorthodox Tailwind
Lesson Plan
  1. Introduction
    1. Introduction
    2. What Tailwind brings to the table
    3. Tailwind: The Good and The Bad
    4. The First and Most Important Step
    5. Simple Unorthodox System
    6. The System I Use
  2. Tailwind Fundamentals
    1. Introduction
    2. Installing Tailwind
    3. Using Tailwind utilities
    4. Understanding Tailwind’s utility system
    5. Understanding Tailwind values
    6. Understanding Tailwind variants
  3. Unorthodox Fundamentals
    1. Introduction
    2. Making Simple Tailwind Utilities
    3. Components vs Utilities
    4. Specificity, Cascade, and CSS Layers
    5. Debugging Tailwind Styles
    6. Composable Utility System
    7. Create lots of components
  4. Layouts System
    1. Tailwind is great for layouts
    2. Four Types of Layouts
    3. Building Shell Layouts
    4. Building Macro Layouts
    5. Better Responsive Variants
    6. A collection of maximum widths
    7. A note on grid wrappers
    8. Working with sections
    9. Building Micro Layouts
    10. Positioning Layouts
  5. Typography System
    1. Introduction
    2. A system for using multiple typefaces
    3. Tailwind's font-size system
    4. Finding your font-size system
    5. My font-size system
    6. A simple responsive typography system
    7. The main body
    8. Vertical rhythm
  6. Theming System
    1. Introduction
    2. Tailwind's colour system
    3. The pigment system
    4. Tailwind's gradient system
    5. A friendlier gradient system
    6. Handling SVG fill and stroke
    7. Improving Tailwind's colour palette
    8. A simple way to theme
  7. Useful Tools
    1. Introduction
    2. Making functional utilities
    3. Custom variants
    4. Scaffolding tools
    5. Extending Tailwind
  8. Effects System
    1. Introduction
    2. Vertical text
    3. Strikethrough text
    4. Text stroke
    5. Highlighting text
    6. Nicer shadows
    7. Transitioning shadows
    8. Drop shadows
    9. Dark mode tricks
    10. Gradient borders
    11. More effects to explore
  9. Putting Everything Together
    1. The Unorthodox Tailwind process
    2. The 4 systems combined
    3. Create components liberally
    4. Advanced tips
    5. My CSS Structure
    6. A Cheatsheet
    7. Consolidating your thoughts
    8. Parting words

Finding your font-size system

2m:52s

There are basically three ways to build a font-size system:

  1. The Typography Scale
  2. Modular Scale
  3. Fluid Typography

The Typography Scale

The typography scale from The Elements of Typographic Style by Robert Bringhurst is a good start for most websites. Designers generally use this as well.

classic typographic scale

It contains sizes that are small enough for designing apps and dense interfaces, and also sizes large enough to create attention-drawing headers for marketing websites.

  • 10px is usually the smallest size limit that you will use for denser interfaces
  • 48px and 60px are generally good enough for attention-grabbing headers

Personally, I ended up using the typography scale after playing around with Modular Scale and fluid typography for a long time.

And I do this for a simple reason: There is no way in hell you’re going to be able to use Modular Scale and fluid typography easily in design software like Figma. Since I want to design quickly and implement quickly, I simply chose a method that can work in both design and code.

Modular Scale

Modular Scale ratios
Modular Scale ratios

Tim Brown introduced Modular Scale in “More Meaningful Typography” in 2011. It took off like a storm during the period.

The premise here is simple.

Modular Scale is built on the idea that ratios are harmonious, just like how music is harmonious, and these ratios could be used to create harmonious font-sizes.

Examples here include:

  • Golden ratio: 1:1.618
  • Perfect fourth: 3:4
  • Major third: 4:5
  • And so on…

I’ve used Modular Scale for a long time, but I always run into a large problem — if I choose a large ratio, it is impossible to get the right size for smaller values.

So I always ended up using either:

  • a mix of values like 1.2 and 1.618 together (which makes it very complex to calculate).
  • Or I can just end up using 1.2

After a while, it just fell out of favor for me.

Quick aside…

I was curious, so I did a search to see if the typographic scale is based on harmonious proportions or not. I found this article by Spencer.

And it looks like the typography scale is very close to actual mathematical ratios. So this is really not too bad!

typographic scale with deviations

If you really want to dive into the weeds, Spencer has created a typography scale with the exact mathematical values for harmonious relationships. This could be a solid starting point as well. (It looks really good.)

typographic scale mathematical values

Fluid Typography

The last kind of typography used in websites nowadays is fluid typography, where you adjust font sizes based on the viewport width.

body {
font-size: clamp(1rem, 2vw, 1.25rem);
}

The idea here is fluid typography makes responsive typography easier by abstracting away the need to change font sizes at different breakpoints.

Personally, I don’t use this because:

  1. I find it unnecessarily complicated
  2. I prefer knowing my font sizes
  3. I still need to change font sizes at different breakpoints anyway, so what’s the point of this additional complexity?

But if you are happy with fluid typography, please go ahead and use it. I am not judging you. I am just expressing my opinion that it’s overkill.