Skip to content

Commit

Permalink
feat: support fontStyle in props
Browse files Browse the repository at this point in the history
Closes #91
  • Loading branch information
gregberge committed Feb 24, 2020
1 parent c23bfff commit 1777736
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/system/src/styles/typography.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ export const fontWeight = style({
themeGet: getFontWeight,
})

export const fontStyle = style({
prop: 'fontStyle',
})

export const textAlign = style({
prop: 'textAlign',
})
Expand All @@ -73,6 +77,7 @@ export const textTransform = style({
export const typography = compose(
fontFamily,
fontSize,
fontStyle,
lineHeight,
fontWeight,
textAlign,
Expand Down
10 changes: 10 additions & 0 deletions packages/system/tests/styled-components/styles.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,16 @@ describe('styles', () => {
],
},
],
[
'fontStyle',
{
styleRule: 'font-style',
expectations: [
['normal', 'normal'],
['italic', 'italic'],
],
},
],
[
'textAlign',
{
Expand Down
1 change: 1 addition & 0 deletions website/src/pages/docs/style-props.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ Available typography utilities:
- `fontSize`
- `lineHeight`
- `fontWeight`
- `fontStyle`
- `textAlign`
- `letterSpacing`
- `color`
Expand Down

0 comments on commit 1777736

Please sign in to comment.