Skip to content

Commit c4b8ee5

Browse files
committed
Use separate variables for body vs headers
1 parent a6397d8 commit c4b8ee5

File tree

2 files changed

+18
-12
lines changed

2 files changed

+18
-12
lines changed

src/marketing/support/variables.scss

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ $mktg-headers: (
6161
6: [10, 9, 9]
6262
) !default;
6363

64+
// Body content
65+
$mktg-body-spacing-threshold: 28px !default;
66+
$mktg-body-weight-threshold: 24px !default;
67+
$mktg-body-spacing-large: -0.01em !default;
68+
6469
// Body size steps
6570
$mktg-body-size-0: 48px !default;
6671
$mktg-body-size-1: 40px !default;

src/marketing/type/typography.scss

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -65,28 +65,29 @@
6565
@each $body, $sizes in $mktg-bodies {
6666
.f#{$body}-mktg {
6767
$pairing: map-get($mktg-body-pairings, nth($sizes, 1));
68+
$pairing-md: map-get($mktg-body-pairings, nth($sizes, 2));
69+
$pairing-lg: map-get($mktg-body-pairings, nth($sizes, 3));
70+
6871
font-size: map-get($pairing, "size") !important;
6972
line-height: map-get($pairing, "lh") !important;
70-
@if (map-get($pairing, "size") >= 28px) { letter-spacing: $mktg-header-spacing-default !important; }
71-
@if (map-get($pairing, "size") >= 24px) { font-weight: $font-weight-semibold !important; }
73+
@if (map-get($pairing, "size") >= $mktg-body-spacing-threshold) { letter-spacing: $mktg-body-spacing-large !important; }
74+
@if (map-get($pairing, "size") >= $mktg-body-weight-threshold) { font-weight: $font-weight-semibold !important; }
7275

7376
@if (nth($sizes, 1) != nth($sizes, 2)) {
7477
@include breakpoint(md) {
75-
$pairing: map-get($mktg-body-pairings, nth($sizes, 2));
76-
font-size: map-get($pairing, "size") !important;
77-
line-height: map-get($pairing, "lh") !important;
78-
@if (map-get($pairing, "size") >= 28px) { letter-spacing: $mktg-header-spacing-default !important; }
79-
@if (map-get($pairing, "size") >= 24px) { font-weight: $font-weight-semibold !important; }
78+
font-size: map-get($pairing-md, "size") !important;
79+
line-height: map-get($pairing-md, "lh") !important;
80+
@if (map-get($pairing-md, "size") >= $mktg-body-spacing-threshold) { letter-spacing: $mktg-body-spacing-large !important; }
81+
@if (map-get($pairing-md, "size") >= $mktg-body-weight-threshold) { font-weight: $font-weight-semibold !important; }
8082
}
8183
}
8284

8385
@if (nth($sizes, 2) != nth($sizes, 3)) {
8486
@include breakpoint(lg) {
85-
$pairing: map-get($mktg-body-pairings, nth($sizes, 3));
86-
font-size: map-get($pairing, "size") !important;
87-
line-height: map-get($pairing, "lh") !important;
88-
@if (map-get($pairing, "size") >= 28px) { letter-spacing: $mktg-header-spacing-default !important; }
89-
@if (map-get($pairing, "size") >= 24px) { font-weight: $font-weight-semibold !important; }
87+
font-size: map-get($pairing-lg, "size") !important;
88+
line-height: map-get($pairing-lg, "lh") !important;
89+
@if (map-get($pairing-lg, "size") >= $mktg-body-spacing-threshold) { letter-spacing: $mktg-body-spacing-large !important; }
90+
@if (map-get($pairing-lg, "size") >= $mktg-body-weight-threshold) { font-weight: $font-weight-semibold !important; }
9091
}
9192
}
9293
}

0 commit comments

Comments
 (0)