From 39a0b80740f77bde3e3bcf86bc71389084bb34b1 Mon Sep 17 00:00:00 2001 From: Kyle Mathews Date: Wed, 8 Jun 2016 22:17:07 -0700 Subject: [PATCH] Fix using subThemes --- src/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index 3675de35..2d54a4af 100644 --- a/src/index.js +++ b/src/index.js @@ -2,6 +2,7 @@ import objectAssign from 'object-assign' import verticalRhythm from 'compass-vertical-rhythm' import ms from 'modularscale' import isObject from 'lodash/isObject' +import keys from 'lodash/keys' import createStyles from './utils/createStyles' @@ -11,7 +12,7 @@ const createStylesString = function (options) { let styles = createStyles(vr, options) if ((options.subThemes != null) && isObject(options.subThemes)) { - options.subThemes.forEach((name) => { + keys(options.subThemes).forEach((name) => { const theme = options.subThemes[name] vr = verticalRhythm(theme) styles += createStyles(vr, theme, name, options) @@ -54,7 +55,7 @@ const Typography = function (opts) { const options = objectAssign(defaults, opts) if ((options.subThemes != null) && isObject(options.subThemes)) { - options.subThemes.forEach((name) => { + keys(options.subThemes).forEach((name) => { const theme = options.subThemes[name] options.subThemes[name] = objectAssign({}, options, theme, { rhythmUnit: 'px' }) })