Skip to content
This repository was archived by the owner on Sep 26, 2024. It is now read-only.

Commit ac283fd

Browse files
author
James Morris
committed
Add Roboto, W3 spec sizes and adjustments for 16px base font size
1 parent 846d6cf commit ac283fd

File tree

4 files changed

+14904
-12
lines changed

4 files changed

+14904
-12
lines changed

Text/index.jsx

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,15 @@ import {
1111
fontSizeMini,
1212
fontSizeSmall,
1313
fontSizeExtraSmall,
14+
fontWeightThin,
15+
fontWeightExtraLight,
16+
fontWeightLight,
1417
fontWeight,
18+
fontWeightMedium,
19+
fontWeightSemiBold,
1520
fontWeightBold,
16-
fontWeightThin,
21+
fontWeightExtraBold,
22+
fontWeightBlack,
1723
} from '../style/font';
1824
import colors from '../style/color';
1925

@@ -25,12 +31,32 @@ const Text = ({ children, size, weight, color }) => {
2531
fontWeight,
2632
color: colors[color],
2733
},
28-
bold: {
29-
fontWeight: fontWeightBold,
34+
// Weights
35+
extraLight: {
36+
fontWeight: fontWeightExtraLight,
37+
},
38+
light: {
39+
fontWeight: fontWeightLight,
3040
},
3141
thin: {
3242
fontWeight: fontWeightThin,
3343
},
44+
medium: {
45+
fontWeight: fontWeightMedium,
46+
},
47+
semiBold: {
48+
fontWeight: fontWeightSemiBold,
49+
},
50+
bold: {
51+
fontWeight: fontWeightBold,
52+
},
53+
extraBold: {
54+
fontWeight: fontWeightExtraBold,
55+
},
56+
black: {
57+
fontWeight: fontWeightBlack,
58+
},
59+
// Sizes
3460
extraSmall: {
3561
fontSize: fontSizeExtraSmall,
3662
},
@@ -47,8 +73,16 @@ const Text = ({ children, size, weight, color }) => {
4773
fontSize: fontSizeSmall,
4874
},
4975
}, {
50-
bold: weight === 'bold',
76+
// Weights
77+
extraLight: weight === 'extra-light',
78+
light: weight === 'light',
5179
thin: weight === 'thin',
80+
medium: weight === 'medium',
81+
semiBold: weight === 'semi-bold',
82+
bold: weight === 'bold',
83+
extraBold: weight === 'extra-bold',
84+
black: weight === 'black',
85+
// Sizes
5286
extraSmall: size === 'extra-small',
5387
large: size === 'large',
5488
extraLarge: size === 'extra-large',
@@ -63,7 +97,7 @@ const Text = ({ children, size, weight, color }) => {
6397
Text.propTypes = {
6498
children: PropTypes.node,
6599
size: PropTypes.oneOf(['extra-small', 'large', 'extra-large', 'mini', 'small']),
66-
weight: PropTypes.oneOf(['bold', 'thin']),
100+
weight: PropTypes.oneOf(['extra-light', 'light', 'thin', 'medium', 'semi-bold', 'bold', 'extra-bold', 'black']),
67101
color: PropTypes.oneOf(Object.keys(colors)),
68102
};
69103

0 commit comments

Comments
 (0)