@@ -116,13 +116,6 @@ export const bgColor = styleColor({
116116 cssProperty : 'backgroundColor' ,
117117} ) ;
118118
119- export const borderRadius = style ( {
120- prop : 'radius' ,
121- cssProperty : 'borderRadius' ,
122- key : 'base.radius' ,
123- transformValue : px ,
124- } ) ;
125-
126119export const boxShadow = style ( {
127120 prop : 'shadow' ,
128121 cssProperty : 'boxShadow' ,
@@ -147,9 +140,9 @@ const overflowDefault = style({
147140
148141export const overflow = compose (
149142 // @ts -ignore FIXME
143+ overflowDefault ,
150144 overflowX ,
151- overflowY ,
152- overflowDefault
145+ overflowY
153146) ;
154147
155148export const zIndex = style ( {
@@ -190,17 +183,27 @@ export const borderLeft = style({
190183 transformValue : getBorder ,
191184} ) ;
192185
186+ export const borderRadius = style ( {
187+ prop : 'radius' ,
188+ cssProperty : 'borderRadius' ,
189+ key : 'base.radius' ,
190+ transformValue : px ,
191+ } ) ;
192+
193193export const borderColor = styleColor ( {
194194 prop : 'borderColor' ,
195195} ) ;
196196
197+ // use compose to ensure proper css order
197198export const borders = compose (
198199 // @ts -ignore FIXME
199200 border ,
200201 borderTop ,
201202 borderRight ,
202203 borderBottom ,
203- borderLeft
204+ borderLeft ,
205+ borderColor ,
206+ borderRadius
204207) ;
205208
206209// @ts -ignore FIXME
@@ -293,12 +296,18 @@ const getSpaceValue = scale => propVal => {
293296// @ts -ignore FIXME
294297export const space = props => {
295298 // test for spacing props, so m* and p*
296- const keys = Object . keys ( props ) . filter ( key => / ^ [ m p ] [ t r b l x y ] ? $ / . test ( key ) ) ;
297299 // get space configuration from theme
298300 const scale = get ( props . theme , 'base.space' ) ;
299301 // function to convert propVal -> cssVal
300302 const getStyle = getSpaceValue ( scale ) ;
301303
304+ // to ensure proper order
305+ const keys = [
306+ ...Object . keys ( props ) . filter ( key => / ^ [ m p ] $ / . test ( key ) ) ,
307+ ...Object . keys ( props ) . filter ( key => / ^ [ m p ] [ x y ] $ / . test ( key ) ) ,
308+ ...Object . keys ( props ) . filter ( key => / ^ [ m p ] [ t r b l ] $ / . test ( key ) ) ,
309+ ] ;
310+
302311 // return all style functions for every direction
303312 return keys
304313 . map ( key => {
0 commit comments