Skip to main content
100%

See if a layers style is out of sync

✓ Published0🌍 Public
KKevinGutowski
Last edited Mar 7, 2020
Created on Mar 7, 2020

This example demonstrates how to check whether a selected layer’s style has diverged from its associated shared style, indicating a potential sync issue. The script uses the `sketch` JavaScript API to retrieve the active document, access the first selected layer, and then inspect its `style` object. It calls `style.isOutOfSyncWithSharedStyle(selectedLayer.sharedStyle)`, which returns a boolean value that is printed to the console. The code relies on the selected layer’s `sharedStyle` property as the reference point for comparison, without modifying any document state.

AI-generated description

Similar vizzes