Bird
Raised Fist0
Figmabi_tool~10 mins

Inspect mode in Figma - Interactive Code Practice

Choose your learning style10 modes available

Start learning this pattern below

Jump into concepts and practice - no test required

or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to select an element in Inspect mode.

Figma
element = document.querySelector('[1]')
Drag options to blanks, or click blank then click option'
A#button
Binspect
Cdiv
D.frame
Attempts:
3 left
💡 Hint
Common Mistakes
Using class selector '.' instead of ID selector '#'.
Using tag name without prefix.
2fill in blank
medium

Complete the code to get the width of the selected element in Inspect mode.

Figma
width = element.getBoundingClientRect().[1]
Drag options to blanks, or click blank then click option'
Aheight
Btop
Cwidth
Dleft
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'height' instead of 'width'.
Using 'top' or 'left' which are position properties.
3fill in blank
hard

Fix the error in the code to get the background color of the element in Inspect mode.

Figma
bgColor = window.getComputedStyle(element).[1]('background-color')
Drag options to blanks, or click blank then click option'
AgetPropertyValue
BgetStyle
CgetBackground
DgetColor
Attempts:
3 left
💡 Hint
Common Mistakes
Using non-existent methods like 'getStyle' or 'getBackground'.
Trying to access CSS properties directly without using the method.
4fill in blank
hard

Fill both blanks to create a function that returns the height and width of an element in Inspect mode.

Figma
function getSize(element) {
  return { height: element.getBoundingClientRect().[1], width: element.getBoundingClientRect().[2] };
}
Drag options to blanks, or click blank then click option'
Aheight
Bwidth
Ctop
Dleft
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'top' or 'left' instead of 'height' or 'width'.
Mixing up the order of height and width.
5fill in blank
hard

Fill all three blanks to write code that gets the font size, font weight, and color of an element in Inspect mode.

Figma
const style = window.getComputedStyle(element);
const fontSize = style.[1]('font-size');
const fontWeight = style.[2]('font-weight');
const color = style.[3]('color');
Drag options to blanks, or click blank then click option'
AgetPropertyValue
BgetStyle
DgetColor
Attempts:
3 left
💡 Hint
Common Mistakes
Using different or invalid methods for each property.
Trying to access properties directly without a method.

Practice

(1/5)
1. What is the main purpose of Inspect mode in Figma?
easy
A. To show detailed information about design elements like sizes and colors
B. To create new design components quickly
C. To export images in different formats
D. To add animations to design elements

Solution

  1. Step 1: Understand Inspect mode function

    Inspect mode provides detailed info about design elements such as sizes, colors, and fonts.
  2. Step 2: Compare options with Inspect mode purpose

    Only To show detailed information about design elements like sizes and colors matches this purpose; others describe different Figma features.
  3. Final Answer:

    To show detailed information about design elements like sizes and colors -> Option A
  4. Quick Check:

    Inspect mode = detailed design info [OK]
Hint: Inspect mode = detailed design specs view [OK]
Common Mistakes:
  • Confusing Inspect mode with design creation tools
  • Thinking Inspect mode exports images
  • Assuming Inspect mode adds animations
2. Which of the following is the correct way to open Inspect mode in Figma?
easy
A. Right-click on a design element and select 'Inspect'
B. Double-click the canvas background
C. Click the 'Inspect' tab on the right panel
D. Press Ctrl + I to toggle Inspect mode

Solution

  1. Step 1: Identify how Inspect mode is accessed

    Inspect mode is accessed by clicking the 'Inspect' tab in the right panel of Figma.
  2. Step 2: Evaluate each option

    Click the 'Inspect' tab on the right panel correctly describes this. Other options describe incorrect or unsupported actions.
  3. Final Answer:

    Click the 'Inspect' tab on the right panel -> Option C
  4. Quick Check:

    Inspect tab in right panel = open Inspect mode [OK]
Hint: Look for 'Inspect' tab on right panel [OK]
Common Mistakes:
  • Trying to open Inspect mode via right-click menu
  • Using keyboard shortcut Ctrl + I which doesn't open Inspect
  • Double-clicking canvas background does nothing
3. In Inspect mode, if a rectangle has width 200px and height 100px, what will the size info show?
medium
A. Width: 200px, Height: 100px
B. Width: 100px, Height: 200px
C. Width: 300px, Height: 100px
D. Width: 200px, Height: 300px

Solution

  1. Step 1: Understand Inspect mode size display

    Inspect mode shows exact width and height of design elements as specified.
  2. Step 2: Match given rectangle dimensions

    The rectangle is 200px wide and 100px tall, so Inspect mode shows Width: 200px, Height: 100px.
  3. Final Answer:

    Width: 200px, Height: 100px -> Option A
  4. Quick Check:

    Size info = exact element dimensions [OK]
Hint: Inspect mode shows exact width and height [OK]
Common Mistakes:
  • Swapping width and height values
  • Adding dimensions incorrectly
  • Assuming Inspect mode rounds sizes
4. You opened Inspect mode but see no color code for a selected text element. What is the likely issue?
medium
A. Inspect mode only shows colors for shapes, not text
B. The Inspect mode is disabled in settings
C. You need to restart Figma to see colors
D. The text element has no fill color applied

Solution

  1. Step 1: Understand Inspect mode color display

    Inspect mode shows color codes only if the element has a fill color applied.
  2. Step 2: Analyze why no color code appears

    If a text element has no fill color, Inspect mode cannot show a color code, explaining the issue.
  3. Final Answer:

    The text element has no fill color applied -> Option D
  4. Quick Check:

    No fill color = no color code in Inspect mode [OK]
Hint: Check if element has fill color applied [OK]
Common Mistakes:
  • Thinking Inspect mode ignores text colors
  • Restarting Figma unnecessarily
  • Assuming Inspect mode can be disabled
5. You want to speed up handoff by sharing exact font size, color, and spacing from Figma to developers. How does Inspect mode help?
hard
A. It exports the entire design as a PDF with specs
B. It provides exact CSS code snippets for selected elements
C. It automatically creates developer documentation
D. It converts designs into editable code files

Solution

  1. Step 1: Identify Inspect mode features for handoff

    Inspect mode shows exact sizes, colors, fonts, and provides CSS code snippets for developers.
  2. Step 2: Compare options with Inspect mode capabilities

    Only It provides exact CSS code snippets for selected elements correctly describes Inspect mode's role in providing CSS snippets to speed up handoff.
  3. Final Answer:

    It provides exact CSS code snippets for selected elements -> Option B
  4. Quick Check:

    Inspect mode = exact CSS snippets for handoff [OK]
Hint: Inspect mode gives CSS code snippets for developers [OK]
Common Mistakes:
  • Confusing Inspect mode with exporting PDFs
  • Expecting automatic documentation creation
  • Thinking Inspect mode converts designs to code files