Skip to content

Commit

Permalink
Fix using subThemes
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleAMathews committed Jun 9, 2016
1 parent 1216c32 commit 39a0b80
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand All @@ -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)
Expand Down Expand Up @@ -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' })
})
Expand Down

0 comments on commit 39a0b80

Please sign in to comment.