Skip to content

Commit 2c6f566

Browse files
authored
Merge pull request #35 from Winner95/master
Add support for line-height
2 parents 7be3209 + 7b6bf24 commit 2c6f566

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

src/ui/knobs/text/index.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ interface Props {
2323

2424
const Properties = {
2525
FontSize: "font-size",
26+
LineHeight: "line-height",
2627
FontWeight: "font-weight",
2728
FontColor: "color",
2829
FontFamily: "font-family",
@@ -47,6 +48,17 @@ export default function TextStyles({
4748
onChange={value => updateProp(Properties.FontSize, value)}
4849
/>
4950
</RowPropertyPanel>
51+
<RowPropertyPanel
52+
label="Line height"
53+
onClear={() => {
54+
removeProp(Properties.LineHeight);
55+
}}
56+
>
57+
<TextBox
58+
value={declarations[Properties.LineHeight] || ""}
59+
onChange={value => updateProp(Properties.LineHeight, value)}
60+
/>
61+
</RowPropertyPanel>
5062
<RowPropertyPanel label="Font weight">
5163
<SingleSelect
5264
value={declarations[Properties.FontWeight] || ""}

src/ui/types.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ import {
66
BorderColorProps,
77
BordersProps,
88
BackgroundColorProps,
9-
FontSizeProps
9+
FontSizeProps,
10+
LineHeightProps
1011
} from "styled-system";
1112

1213
export type StyleProps = FlexDirectionProps &
@@ -16,4 +17,5 @@ export type StyleProps = FlexDirectionProps &
1617
BorderColorProps &
1718
BordersProps &
1819
BackgroundColorProps &
19-
FontSizeProps;
20+
FontSizeProps &
21+
LineHeightProps;

0 commit comments

Comments
 (0)