Skip to content

Commit 84bbd50

Browse files
authored
Add font-weight-medium to marketing styles, and use it in the type scale (#1497)
* Add and use medium * Use $font-weight-extrabold instead of hard-coded 800 weight * Formatting * Create forty-buses-serve.md * Add text-medium utility * Add $font-weight-extrabold * Bump extra bold to 800
1 parent e072734 commit 84bbd50

File tree

3 files changed

+23
-3
lines changed

3 files changed

+23
-3
lines changed

.changeset/forty-buses-serve.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@primer/css": minor
3+
---
4+
5+
Add font-weight-medium to marketing styles, and use it in the type scale.

src/marketing/support/variables.scss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@
33
$marketing-font-path: "/fonts/" !default;
44

55
$font-mktg: $body-font !default;
6+
$font-weight-medium: 450 !default;
7+
$font-weight-extrabold: 800 !default;
8+
69
$mktg-font-feature-settings: 'ss02' on, 'ss01' on !default;
710
$mktg-header-spacing-large: -0.03em !default;
811
$mktg-header-spacing-default: -0.01em !default;
912
$mktg-header-spacing-threshold: 48px !default;
10-
$mktg-header-weight-large: 800 !default;
13+
$mktg-header-weight-large: $font-weight-extrabold !default;
1114
$mktg-header-weight-default: $font-weight-bold !default;
1215
$mktg-header-weight-threshold: 24px !default;
1316

src/marketing/type/typography.scss

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,11 @@
2727
@include breakpoint(md) {
2828
font-size: map-get($pairing-md, "size") !important;
2929
line-height: map-get($pairing-md, "lh") !important;
30+
3031
@if (map-get($pairing-md, "size") >= $mktg-header-spacing-threshold and map-get($pairing, "size") < $mktg-header-spacing-threshold) {
3132
letter-spacing: $mktg-header-spacing-large !important;
3233
}
34+
3335
@if (map-get($pairing-md, "size") >= $mktg-header-weight-threshold and map-get($pairing, "size") < $mktg-header-weight-threshold) {
3436
font-weight: $mktg-header-weight-large !important;
3537
}
@@ -40,9 +42,11 @@
4042
@include breakpoint(lg) {
4143
font-size: map-get($pairing-lg, "size") !important;
4244
line-height: map-get($pairing-lg, "lh") !important;
45+
4346
@if (map-get($pairing-lg, "size") >= $mktg-header-spacing-threshold and map-get($pairing-md, "size") < $mktg-header-spacing-threshold) {
4447
letter-spacing: $mktg-header-spacing-large !important;
4548
}
49+
4650
@if (map-get($pairing-lg, "size") >= $mktg-header-weight-threshold and map-get($pairing-md, "size") < $mktg-header-weight-threshold) {
4751
font-weight: $mktg-header-weight-large !important;
4852
}
@@ -78,11 +82,13 @@
7882
@include breakpoint(md) {
7983
font-size: map-get($pairing-md, "size") !important;
8084
line-height: map-get($pairing-md, "lh") !important;
85+
8186
@if (map-get($pairing-md, "size") >= $mktg-body-spacing-threshold and map-get($pairing, "size") < $mktg-body-spacing-threshold) {
8287
letter-spacing: $mktg-body-spacing-large !important;
8388
}
89+
8490
@if (map-get($pairing-md, "size") >= $mktg-body-weight-threshold and map-get($pairing, "size") < $mktg-body-weight-threshold) {
85-
font-weight: $font-weight-semibold;
91+
font-weight: $font-weight-medium;
8692
}
8793
}
8894
}
@@ -91,17 +97,23 @@
9197
@include breakpoint(lg) {
9298
font-size: map-get($pairing-lg, "size") !important;
9399
line-height: map-get($pairing-lg, "lh") !important;
100+
94101
@if (map-get($pairing-lg, "size") >= $mktg-body-spacing-threshold and map-get($pairing-md, "size") < $mktg-body-spacing-threshold) {
95102
letter-spacing: $mktg-body-spacing-large !important;
96103
}
104+
97105
@if (map-get($pairing-lg, "size") >= $mktg-body-weight-threshold and map-get($pairing-md, "size") < $mktg-body-weight-threshold) {
98-
font-weight: $font-weight-semibold;
106+
font-weight: $font-weight-medium;
99107
}
100108
}
101109
}
102110
}
103111
}
104112

113+
.text-medium {
114+
font-weight: $font-weight-medium !important;
115+
}
116+
105117
// Pullquote
106118

107119
@mixin pullquote {

0 commit comments

Comments
 (0)