Skip to content

Commit d92a671

Browse files
authored
UIDS-54 Initial commit of typography story (#55)
1 parent 64e3c09 commit d92a671

File tree

15 files changed

+957
-66
lines changed

15 files changed

+957
-66
lines changed

.eslintrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
{
1313
"files": [
1414
"src/**/*.{js,jsx}",
15-
"spec/**/*.{js,jsx}"
15+
"spec/**/*.{js,jsx}",
16+
"stories/**/*.{js,jsx}"
1617
],
1718
"env": {
1819
"browser": true

.github/workflows/gh-pages-deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
on:
33
push:
44
branches:
5-
- master
5+
- feature/UIDS-54-typography-story
66
jobs:
77
gh-pages-deploy:
88
name: Deploying to gh-pages

scss/baseline.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
@import './colors/palette';
2+
@import './typography';
3+
4+
body {
5+
font-family: $font-family;
6+
font-size: $font-size-base;
7+
color: $ux-gray-900;
8+
}

scss/global.scss

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
11
@import url('https://fonts.googleapis.com/css?family=Lato:300,300italic,400,700:latin');
22
@import './theme';
3-
4-
body {
5-
font-family: $font-family;
6-
font-size: $font-size-base;
7-
}
3+
@import './baseline';

scss/typography.scss

Lines changed: 104 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,121 @@
11
$font-family: Lato, Arial, sans-serif;
2-
$font-weight-light: 200;
3-
$font-weight-normal: 300;
4-
$font-size-base: .875rem;
2+
//TODO Use font-weight variables in mixins https://github.com/user-interviews/ui-design-system/issues/57
3+
$font-weight-light: 300;
4+
$font-weight-normal: 400;
55
$font-weight-bold: 700;
6-
$headings-font-weight: 400;
7-
$headings-font-weight-bold: 700;
6+
$font-size-base: 0.875rem;
87

9-
@mixin font-type-100() {
10-
font-family: $font-family;
8+
@mixin font-type-10() {
9+
font-size: .625rem;
10+
font-weight: 400;
11+
letter-spacing: 0.0625rem;
12+
line-height: 0.875rem;
13+
text-transform: uppercase;
14+
}
15+
16+
@mixin font-type-20() {
1117
font-size: .75rem;
12-
font-weight: $font-weight-normal;
18+
font-weight: 400;
1319
line-height: 1rem;
1420
}
1521

16-
@mixin font-type-200() {
17-
font-family: $font-family;
18-
font-size: $font-size-base;
19-
font-weight: $font-weight-normal;
22+
@mixin font-type-30() {
23+
font-size: 0.875rem;
24+
font-weight: 400;
2025
line-height: 1.25rem;
2126
}
2227

23-
@mixin font-type-300() {
24-
font-family: $font-family;
28+
@mixin font-type-40() {
2529
// font-size: $font-size-base; -- should base be changed to 1 rem?
2630
font-size: 1rem;
27-
font-weight: $font-weight-normal;
28-
line-height: 1.5rem;
31+
font-weight: 400;
32+
line-height: 1.375rem;
2933
}
3034

31-
@mixin font-type-400() {
32-
font-family: $font-family;
35+
@mixin font-type-50() {
3336
font-size: 1.125rem;
37+
font-weight: 400;
38+
line-height: 1.5rem;
39+
}
40+
41+
@mixin font-type-60() {
42+
font-size: 1.25rem;
43+
font-weight: 400;
44+
line-height: 1.625rem;
45+
}
46+
47+
@mixin font-type-70() {
48+
font-size: 1.5rem;
49+
font-weight: 400;
50+
line-height: 2rem;
51+
}
52+
53+
@mixin font-type-10--bold() {
54+
@include font-type-10;
55+
font-weight: $font-weight-bold;
56+
}
57+
58+
@mixin font-type-10--light() {
59+
@include font-type-10;
60+
font-weight: 300;
61+
}
62+
63+
@mixin font-type-20--bold() {
64+
@include font-type-20;
65+
font-weight: $font-weight-bold;
66+
}
67+
68+
@mixin font-type-20--light() {
69+
@include font-type-20;
70+
font-weight: 300;
71+
}
72+
73+
@mixin font-type-30--bold() {
74+
@include font-type-30;
75+
font-weight: $font-weight-bold;
76+
}
77+
78+
@mixin font-type-30--light() {
79+
@include font-type-30;
80+
font-weight: 300;
81+
}
82+
83+
@mixin font-type-40--bold() {
84+
@include font-type-40;
3485
font-weight: $font-weight-bold;
35-
line-height: 1.75rem;
86+
}
87+
88+
@mixin font-type-40--light() {
89+
@include font-type-40;
90+
font-weight: 300;
91+
}
92+
93+
@mixin font-type-50--bold() {
94+
@include font-type-50;
95+
font-weight: $font-weight-bold;
96+
}
97+
98+
@mixin font-type-50--light() {
99+
@include font-type-50;
100+
font-weight: 300;
101+
}
102+
103+
@mixin font-type-60--bold() {
104+
@include font-type-60;
105+
font-weight: $font-weight-bold;
106+
}
107+
108+
@mixin font-type-60--light() {
109+
@include font-type-60;
110+
font-weight: 300;
111+
}
112+
113+
@mixin font-type-70--bold() {
114+
@include font-type-70;
115+
font-weight: $font-weight-bold;
116+
}
117+
118+
@mixin font-type-70--light() {
119+
@include font-type-70;
120+
font-weight: 300;
36121
}

0 commit comments

Comments
 (0)