UNPKG

atlas-guide

Version:

Atlas is living style-guides & pattern library static site generator with extensive CSS monitoring and components info that could be used virtually with any scss/css project

17 lines (13 loc) 421 B
'use strict'; function getMetric(item, decl) { const regexp = new RegExp('^' + item); // we need to cover several cases - margin, margin-top, margin-start, etc. if (regexp.test(decl.prop)) { let stat = []; const metricList = decl.value.split(' '); metricList.forEach(value => stat.push(value)); return stat; } else { return null; } } module.exports = getMetric;