Skip to content

Commit

Permalink
fix: missing node attributes for fontSize and fontWeight
Browse files Browse the repository at this point in the history
  • Loading branch information
Nelfimov committed Oct 25, 2023
1 parent aa17828 commit 206aaad
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion theme/theme-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,15 @@
"version": "0.0.1",
"license": "BSD-3-Clause",
"main": "src/index.ts",
"bin": {
"figma-theme": "dist/index.js"
},
"files": [
"dist"
],
"scripts": {
"build": "yarn library build",
"figma-theme": "FIGMA_TOKEN=figd_BGqX9t3pqc3rnEG1tsSV5hmtS69P-ipk_lXwKB36 ts-node bin/figma-theme-cli.ts JaYasAWWI7tvkTuMTfB514 -v -o dist",
"figma-theme": "FIGMA_TOKEN=figd_BGqX9t3pqc3rnEG1tsSV5hmtS69P-ipk_lXwKB36 ts-node bin/figma-theme-cli.ts 7nw0qsfWwSzRVl4B5WEwxt -v -o dist",
"prepack": "yarn run build",
"postpack": "rm -rf dist"
},
Expand Down
2 changes: 1 addition & 1 deletion theme/theme-font-sizes-generator/src/strategy/Strategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export abstract class Strategy {
const stat = new Map<number, number>()

textNodes.forEach((node) => {
const fontSize = Math.round(node.style.fontSize)
const fontSize = Math.round(node.style?.fontSize)

stat.set(fontSize, (stat.get(fontSize) || 0) + 1)
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export abstract class Strategy {
const stat = new Map<number, number>()

textNodes.forEach((node) => {
const fontWeights = Math.round(node.style.fontWeight)
const fontWeights = Math.round(node.style?.fontWeight)

stat.set(fontWeights, (stat.get(fontWeights) || 0) + 1)
})
Expand Down

0 comments on commit 206aaad

Please sign in to comment.