Skip to content

Commit

Permalink
Update generators for the new config keys
Browse files Browse the repository at this point in the history
  • Loading branch information
reinink committed Oct 25, 2017
1 parent 78bbb66 commit 3e58d19
Show file tree
Hide file tree
Showing 13 changed files with 35 additions and 35 deletions.
2 changes: 1 addition & 1 deletion defaultConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ module.exports = {
|
*/

borderColors: Object.assign({ default: colors['slate-lighter'] }, colors)
borderColors: Object.assign({ default: colors['slate-lighter'] }, colors),


/*
Expand Down
4 changes: 2 additions & 2 deletions src/generators/backgroundColors.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import _ from 'lodash'
import defineClass from '../util/defineClass'
import hoverable from '../util/hoverable'

export default function ({ backgrounds }) {
return hoverable(_.map(backgrounds.colors, (color, className) => {
export default function ({ backgroundColors }) {
return hoverable(_.map(backgroundColors, (color, className) => {
return defineClass(`bg-${className}`, {
'background-color': color,
})
Expand Down
4 changes: 2 additions & 2 deletions src/generators/borderColors.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import _ from 'lodash'
import defineClass from '../util/defineClass'
import hoverable from '../util/hoverable'

export default function ({ colors, borders }) {
return hoverable(_.map(_.omit(borders.colors, 'default'), (color, className) => {
export default function ({ borderColors }) {
return hoverable(_.map(_.omit(borderColors, 'default'), (color, className) => {
return defineClass(`border-${className}`, {
'border-color': color,
})
Expand Down
8 changes: 4 additions & 4 deletions src/generators/borderWidths.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ function sizedBorder(size, width, color) {
})
}

module.exports = function({colors, borders}) {
const color = borders.colors.default
module.exports = function({ borderWidths, borderColors }) {
const color = borderColors.default

return _.flatten([
defaultBorder(borders.widths.default, color),
..._.map(_.omit(borders.widths, 'default'), (width, size) => sizedBorder(size, width, color)),
defaultBorder(borderWidths.default, color),
..._.map(_.omit(borderWidths, 'default'), (width, size) => sizedBorder(size, width, color)),
])
}
6 changes: 3 additions & 3 deletions src/generators/rounded.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ function roundedVariant(modifier, radius) {
})
}

module.exports = function({ radiuses }) {
module.exports = function({ borderRadius }) {
return _.flatten([
defaultRounded(radiuses.default),
..._.map(_.omit(radiuses, 'default'), (radius, modifier) => roundedVariant(modifier, radius)),
defaultRounded(borderRadius.default),
..._.map(_.omit(borderRadius, 'default'), (radius, modifier) => roundedVariant(modifier, radius)),
])
}
14 changes: 7 additions & 7 deletions src/generators/sizing.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ function defineMaxHeights(heights) {
})
}

export default function ({ sizing }) {
export default function (config) {
return _.flatten([
defineWidths(sizing.width),
defineMinWidths(sizing.minWidth),
defineMaxWidths(sizing.maxWidth),
defineHeights(sizing.height),
defineMinHeights(sizing.minHeight),
defineMaxHeights(sizing.maxHeight),
defineWidths(config.width),
defineMinWidths(config.minWidth),
defineMaxWidths(config.maxWidth),
defineHeights(config.height),
defineMinHeights(config.minHeight),
defineMaxHeights(config.maxHeight),
])
}
8 changes: 4 additions & 4 deletions src/generators/spacing.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ function defineNegativeMargin(negativeMargin) {
})
}

export default function ({ spacing }) {
export default function ({ padding, margin, negativeMargin }) {
return _.flatten([
definePadding(spacing.padding),
defineMargin(spacing.margin),
definePadding(padding),
defineMargin(margin),
defineClasses({
'mr-auto': {
'margin-right': 'auto',
Expand All @@ -109,6 +109,6 @@ export default function ({ spacing }) {
'margin-right': 'auto',
},
}),
defineNegativeMargin(spacing.negativeMargin),
defineNegativeMargin(negativeMargin),
])
}
4 changes: 2 additions & 2 deletions src/generators/textColors.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import _ from 'lodash'
import defineClass from '../util/defineClass'
import hoverable from '../util/hoverable'

export default function ({ colors, text }) {
return hoverable(_.map(text.colors, (color, modifier) => {
export default function ({ textColors }) {
return hoverable(_.map(textColors, (color, modifier) => {
return defineClass(`text-${modifier}`, {
'color': color,
})
Expand Down
4 changes: 2 additions & 2 deletions src/generators/textFonts.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import _ from 'lodash'
import defineClass from '../util/defineClass'

export default function ({ text }) {
return _.map(text.fonts, (families, font) => {
export default function ({ fonts }) {
return _.map(fonts, (families, font) => {
return defineClass(`font-${font}`, {
'font-family': `${families}`,
})
Expand Down
4 changes: 2 additions & 2 deletions src/generators/textLeading.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import _ from 'lodash'
import defineClass from '../util/defineClass'

export default function ({ text }) {
return _.map(text.leading, (value, modifier) => {
export default function ({ leading }) {
return _.map(leading, (value, modifier) => {
return defineClass(`leading-${modifier}`, {
'line-height': `${value}`,
})
Expand Down
4 changes: 2 additions & 2 deletions src/generators/textSizes.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import _ from 'lodash'
import defineClass from '../util/defineClass'

export default function ({ text }) {
return _.map(text.sizes, (size, modifier) => {
export default function ({ textSizes }) {
return _.map(textSizes, (size, modifier) => {
return defineClass(`text-${modifier}`, {
'font-size': `${size}`,
})
Expand Down
4 changes: 2 additions & 2 deletions src/generators/textTracking.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import _ from 'lodash'
import defineClass from '../util/defineClass'

export default function ({ text }) {
return _.map(text.tracking, (value, modifier) => {
export default function ({ tracking }) {
return _.map(tracking, (value, modifier) => {
return defineClass(`tracking-${modifier}`, {
'letter-spacing': `${value}`,
})
Expand Down
4 changes: 2 additions & 2 deletions src/generators/textWeights.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import _ from 'lodash'
import defineClass from '../util/defineClass'
import hoverable from '../util/hoverable'

export default function ({ text }) {
return hoverable(_.map(text.weights, (weight, modifier) => {
export default function ({ fontWeights }) {
return hoverable(_.map(fontWeights, (weight, modifier) => {
return defineClass(`font-${modifier}`, {
'font-weight': `${weight}`,
})
Expand Down

0 comments on commit 3e58d19

Please sign in to comment.