Skip to content

Commit

Permalink
Merge pull request #35 from Winner95/master
Browse files Browse the repository at this point in the history
Add support for line-height
  • Loading branch information
Raathigesh authored Jun 10, 2019
2 parents 7be3209 + 7b6bf24 commit 2c6f566
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
12 changes: 12 additions & 0 deletions src/ui/knobs/text/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ interface Props {

const Properties = {
FontSize: "font-size",
LineHeight: "line-height",
FontWeight: "font-weight",
FontColor: "color",
FontFamily: "font-family",
Expand All @@ -47,6 +48,17 @@ export default function TextStyles({
onChange={value => updateProp(Properties.FontSize, value)}
/>
</RowPropertyPanel>
<RowPropertyPanel
label="Line height"
onClear={() => {
removeProp(Properties.LineHeight);
}}
>
<TextBox
value={declarations[Properties.LineHeight] || ""}
onChange={value => updateProp(Properties.LineHeight, value)}
/>
</RowPropertyPanel>
<RowPropertyPanel label="Font weight">
<SingleSelect
value={declarations[Properties.FontWeight] || ""}
Expand Down
6 changes: 4 additions & 2 deletions src/ui/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import {
BorderColorProps,
BordersProps,
BackgroundColorProps,
FontSizeProps
FontSizeProps,
LineHeightProps
} from "styled-system";

export type StyleProps = FlexDirectionProps &
Expand All @@ -16,4 +17,5 @@ export type StyleProps = FlexDirectionProps &
BorderColorProps &
BordersProps &
BackgroundColorProps &
FontSizeProps;
FontSizeProps &
LineHeightProps;

0 comments on commit 2c6f566

Please sign in to comment.