dobtco / dvl-core

Base styles for the DOBT View Layer.
https://design.dobt.co/
1 stars 1 forks source link

use margin, not line-height for sidebar spacing #160

Closed ajb closed 9 years ago

ajb commented 9 years ago

before:

img

after:

img

closes #145

ajb commented 9 years ago

I feel like we're not understanding each other correctly.

Here's what I'm trying to solve:

img

If you have another way of solving this, maybe you can show me?

jrubenoff commented 9 years ago

Sure, just committed. So here's the goal: every element's container should be a multiple of $rhythm.

One way to do this is to center elements by a fraction of $rhythm. For example, if a top margin of $rhythm is too large, you can add a margin of $rhythm / 2 to both the top and the bottom sides. That still adds up to whole numbers.

To fix line heights for smaller sizes, one trick is to use incremental leading: a line-height that will equal a multiple of $rhythm every few lines. In my last commit, I set it to $rhythm * 2.5, which will align with every other line.

Here's how the spacing of my last commit breaks down:

breakdown2

To get more granular:

breakdown

Let me know if that makes sense.

ajb commented 9 years ago

This seems to add too much spacing here:

Before:

img

After:

img

Also, maybe it's not technically an "override", but we're still overriding an incorrect inherited line-height:

img

(Remember, our default line height is 1.5, not 1.5rem.)

Maybe we should just talk about this in our next checkin.

jrubenoff commented 9 years ago

Alright, removed the line-height on .sidebar_data_text. This should be ready to merge.