Skip to content

Commit d472be7

Browse files
fix for pixel letterSpacing
1 parent c86fb40 commit d472be7

File tree

5 files changed

+91403
-468
lines changed

5 files changed

+91403
-468
lines changed

dist/plugin.js

Lines changed: 3957 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/ui.html

Lines changed: 43722 additions & 233 deletions
Large diffs are not rendered by default.

dist/ui.js

Lines changed: 43722 additions & 233 deletions
Large diffs are not rendered by default.

src/extractor/extractFonts.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ const extractFonts: extractorInterface = (tokenNodes: TextStyle[], prefixArray:
120120
},
121121
letterSpacing: {
122122
value: roundWithDecimals(node.letterSpacing.value),
123-
unit: <NumericUnitTypes>node.letterSpacing.unit.toLowerCase(),
123+
unit: <NumericUnitTypes>(node.letterSpacing.unit.toLowerCase() === 'pixels' ? 'pixel' : node.letterSpacing.unit.toLowerCase()),
124124
type: 'number' as PropertyType
125125
},
126126
lineHeight: {

src/transformer/standardTransformer.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { StandardTokenInterface, StandardTokenTypes, StandardTokenDataInterface,
44
import roundWithDecimals from '../utilities/roundWithDecimals'
55
import { tokenExtensions } from './tokenExtensions'
66
import config from '@config/config'
7+
import { UnitTypePixel } from '@typings/valueTypes'
78

89
const lineHeightToDimension = (values): number => {
910
if (values.lineHeight.unit === 'pixel') {

0 commit comments

Comments
 (0)