Created
January 3, 2019 14:37
-
-
Save PavelLaptev/32e9bf342ec4490c5d4be0a833cfd9b7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getSpacers(stylesArtboard) { | |
// empty "spacers obj" wheree we will store all colors | |
const spacers = {}; | |
// get "spacers" artboard | |
const spacersAtrboard = stylesArtboard.filter(item => { | |
return item.name === "spacers"; | |
})[0].children; | |
spacersAtrboard.map(item => { | |
const spacerObj = { | |
[item.name]: { | |
value: `${item.absoluteBoundingBox.height}px`, | |
type: "spacers" | |
} | |
}; | |
Object.assign(spacers, spacerObj); | |
}); | |
return spacers; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment