Skip to content

Commit

Permalink
Add font-weight-medium to marketing styles, and use it in the type sc…
Browse files Browse the repository at this point in the history
…ale (#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
  • Loading branch information
tobiasahlin authored Jul 14, 2021
1 parent e072734 commit 84bbd50
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/forty-buses-serve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@primer/css": minor
---

Add font-weight-medium to marketing styles, and use it in the type scale.
5 changes: 4 additions & 1 deletion src/marketing/support/variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
$marketing-font-path: "/fonts/" !default;

$font-mktg: $body-font !default;
$font-weight-medium: 450 !default;
$font-weight-extrabold: 800 !default;

$mktg-font-feature-settings: 'ss02' on, 'ss01' on !default;
$mktg-header-spacing-large: -0.03em !default;
$mktg-header-spacing-default: -0.01em !default;
$mktg-header-spacing-threshold: 48px !default;
$mktg-header-weight-large: 800 !default;
$mktg-header-weight-large: $font-weight-extrabold !default;
$mktg-header-weight-default: $font-weight-bold !default;
$mktg-header-weight-threshold: 24px !default;

Expand Down
16 changes: 14 additions & 2 deletions src/marketing/type/typography.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@
@include breakpoint(md) {
font-size: map-get($pairing-md, "size") !important;
line-height: map-get($pairing-md, "lh") !important;

@if (map-get($pairing-md, "size") >= $mktg-header-spacing-threshold and map-get($pairing, "size") < $mktg-header-spacing-threshold) {
letter-spacing: $mktg-header-spacing-large !important;
}

@if (map-get($pairing-md, "size") >= $mktg-header-weight-threshold and map-get($pairing, "size") < $mktg-header-weight-threshold) {
font-weight: $mktg-header-weight-large !important;
}
Expand All @@ -40,9 +42,11 @@
@include breakpoint(lg) {
font-size: map-get($pairing-lg, "size") !important;
line-height: map-get($pairing-lg, "lh") !important;

@if (map-get($pairing-lg, "size") >= $mktg-header-spacing-threshold and map-get($pairing-md, "size") < $mktg-header-spacing-threshold) {
letter-spacing: $mktg-header-spacing-large !important;
}

@if (map-get($pairing-lg, "size") >= $mktg-header-weight-threshold and map-get($pairing-md, "size") < $mktg-header-weight-threshold) {
font-weight: $mktg-header-weight-large !important;
}
Expand Down Expand Up @@ -78,11 +82,13 @@
@include breakpoint(md) {
font-size: map-get($pairing-md, "size") !important;
line-height: map-get($pairing-md, "lh") !important;

@if (map-get($pairing-md, "size") >= $mktg-body-spacing-threshold and map-get($pairing, "size") < $mktg-body-spacing-threshold) {
letter-spacing: $mktg-body-spacing-large !important;
}

@if (map-get($pairing-md, "size") >= $mktg-body-weight-threshold and map-get($pairing, "size") < $mktg-body-weight-threshold) {
font-weight: $font-weight-semibold;
font-weight: $font-weight-medium;
}
}
}
Expand All @@ -91,17 +97,23 @@
@include breakpoint(lg) {
font-size: map-get($pairing-lg, "size") !important;
line-height: map-get($pairing-lg, "lh") !important;

@if (map-get($pairing-lg, "size") >= $mktg-body-spacing-threshold and map-get($pairing-md, "size") < $mktg-body-spacing-threshold) {
letter-spacing: $mktg-body-spacing-large !important;
}

@if (map-get($pairing-lg, "size") >= $mktg-body-weight-threshold and map-get($pairing-md, "size") < $mktg-body-weight-threshold) {
font-weight: $font-weight-semibold;
font-weight: $font-weight-medium;
}
}
}
}
}

.text-medium {
font-weight: $font-weight-medium !important;
}

// Pullquote

@mixin pullquote {
Expand Down

0 comments on commit 84bbd50

Please sign in to comment.