SketchAPI icon indicating copy to clipboard operation
SketchAPI copied to clipboard

Update documentation and deprecation warning for Text alignment

Open bomberstudios opened this issue 5 years ago • 0 comments

(Thanks @konki-vienna for the report)

var text = new Text({
  text: 'my text',
  alignment: Text.Alignment.center,
})

throws a warning: Text.alignment is deprecated. Use Text.style.alignment instead.

The error message is a bit confusing (it means "use new Text({ style: { alignment: ... }}) instead of new Text({ alignment: ... })), so we should update both the error message and the example in the documentation: https://developer.sketch.com/reference/api/#text

bomberstudios avatar Apr 14 '20 13:04 bomberstudios