Skip to content
This repository has been archived by the owner on Jun 20, 2022. It is now read-only.

Commit

Permalink
fix: fix Row behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
gregberge committed Mar 21, 2019
1 parent 77db04b commit 8a81124
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/shared/core/Row.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import PropTypes from 'prop-types'
import { mr, ml } from '@smooth-ui/system'
import { css } from './styled-engine'
import { gridGutter } from './theming/index'
import { negative } from './utils/unit'
import { getSystemPropTypes } from './utils/propTypes'
import createComponent from './createComponent'

Expand All @@ -10,13 +11,14 @@ const Row = createComponent(() => ({
omitProps: ['gutter'],
style: p => {
const { gutter = gridGutter(p) } = p
const negativeGutter = negative(gutter)
return css`
box-sizing: border-box;
flex-grow: 1;
flex-wrap: wrap;
display: flex;
${ml({ ml: gutter })(p)}
${mr({ mr: gutter })(p)}
${ml({ ml: negativeGutter })(p)}
${mr({ mr: negativeGutter })(p)}
`
},
propTypes: {
Expand Down
1 change: 1 addition & 0 deletions packages/shared/core/utils/unit.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { num } from './misc'

export const unit = unit => value => (num(value) ? `${value}${unit}` : value)
export const negative = value => (num(value) ? -value : `-${value}`)

export const px = unit('px')

Expand Down

0 comments on commit 8a81124

Please sign in to comment.