This repository was archived by the owner on Apr 11, 2025. It is now read-only.
  
  
  
  
    
    
    
      
    
  
  
    
File tree Expand file tree Collapse file tree 4 files changed +16
-7
lines changed Expand file tree Collapse file tree 4 files changed +16
-7
lines changed Original file line number Diff line number Diff line change 1313    "registry" : " https://registry.npmjs.org"  ,
1414    "access" : " public" 
1515  },
16-   "peerDependencies " : {
17-     "styled-components" : " >5 " 
16+   "dependencies " : {
17+     "styled-components" : " ^5.3.3 " 
1818  },
1919  "devDependencies" : {
2020    "styled-components" : " ^5.3.3"  ,
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import type {
1111export  type  CommonSpaceNumber  =  2  |  4  |  8  |  12  |  16  |  24 ; 
1212
1313export  interface  IFlexbox  { 
14+   horizontal ?: boolean ; 
1415  direction ?: FlexDirection ; 
1516  distribution ?: ContentDistribution ; 
1617  align ?: ContentPosition ; 
@@ -28,7 +29,7 @@ export const Flexbox: FC<FlexboxProps> = styled.div.attrs(() => ({
2829} ) ) < IFlexbox > ` 
2930  display: flex; 
3031  flex-direction: ${ ( props )  =>  {  
31-     return  getFlexDirection ( props . direction ) ;  
32+     return  getFlexDirection ( props . direction ,   props . horizontal ) ;  
3233  } }  ;
3334  justify-content: ${ ( props )  =>  props . distribution }  ; 
3435  align-items: ${ ( props )  =>  props . align }  ; 
@@ -40,8 +41,10 @@ export const Flexbox: FC<FlexboxProps> = styled.div.attrs(() => ({
4041
4142  > *:not(:last-child) { 
4243    margin-right: ${ ( props )  =>  
43-       getFlexDirection ( props . direction )  ===  'row'  &&  calcValue ( props . gap ) }  ;
44+       getFlexDirection ( props . direction ,  props . horizontal )  ===  'row'  &&  
45+       calcValue ( props . gap ) }  ;
4446    margin-bottom: ${ ( props )  =>  
45-       getFlexDirection ( props . direction )  ===  'column'  &&  calcValue ( props . gap ) }  ;
47+       getFlexDirection ( props . direction ,  props . horizontal )  ===  'column'  &&  
48+       calcValue ( props . gap ) }  ;
4649  } 
4750` ; 
Original file line number Diff line number Diff line change @@ -4,7 +4,8 @@ export type ContentPosition =
44  |  'flex-end' 
55  |  'flex-start' 
66  |  'start' 
7-   |  'stretch' ; 
7+   |  'stretch' 
8+   |  'baseline' ; 
89
910export  type  ContentDistribution  = 
1011  |  'center' 
Original file line number Diff line number Diff line change 11import  type  {  FlexDirection  }  from  './type' ; 
22
3- export  const  getFlexDirection  =  ( direction : FlexDirection )  =>  { 
3+ export  const  getFlexDirection  =  ( 
4+   direction : FlexDirection , 
5+   isHorizontal : boolean , 
6+ )  =>  { 
7+   if  ( isHorizontal )  return  'row' ; 
8+ 
49  switch  ( direction )  { 
510    case  'horizontal' :
611      return  'row' ; 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments