Skip to content

Commit 54691a5

Browse files
author
Andrey Okonetchnikov
committed
feat: Query and use lineHeight, textAlign and verticalAlign CSS properties
1 parent 542a586 commit 54691a5

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

src/File.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as React from "react";
1+
import * as React from "react"
22
import { Query } from "react-apollo"
33
import gql from "graphql-tag"
44

@@ -37,7 +37,9 @@ export const childrenFragment = gql`
3737
fontFamily
3838
fontWeight
3939
letterSpacing
40-
lineHeightPx
40+
lineHeight
41+
textAlign
42+
verticalAlign
4143
}
4244
fill {
4345
r
@@ -95,8 +97,8 @@ const FIGMA_FILE_SUBSCRIPTION = gql`
9597
`
9698

9799
interface IFile {
98-
fileId: string,
99-
pageName: string,
100+
fileId: string
101+
pageName: string
100102
children?: any
101103
}
102104

src/Text.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
import * as React from "react";
1+
import * as React from "react"
22
import styled from "styled-components"
33
import { rgba } from "polished"
44
import GoogleFontLoader from "react-google-font-loader"
55
import Query from "./Query"
6-
import { INode } from "./Frame";
6+
import { INode } from "./Frame"
77

88
const NodeWrapper = styled("div")`
99
position: absolute;
1010
`
1111

12-
export default function Text({ nodeName, children }:INode) {
12+
export default function Text({ nodeName, children }: INode) {
1313
return (
1414
<Query
1515
variables={{
@@ -49,7 +49,6 @@ export default function Text({ nodeName, children }:INode) {
4949
style={{
5050
...style,
5151
...size,
52-
lineHeight: `${style.lineHeightPx}px`,
5352
left: relativeX,
5453
top: relativeY,
5554
color

0 commit comments

Comments
 (0)