postcss-grid-kiss
Version:
A PostCSS plugin to keep CSS grids stupidly simple
17 lines (14 loc) • 439 B
JavaScript
module.exports = function getAlignSelf(zone) {
const
topIndicator = zone.content.search(/[↑^]/),
bottomIndicator = zone.content.search(/↓|[^\w]v[^\w]/);
if (topIndicator >= 0 && bottomIndicator > topIndicator)
return "stretch"
if (bottomIndicator >= 0 && topIndicator >= bottomIndicator)
return "center"
if (topIndicator >= 0)
return "start"
if (bottomIndicator >= 0)
return "end"
return null;
}