Skip to content

Instantly share code, notes, and snippets.

@PavelLaptev
Last active January 3, 2019 14:27
Show Gist options
  • Save PavelLaptev/2fca239b75e4c214083e9a2db725e0a3 to your computer and use it in GitHub Desktop.
Save PavelLaptev/2fca239b75e4c214083e9a2db725e0a3 to your computer and use it in GitHub Desktop.
function getGrids(stylesArtboard) {
// empty "grids obj" wheree we will store all colors
const grids = {};
// get "grids" artboard
const gridsAtrboard = stylesArtboard.filter(item => {
return item.name === "grids";
})[0].children;
gridsAtrboard.map(item => {
gridObj = {
[item.name]: {
count: {
value: item.layoutGrids[0].count,
type: "grids"
},
gutter: {
value: `${item.layoutGrids[0].gutterSize}px`,
type: "grids"
},
offset: {
value: `${item.layoutGrids[0].offset}px`,
type: "grids"
}
}
};
Object.assign(grids, gridObj);
});
return grids;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment