Skip to content

Commit 1777736

Browse files
committed
feat: support fontStyle in props
Closes #91
1 parent c23bfff commit 1777736

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

packages/system/src/styles/typography.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ export const fontWeight = style({
5252
themeGet: getFontWeight,
5353
})
5454

55+
export const fontStyle = style({
56+
prop: 'fontStyle',
57+
})
58+
5559
export const textAlign = style({
5660
prop: 'textAlign',
5761
})
@@ -73,6 +77,7 @@ export const textTransform = style({
7377
export const typography = compose(
7478
fontFamily,
7579
fontSize,
80+
fontStyle,
7681
lineHeight,
7782
fontWeight,
7883
textAlign,

packages/system/tests/styled-components/styles.test.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,16 @@ describe('styles', () => {
7171
],
7272
},
7373
],
74+
[
75+
'fontStyle',
76+
{
77+
styleRule: 'font-style',
78+
expectations: [
79+
['normal', 'normal'],
80+
['italic', 'italic'],
81+
],
82+
},
83+
],
7484
[
7585
'textAlign',
7686
{

website/src/pages/docs/style-props.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ Available typography utilities:
110110
- `fontSize`
111111
- `lineHeight`
112112
- `fontWeight`
113+
- `fontStyle`
113114
- `textAlign`
114115
- `letterSpacing`
115116
- `color`

0 commit comments

Comments
 (0)