Dan Hollick Profile picture
Oct 13, 2021 14 tweets 6 min read Read on X
Have you ever noticed that line-height ruins your design system's spacing?

Here's what's going on🧵:
Let's rewind to the 1500s for a second.

To make paragraphs more readable, typesetters needed to create space between type blocks.

They did this by slotting little strips of lead between the rows - hence the name leading.
Here's the important thing. This leading was always below the type block.

4pts of leading plus a 16pt type block meant you had 20pt line height
Fast forward to the mid-90s and the inventors of CSS took a different approach.

They split the leading and added half to the bottom and half to the top of the box - this came to be known as half-leading.
Why did they do this?
Well, imagine putting a stroke around a block of text with all the leading at the bottom.

Splitting the leading up allows the text to sit in the middle of the block, rather than squashed up against the top.
Half-leading solved a bunch of problems but it also created a handful new ones.

Spacing between text is hard to predict and vertical alignment of text inside containers is annoying.
It's not just CSS that does this:

CSS: half-leading
iOS: half-leading
Android: bottom-leading
Figma & Sketch: half-leading
macOS: 🤷
Windows: 🤷

Here's a tool to check out the different platforms:
aresluna.org/line-height-pl…
But there is good news!

There is a CSS spec for something currently called leading-trim which allows you to trim the leading off a text box without cutting off the text.

It gives you control over how you would like the line height calculated for layout.
Why give you all this flexibility?

Well interestingly not all alphabets use the same baseline.
The bad news is, this is still being worked on and it's not clear how long it will be before it is available - this started back in 2018.

Not to mention that Figma and other design tools will need to deal with the new options.
Here are some resources if you are interested in learning more:

This great post on leading-trim by Ethan Wang which turned me onto the whole thing

medium.com/microsoft-desi…
This brilliant piece by @mwichary on the Figma blog about their move over to half-leading.

figma.com/blog/line-heig…
The draft spec for leading trim.

w3.org/TR/css-inline-…
Here are some interesting articles about type design in other alphabets:

keithtam.net/designing-with…
hayataki-masaharu.jp/web-typography…

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Dan Hollick

Dan Hollick Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @DanHollick

Jun 8, 2023
Excited to finally share what I've been working on.

Introducing Detax, a comprehensive suite of automated tax avoidance and money laundering tools. Our goal is to revolutionise the financial fraud industry by bringing it into the 21st century.

detax.framer.website
Historically, avoiding tax has been a manual, labor intensive task which has put it out of the reach of most small businesses.

We're here to change that and open up a world of financial fraud to businesses of any size.
This is, of course, not real.

This is actually the site we're going to build in my advanced @framer course.

You can join the waitlist at advancedframer.com . Beta access in July.
Read 4 tweets
Apr 13, 2023
How does a Large Language Model like ChatGPT actually work?

Well, they are both amazingly simple and exceedingly complex at the same time.

Hold on to your butts, this is a deep dive ↓
You can think of a model as calculating the probabilities of an output based on some input.

In language models, this means that given a sequences of words they calculate the probabilities for the next word in the sequence.

Like a fancy autocomplete. Image
To understand where these probabilities come from, we need to talk about something called a neural network.

This is a network like structure where numbers are fed into one side and probabilities are spat out the other.

They are simpler than you might think.
Read 26 tweets
Mar 16, 2023
Why are some typefaces harder to read than others at the same font-size?

Well, it has a lot to do with x-height but of course it's a bit more complicated than that: ↓
You probably know this already but the x-height of a typeface is the difference between the baseline and the height of the lowercase letters.

We can also think of x-height as a ratio of the total cap height or body height.
Typically we use the letter x to determine this, hence the name.

Interestingly, curved lowercase letters like a, c, and e are often slightly taller than the x-height. They purposefully overshoot so that they appear the same visual height as x, v, w, and z.

Anyway...
Read 13 tweets
Feb 1, 2023
Why is making a dark mode greyscale so hard to get right?

Well, of course it has to do with the weird way humans perceive colour and contrast. 👇
The main issue is we we perceive contrast as higher between lighter colours.

Even though these two sets of colours have the same mathematical contrast we perceive the left as having more contrast than the right. Image
So in designs that use a lot of subtle light greys (containers, borders etc) it isn't as simple as just inverting the colour scale.

The contrast between darker greys will be lower as you can see below.
Read 16 tweets
Dec 15, 2022
Ever heard of a shader but too afraid to ask what it even means at this point?

Lets fuck around and find out 👇
First, we need to understand the difference between a CPU and GPU and why we need a separate unit just to draw graphics anyway.

(Don't worry, it's not going to be too technical.)
The thing that makes a CPU great is that it can perform a wide variety of tasks relatively quickly.

But the limitation is that each CPU core is optimised to do one thing at a time and so tasks are largely performed sequentially.
Read 19 tweets
Nov 2, 2022
Did you know these are called Boolean Operations?

That's because they use booleans to determine which part of the shapes should be visible.

Let me explain 👇 Image
To keep it simple lets use two overlapping circles.

Imagine a boolean for each circle called "inside" - for the area inside each circle the boolean is true, for the area outside it is false.

Any point within the bounding box can be represented in terms of these booleans. Image
Boolean operations are just a way of combining these booleans together to make a new shape.

Take Union for example- the new shape will consist of any area that is inside the red circle OR the blue circle. Image
Read 12 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(