From c563bbdf88274db7067f8b95236eb2931086de42 Mon Sep 17 00:00:00 2001 From: ashley-hebler Date: Tue, 6 Aug 2019 11:24:33 -0500 Subject: [PATCH] Add base line height on paragraphs to avoid constantly setting --- assets/scss/1-settings/_fonts.scss | 15 +++++++++++++++ assets/scss/4-elements/_all.scss | 5 +++++ assets/scss/5-typography/_t-helpers.scss | 10 +++++----- .../scss/6-components/story-body/_story-body.scss | 6 ++++++ .../scss/6-components/story-body/story-body.html | 2 +- 5 files changed, 32 insertions(+), 6 deletions(-) diff --git a/assets/scss/1-settings/_fonts.scss b/assets/scss/1-settings/_fonts.scss index 9de66a71..8ccb7463 100644 --- a/assets/scss/1-settings/_fonts.scss +++ b/assets/scss/1-settings/_fonts.scss @@ -48,3 +48,18 @@ $font-root-mobile: 15px; $font-letter-spacing-sm: .02em; $font-letter-spacing: .03em; $font-letter-spacing-lg: .05em; + +// Line Height +// +// Consistent line-height values +// +// $line-height-s = 1.25 - Tight leading +// $line-height-b = 1.4 - Default leading used on p tags +// $line-height-m = 1.5 - Heading spacing +// $line-height-l = 2 - More heading spacing +// +// Styleguide 1.2.3 +$line-height-s: 1.25; +$line-height-b: 1.4; +$line-height-m: 1.5; +$line-height-l: 2; diff --git a/assets/scss/4-elements/_all.scss b/assets/scss/4-elements/_all.scss index fc712c1f..308d5934 100644 --- a/assets/scss/4-elements/_all.scss +++ b/assets/scss/4-elements/_all.scss @@ -54,3 +54,8 @@ ul { hr { border: 1px solid $color-gray-light; } + +// By default we add leading to paragraphs +p { + line-height: $line-height-b; +} diff --git a/assets/scss/5-typography/_t-helpers.scss b/assets/scss/5-typography/_t-helpers.scss index 1068f6db..a304526b 100644 --- a/assets/scss/5-typography/_t-helpers.scss +++ b/assets/scss/5-typography/_t-helpers.scss @@ -76,7 +76,7 @@ // // New utility to help eliminate repitition. {{isHelper}} // -// t-space-nospace - Tight leading | line-height: 1 +// t-space-base - Base leading | line-height: 1.4 (used on paragraphs) // t-space-heading-s - More spaced out | line-height: 1.25 // t-space-heading-m - More spaced out | line-height: 1.5 // t-space-heading-l - Even more | line-height: 2 @@ -87,10 +87,10 @@ // Styleguide 5.2.7 // $line-height-type: ( - nospace: 1, - heading-s: 1.25, - heading-m: 1.5, - heading-l: 2, + base: $line-height-b, + heading-s: $line-height-s, + heading-m: $line-height-m, + heading-l: $line-height-l, ); @each $type-set, $line-height in $line-height-type { diff --git a/assets/scss/6-components/story-body/_story-body.scss b/assets/scss/6-components/story-body/_story-body.scss index 9609a0e5..890e9228 100644 --- a/assets/scss/6-components/story-body/_story-body.scss +++ b/assets/scss/6-components/story-body/_story-body.scss @@ -28,6 +28,12 @@ $story-narrow-bp: ($story-narrow / 1rem) + $story-padding-buffer; } } + > p, + > h3, + > ul li { + @include font-setting('secondary'); + @include underlined-link-parent; + } > ul { list-style: disc; diff --git a/assets/scss/6-components/story-body/story-body.html b/assets/scss/6-components/story-body/story-body.html index 3712c4d8..de76c699 100644 --- a/assets/scss/6-components/story-body/story-body.html +++ b/assets/scss/6-components/story-body/story-body.html @@ -1,4 +1,4 @@ -
+

Our editor outputs blocks of texts with paragraph tags.

Helper classes needed

Note that we also sprinkle in sibling helper classes with story-body. For example, the t-linkstyle helper gives us the ability to style links like this.