From 492bc3571b6e11d5a60eb9a1d115a558836b7c49 Mon Sep 17 00:00:00 2001 From: Emily Date: Tue, 23 Oct 2018 15:03:29 -0700 Subject: [PATCH 1/6] add fontWeights to theme --- src/theme.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/theme.js b/src/theme.js index 08831033222..b7b26451cf3 100644 --- a/src/theme.js +++ b/src/theme.js @@ -47,6 +47,12 @@ const theme = { ]), mono: fontStack(['SFMono-Regular', 'Consolas', 'Liberation Mono', 'Menlo', 'Courier', 'monospace']) }, + fontWeights: { + light: 300, + normal: 400, + semibold: 500, + bold: 600 + }, colors, borders: [0, '1px solid'], fontSizes, From caf60d241783d35bf074c86a30a4c9ceedaf98a9 Mon Sep 17 00:00:00 2001 From: Emily Date: Tue, 23 Oct 2018 15:06:31 -0700 Subject: [PATCH 2/6] update fontWeight usages --- pages/doc-components/Header.js | 2 +- pages/doc-components/IndexHero.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/doc-components/Header.js b/pages/doc-components/Header.js index c3676412341..eb41db03ac3 100644 --- a/pages/doc-components/Header.js +++ b/pages/doc-components/Header.js @@ -51,7 +51,7 @@ const Header = ({router}) => ( borderColor="gray.6" display="inline-block" > - + Menu diff --git a/pages/doc-components/IndexHero.js b/pages/doc-components/IndexHero.js index 1c85f5dcbc9..1861ba564e7 100644 --- a/pages/doc-components/IndexHero.js +++ b/pages/doc-components/IndexHero.js @@ -10,7 +10,7 @@ const IndexHero = () => ( Primer Components - + v{version} From 4802968799ae91e3910ba56e9a99624e927ed366 Mon Sep 17 00:00:00 2001 From: Shawn Allen Date: Tue, 23 Oct 2018 15:10:44 -0700 Subject: [PATCH 3/6] fix lint + test workflow --- .github/main.workflow | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/main.workflow b/.github/main.workflow index 5b76e486d01..bbfb20c53b5 100644 --- a/.github/main.workflow +++ b/.github/main.workflow @@ -1,14 +1,19 @@ workflow "Lint and test" { on = "push" - resolves = ["lint", "test"] + resolves = ["install", "lint", "test"] +} + +action "install" { + uses = "actions/npm@94e6933" + args = "ci" } action "lint" { uses = "actions/npm@94e6933" - args = "lint" + args = "run lint" } action "test" { - args = "test" uses = "actions/npm@94e6933" + args = "test" } From dbfae160b4f0772b82d304d14d68cdef9f59267c Mon Sep 17 00:00:00 2001 From: Shawn Allen Date: Tue, 23 Oct 2018 15:11:26 -0700 Subject: [PATCH 4/6] add "needs" for lint and test actions --- .github/main.workflow | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/main.workflow b/.github/main.workflow index bbfb20c53b5..8f128f56ea8 100644 --- a/.github/main.workflow +++ b/.github/main.workflow @@ -9,11 +9,13 @@ action "install" { } action "lint" { + needs = ["install"] uses = "actions/npm@94e6933" args = "run lint" } action "test" { + needs = ["install"] uses = "actions/npm@94e6933" args = "test" } From 2f2c67ea5b0d7d226157e6f316b35f69d63e4547 Mon Sep 17 00:00:00 2001 From: Emily Date: Tue, 23 Oct 2018 15:24:46 -0700 Subject: [PATCH 5/6] update tests --- src/__tests__/Heading.js | 12 ++++++++++-- src/__tests__/Text.js | 4 ++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/__tests__/Heading.js b/src/__tests__/Heading.js index 923fbdd8704..09b91997492 100644 --- a/src/__tests__/Heading.js +++ b/src/__tests__/Heading.js @@ -17,6 +17,12 @@ const theme = { normal: 1.5, condensed: 1.25, condensedUltra: 1 + }, + fontWeights: { + light: '300', + normal: '400', + semibold: '500', + bold: '600' } } @@ -34,8 +40,10 @@ describe('Heading', () => { }) it('respects fontWeight', () => { - expect(render()).toHaveStyleRule('font-weight', 'bold') - expect(render()).toHaveStyleRule('font-weight', 'normal') + expect(render()).toHaveStyleRule('font-weight', theme.fontWeights.bold) + expect(render()).toHaveStyleRule('font-weight', theme.fontWeights.normal) + expect(render()).toHaveStyleRule('font-weight', theme.fontWeights.semibold) + expect(render()).toHaveStyleRule('font-weight', theme.fontWeights.light) }) it('respects lineHeight', () => { diff --git a/src/__tests__/Text.js b/src/__tests__/Text.js index 597cd12f485..64dc55e179f 100644 --- a/src/__tests__/Text.js +++ b/src/__tests__/Text.js @@ -41,8 +41,8 @@ describe('Text', () => { }) it('respects fontWeight', () => { - expect(render()).toHaveStyleRule('font-weight', 'bold') - expect(render()).toHaveStyleRule('font-weight', 'normal') + expect(render()).toHaveStyleRule('font-weight', '600') + expect(render()).toHaveStyleRule('font-weight', '400') }) it('respects lineHeight', () => { From f84c9e5ad9179a3599818f2d95ec8b586cd89e5e Mon Sep 17 00:00:00 2001 From: Emily Date: Tue, 23 Oct 2018 15:27:51 -0700 Subject: [PATCH 6/6] fix lint --- src/__tests__/Heading.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/__tests__/Heading.js b/src/__tests__/Heading.js index 09b91997492..67236189de5 100644 --- a/src/__tests__/Heading.js +++ b/src/__tests__/Heading.js @@ -41,8 +41,14 @@ describe('Heading', () => { it('respects fontWeight', () => { expect(render()).toHaveStyleRule('font-weight', theme.fontWeights.bold) - expect(render()).toHaveStyleRule('font-weight', theme.fontWeights.normal) - expect(render()).toHaveStyleRule('font-weight', theme.fontWeights.semibold) + expect(render()).toHaveStyleRule( + 'font-weight', + theme.fontWeights.normal + ) + expect(render()).toHaveStyleRule( + 'font-weight', + theme.fontWeights.semibold + ) expect(render()).toHaveStyleRule('font-weight', theme.fontWeights.light) })