Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to set the font size to 16 pixels in Figma.
Figma
textNode.fontSize = [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using a string like '16px' instead of a number.
Including units like 'px' in the value.
✗ Incorrect
The fontSize property in Figma expects a number representing pixels, so 16 is correct.
2fill in blank
mediumComplete the code to set the line height to 24 pixels in Figma.
Figma
textNode.lineHeight = [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using a string like '24px' instead of a number.
Adding units like 'px'.
✗ Incorrect
Line height in Figma is set as a number representing pixels, so 24 is correct.
3fill in blank
hardFix the error in the code to correctly set font size to 18 pixels.
Figma
textNode.fontSize = [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using a string with 'px' units.
Including units in the value.
✗ Incorrect
Font size must be a number without quotes or units in Figma.
4fill in blank
hardFill both blanks to set font size to 20 and line height to 28 pixels.
Figma
textNode.fontSize = [1] textNode.lineHeight = [2]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using strings with 'px' units.
Mixing numbers and strings.
✗ Incorrect
Both fontSize and lineHeight expect numbers without quotes or units.
5fill in blank
hardFill all three blanks to set font size to 14, line height to 21, and assign the font family 'Roboto'.
Figma
textNode.fontSize = [1] textNode.lineHeight = [2] textNode.fontName = [3]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using strings for fontSize or lineHeight.
Assigning fontName as a string instead of an object.
✗ Incorrect
fontSize and lineHeight are numbers. fontName requires an object with family and style.