0
0
Figmabi_tool~10 mins

Applying and detaching styles in Figma - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to apply a style to a selected node in Figma.

Figma
node.[1] = styleId
Drag options to blanks, or click blank then click option'
AeffectStyleId
BstrokeStyleId
CtextStyleId
DfillStyleId
Attempts:
3 left
💡 Hint
Common Mistakes
Using strokeStyleId instead of fillStyleId
Trying to assign style directly to fills array
2fill in blank
medium

Complete the code to detach styles from a node in Figma.

Figma
node.[1]()
Drag options to blanks, or click blank then click option'
AremoveStyle
BapplyStyle
CdetachStyle
DdetachAllStyles
Attempts:
3 left
💡 Hint
Common Mistakes
Using applyStyle instead of detachStyle
Trying to set style property to null
3fill in blank
hard

Fix the error in the code to properly detach text styles from a node.

Figma
if (node.[1]) {
  node.detachStyle()
}
Drag options to blanks, or click blank then click option'
AtextStyleId
BfillStyleId
CstrokeStyleId
DeffectStyleId
Attempts:
3 left
💡 Hint
Common Mistakes
Checking fillStyleId for text styles
Not checking any style property before detaching
4fill in blank
hard

Fill both blanks to apply a stroke style and then detach it from a node.

Figma
node.[1] = styleId
node.[2]()
Drag options to blanks, or click blank then click option'
AstrokeStyleId
BdetachStyle
CfillStyleId
DapplyStyle
Attempts:
3 left
💡 Hint
Common Mistakes
Using fillStyleId for stroke style
Calling applyStyle instead of detachStyle
5fill in blank
hard

Fill all three blanks to apply a fill style, check if it exists, and detach it from a node.

Figma
node.[1] = styleId
if (node.[2]) {
  node.[3]()
}
Drag options to blanks, or click blank then click option'
AfillStyleId
CdetachStyle
DapplyStyle
Attempts:
3 left
💡 Hint
Common Mistakes
Using different properties for assignment and check
Calling applyStyle instead of detachStyle