Skip to content

Instantly share code, notes, and snippets.

@PavelLaptev
Created January 3, 2019 14:37
Show Gist options
  • Save PavelLaptev/32e9bf342ec4490c5d4be0a833cfd9b7 to your computer and use it in GitHub Desktop.
Save PavelLaptev/32e9bf342ec4490c5d4be0a833cfd9b7 to your computer and use it in GitHub Desktop.
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