This repository was archived by the owner on Jun 20, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import PropTypes from 'prop-types'
22import { mr , ml } from '@smooth-ui/system'
33import { css } from './styled-engine'
44import { gridGutter } from './theming/index'
5+ import { negative } from './utils/unit'
56import { getSystemPropTypes } from './utils/propTypes'
67import createComponent from './createComponent'
78
@@ -10,13 +11,14 @@ const Row = createComponent(() => ({
1011 omitProps : [ 'gutter' ] ,
1112 style : p => {
1213 const { gutter = gridGutter ( p ) } = p
14+ const negativeGutter = negative ( gutter )
1315 return css `
1416 box-sizing : border-box;
1517 flex-grow : 1 ;
1618 flex-wrap : wrap;
1719 display : flex;
18- ${ ml ( { ml : gutter } ) ( p ) }
19- ${ mr ( { mr : gutter } ) ( p ) }
20+ ${ ml ( { ml : negativeGutter } ) ( p ) }
21+ ${ mr ( { mr : negativeGutter } ) ( p ) }
2022 `
2123 } ,
2224 propTypes : {
Original file line number Diff line number Diff line change 11import { num } from './misc'
22
33export const unit = unit => value => ( num ( value ) ? `${ value } ${ unit } ` : value )
4+ export const negative = value => ( num ( value ) ? - value : `-${ value } ` )
45
56export const px = unit ( 'px' )
67
You can’t perform that action at this time.
0 commit comments