Hey, how do I access the CSSAttributes function from the API from the newest version? It seems like it was dropped. Am I missing something?
Thanks!
Hi there,
I believe you’re talking about MSLayer.CSSAttributes()? It was indeed replaced with a function that returns the entire list of CSS attributes as a single string (MSLayer.CSSAttributeString()), but you can easily transform it back into a list of attributes if needed:
const layer = ...
const attributes = layer.sketchObject.CSSAttributeString().split('\n')
Yes, exactly this, it worked, thanks a lot!
1 Like
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.