|
1 | 1 | import PropTypes from 'prop-types' |
2 | | -import { pr, pl } from '@smooth-ui/system' |
| 2 | +import { pr, pl, merge } from '@smooth-ui/system' |
3 | 3 | import { css } from './styled-engine' |
4 | 4 | import { gridGutter, gridColumns, breakpoints } from './theming/index' |
5 | 5 | import { mediaMinWidth } from './utils/index' |
@@ -74,20 +74,21 @@ function getStyleFromProps(p) { |
74 | 74 | const { gutter = gridGutter(p) } = p |
75 | 75 | const bk = breakpoints(p) |
76 | 76 | const breakpointsKeys = Object.keys(bk) |
77 | | - const style = { |
| 77 | + let style = { |
78 | 78 | boxSizing: 'border-box', |
79 | | - ...pr({ pr: gutter })(p), |
80 | | - ...pl({ pl: gutter })(p), |
81 | 79 | flexBasis: 0, |
82 | 80 | flexGrow: 1, |
83 | 81 | maxWidth: '100%', |
84 | 82 | } |
85 | 83 |
|
| 84 | + style = merge(style, pl({ pl: gutter })(p)) |
| 85 | + style = merge(style, pr({ pr: gutter })(p)) |
| 86 | + |
86 | 87 | let index = -1 |
87 | 88 | // eslint-disable-next-line no-plusplus |
88 | 89 | while (++index < breakpointsKeys.length) { |
89 | 90 | const breakpoint = breakpointsKeys[index] |
90 | | - Object.assign(style, getBreakPointStyle(breakpoint, bk[breakpoint], p)) |
| 91 | + style = merge(style, getBreakPointStyle(breakpoint, bk[breakpoint], p)) |
91 | 92 | } |
92 | 93 |
|
93 | 94 | return style |
|
0 commit comments