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

20 lines (14 loc) 461 B
'use strict'; const color = require('d3-color'); function getBackgroundColor(value) { const finalLayer = value.split(','); const layerPropsList = finalLayer.pop().split(' '); let backgroundColors = []; layerPropsList.forEach(prop => { if (color.hsl(prop).displayable() || /(^\$|^--)/.test(prop)) { return backgroundColors.push(prop); } }); return backgroundColors; } module.exports = getBackgroundColor;