Last active
January 3, 2019 14:27
-
-
Save PavelLaptev/2fca239b75e4c214083e9a2db725e0a3 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 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