From c84f0ec4b75b18cc00622333b67735c62bc5cdad Mon Sep 17 00:00:00 2001 From: Adam Wathan Date: Fri, 25 Aug 2017 10:00:21 -0400 Subject: [PATCH] Support colors not in map If you specify a background color that isn't a key in the colors map, we just assume it's an actual color value and let you use it. --- src/generators/background-colors.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/generators/background-colors.js b/src/generators/background-colors.js index bf213eb29..9d4d39bec 100644 --- a/src/generators/background-colors.js +++ b/src/generators/background-colors.js @@ -2,9 +2,11 @@ const postcss = require('postcss') const _ = require('lodash') function findColor(colors, color) { - return _.mapKeys(colors, (value, key) => { + const colorsNormalized = _.mapKeys(colors, (value, key) => { return _.camelCase(key) - })[_.camelCase(color)] + }) + + return _.get(colorsNormalized, _.camelCase(color), color) } module.exports = function ({ colors, backgroundColors }) {