Skip to content

Commit 1c57a0a

Browse files
authored
Merge pull request #583 from primer/marketing-type-2018
Updates to Marketing Typography
2 parents 96f9fe0 + 1a7850c commit 1c57a0a

File tree

8 files changed

+84
-91
lines changed

8 files changed

+84
-91
lines changed
160 KB
Binary file not shown.
151 KB
Binary file not shown.

modules/primer-marketing-support/lib/variables.scss

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
11
// Type
2-
$alt-body-font: Roboto, -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", "Oxygen", "Ubuntu", "Cantarell", "Open Sans", sans-serif;
3-
$alt-mono-font: $mono-font;
2+
@font-face {
3+
font-family: InterUI;
4+
font-style: normal;
5+
font-weight: $font-weight-normal;
6+
src: local("InterUI"), local("InterUI-Regular"), url("/primer-marketing-support/fonts/Inter-UI-Regular.woff") format("woff");
7+
}
8+
9+
@font-face {
10+
font-family: InterUI;
11+
font-style: normal;
12+
font-weight: $font-weight-semibold;
13+
src: local("InterUI Medium"), local("InterUI-Medium"), url("/primer-marketing-support/fonts/Inter-UI-Medium.woff") format("woff");
14+
}
15+
16+
$font-mktg: InterUI, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol" !default;
17+
18+
// Builds upon primer-support/variables/typography.scss
19+
$h000-size: 64px !default;
20+
$h000-size-mobile: 48px !default;
421

522
// Increases primer-core scale first by 8px for spacer-7 then by 16px step increments for spacer-8 to spacer-12
623
// i.e. After 40px, we have 48, 64, 80, 96, etc.

modules/primer-marketing-support/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
},
1414
"files": [
1515
"index.scss",
16+
"fonts",
1617
"lib"
1718
],
1819
"repository": "https://github.com/primer/primer/tree/master/modules/primer-marketing-support",

modules/primer-marketing-type/README.md

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,19 @@ The typography for our marketing pages differs slightly from what is in Primer's
2020

2121
## Heading Utilities
2222

23-
Use `.alt-h1``.alt-h6` to change an element's font, size, and weight on marketing pages.
23+
Use `.h000-mktg``.h6-mktg` to change an element's font, size, and weight on marketing pages.
2424

2525
```html title="Heading Utilities"
2626

27-
<p class="alt-h1">Pizza 1</p>
28-
<p class="alt-h2">Pizza 2</p>
29-
<p class="alt-h3">Pizza 3</p>
30-
<p class="alt-h4">Pizza 4</p>
31-
<p class="alt-h5">Pizza 5</p>
32-
<p class="alt-h6">Pizza 6</p>
27+
<p class="h000-mktg">Heading 000</p>
28+
<p class="h00-mktg">Heading 00</p>
29+
<p class="h0-mktg">Heading 0</p>
30+
<p class="h1-mktg">Heading 1</p>
31+
<p class="h2-mktg">Heading 2</p>
32+
<p class="h3-mktg">Heading 3</p>
33+
<p class="h4-mktg">Heading 4</p>
34+
<p class="h5-mktg">Heading 5</p>
35+
<p class="h6-mktg">Heading 6</p>
3336

3437
```
3538

@@ -39,13 +42,7 @@ These utilities are meant to be used in addition to Primer's core utilities.
3942

4043
```html title="Typographic Utilities"
4144

42-
<p class="alt-lead text-gray">I'm a lead paragraph. Bacon ipsum dolor amet tri-tip chicken kielbasa, cow swine beef corned beef ground round prosciutto hamburger porchetta sausage alcatra tail.</p>
43-
44-
<p class="text-gray">I'm a regular paragraph, except I'm gray. Bacon ipsum dolor amet tri-tip chicken kielbasa, cow swine beef corned beef ground round prosciutto hamburger porchetta sausage alcatra tail.</p>
45-
46-
<p class="text-gray alt-text-small">And I'm a tiny lil' baby paragraph. Bacon ipsum dolor amet tri-tip chicken kielbasa, cow swine beef corned beef ground round prosciutto hamburger porchetta sausage alcatra tail.</p>
47-
48-
<p class="alt-mono-font text-gray">Occasionally we want to use a mono font, there is a utility class for that.</p>
45+
<p class="lead-mktg text-gray">I'm a lead paragraph. Bacon ipsum dolor amet tri-tip chicken kielbasa, cow swine beef corned beef ground round prosciutto hamburger porchetta sausage alcatra tail.</p>
4946

5047
<p class="pullquote">I'm a pullquote. Someone said these words in real life, and now they're on the internet</p>
5148

modules/primer-marketing-type/lib/typography.scss

Lines changed: 50 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,110 +1,88 @@
1-
// Marketing font utility class
2-
3-
.alt-mono-font {
4-
font-family: $alt-mono-font;
5-
}
6-
7-
//
81
// Headings
92

10-
.alt-h0,
11-
.alt-h1,
12-
.alt-h2,
13-
.alt-h3,
14-
.alt-h4,
15-
.alt-h5,
16-
.alt-h6,
17-
.alt-lead {
18-
-webkit-font-smoothing: antialiased;
19-
font-family: $alt-body-font;
3+
.h00-mktg,
4+
.h0-mktg,
5+
.h1-mktg,
6+
.h2-mktg,
7+
.h3-mktg,
8+
.h4-mktg,
9+
.h5-mktg,
10+
.h6-mktg,
11+
.lead-mktg {
12+
font-family: $font-mktg;
13+
font-weight: $font-weight-semibold;
2014
}
2115

22-
@mixin alt-h0 {
23-
font-size: $h00-size;
24-
font-weight: $font-weight-light;
25-
@include breakpoint(md) { font-size: 54px; }
26-
@include breakpoint(lg) { font-size: 72px; }
16+
@mixin h000-mktg {
17+
font-size: $h000-size-mobile !important;
18+
@include breakpoint(md) { font-size: $h000-size !important; }
2719
}
2820

29-
.alt-h0 {
30-
@include alt-h0;
31-
}
21+
.h000-mktg { @include h000-mktg; }
3222

33-
@mixin alt-h1 {
34-
font-size: 36px;
35-
font-weight: $font-weight-light;
36-
@include breakpoint(md) { font-size: $h00-size; }
37-
@include breakpoint(lg) { font-size: 54px; }
23+
@mixin h00-mktg {
24+
font-size: $h00-size-mobile !important;
25+
@include breakpoint(md) { font-size: $h00-size !important; }
3826
}
3927

40-
.alt-h1 {
41-
@include alt-h1;
42-
}
28+
.h00-mktg { @include h00-mktg; }
4329

44-
@mixin alt-h2 {
45-
font-size: 28px;
46-
font-weight: $font-weight-light;
47-
@include breakpoint(md) { font-size: 34px; }
48-
@include breakpoint(lg) { font-size: 38px; }
30+
@mixin h0-mktg {
31+
font-size: $h0-size-mobile !important;
32+
@include breakpoint(md) { font-size: $h0-size !important; }
4933
}
5034

51-
.alt-h2 {
52-
@include alt-h2;
53-
}
35+
.h0-mktg { @include h0-mktg; }
5436

55-
@mixin alt-h3 {
56-
font-size: 18px;
57-
font-weight: $font-weight-normal;
58-
@include breakpoint(md) { font-size: $h3-size; }
59-
@include breakpoint(lg) { font-size: 22px; }
37+
@mixin h1-mktg {
38+
font-size: $h1-size-mobile !important;
39+
@include breakpoint(md) { font-size: $h1-size !important; }
6040
}
6141

62-
.alt-h3 {
63-
@include alt-h3;
64-
}
42+
.h1-mktg { @include h1-mktg; }
6543

66-
.alt-h4 {
67-
font-size: $h4-size;
68-
font-weight: $font-weight-semibold;
44+
@mixin h2-mktg {
45+
font-size: $h2-size-mobile !important;
46+
@include breakpoint(md) { font-size: $h2-size !important; }
6947
}
7048

71-
.alt-h5 {
72-
font-size: $h5-size;
73-
font-weight: $font-weight-semibold;
74-
}
49+
.h2-mktg { @include h2-mktg; }
7550

76-
.alt-h6 {
77-
font-size: $h6-size;
78-
font-weight: $font-weight-semibold;
51+
@mixin h3-mktg {
52+
font-size: $h3-size-mobile !important;
53+
@include breakpoint(md) { font-size: $h3-size !important; }
7954
}
8055

81-
// Big opening paragraphs
82-
@mixin alt-lead {
83-
-webkit-font-smoothing: antialiased;
84-
font-size: 21px;
85-
font-weight: $font-weight-light;
86-
@include breakpoint(md) { font-size: $h2-size; }
87-
@include breakpoint(lg) { font-size: 26px; }
56+
.h3-mktg { @include h3-mktg; }
57+
58+
.h4-mktg {
59+
font-size: $h4-size !important;
8860
}
8961

90-
.alt-lead {
91-
@include alt-lead;
62+
.h5-mktg {
63+
font-size: $h5-size !important;
9264
}
9365

94-
// For small text
66+
.h6-mktg {
67+
font-size: $h6-size !important;
68+
}
9569

96-
.alt-text-small {
97-
font-size: 14px !important;
70+
// Big opening paragraphs
71+
@mixin lead-mktg {
72+
font-size: $h3-size;
73+
font-weight: $font-weight-normal;
9874
}
9975

76+
.lead-mktg { @include lead-mktg; }
77+
10078
// Pullquote
10179

10280
@mixin pullquote {
10381
padding-top: 0;
10482
padding-bottom: 0;
10583
padding-left: $spacer;
10684
margin-bottom: $spacer-4;
107-
font-family: $alt-mono-font;
85+
font-family: $mono-font;
10886
font-size: $h4-size;
10987
line-height: 1.4;
11088
color: $text-gray;

modules/primer-utilities/docs/box-shadow.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ These types of shadows are typically applied to elements with borders, such as t
2828
<h3 class="m-0">Organization</h3>
2929
</div>
3030
<div class="Box-row">
31-
<p class="mb-0 alt-text-small text-gray">
31+
<p class="mb-0 text-gray">
3232
Taxidermy live-edge mixtape, keytar tumeric locavore meh selvage deep v letterpress vexillologist lo-fi tousled church-key thundercats. Brooklyn bicycle rights tousled, marfa actually.
3333
</p>
3434
</div>
@@ -56,7 +56,7 @@ Medium box shadows are typically used on editorialized content that needs to app
5656
<a class="d-block box-shadow-medium px-3 pt-4 pb-6 position-relative rounded-1 overflow-hidden no-underline" href="#">
5757
<div class="bg-blue position-absolute top-0 left-0 py-1 width-full"></div>
5858
<h3 class="text-gray-dark">Serverless architecture</h3>
59-
<p class="alt-text-small text-gray">
59+
<p class="text-gray">
6060
Build powerful, event-driven, serverless architectures with these open-source libraries and frameworks.
6161
</p>
6262
<ul class="position-absolute bottom-0 pb-3 text-small text-gray list-style-none ">

modules/primer-utilities/lib/typography.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@
206206

207207
/* Set to monospace font */
208208
.text-mono {
209-
font-family: $mono-font;
209+
font-family: $mono-font !important;
210210
}
211211

212212
/* Disallow user from selecting text */

0 commit comments

Comments
 (0)