Skip to main content
Answer

Set mixed stroke weights

  • October 13, 2024
  • 1 reply
  • 74 views

vernikr

Hi! Is it possible to set mixed stroke weights for a frame? The following code gives me an error

Expected “strokeWeight” to have type number but got object instead

      const m: IndividualStrokesMixin = {
        strokeBottomWeight: 1,
        strokeTopWeight: 2,
        strokeRightWeight: 1,
        strokeLeftWeight: 2,
      };
      figma.currentPage.selection[0].strokeWeight = m;

Best answer by Gleb

These are the properties set directly on the node, not applied to stroke weight as an object.

Docs: RectangleNode | Plugin API

This topic has been closed for replies.

1 reply

Gleb
  • Power Member
  • Answer
  • October 13, 2024

These are the properties set directly on the node, not applied to stroke weight as an object.

Docs: RectangleNode | Plugin API