Skip to content

Instantly share code, notes, and snippets.

@thomasJang
Created November 14, 2018 03:24
Show Gist options
  • Select an option

  • Save thomasJang/542260f7735f4221664b3701f761cf47 to your computer and use it in GitHub Desktop.

Select an option

Save thomasJang/542260f7735f4221664b3701f761cf47 to your computer and use it in GitHub Desktop.
SMixinFlex.ts
export interface ISMixinFlex {
direction?: 'row' | 'column';
justifyContent?:
| 'normal'
| 'space-between'
| 'space-around'
| 'space-evenly'
| 'stretch'
| 'start'
| 'end'
| 'flex-start'
| 'flex-end';
alignItems?:
| 'normal'
| 'stretch'
| 'center'
| 'start'
| 'end'
| 'self-start'
| 'self-end'
| 'flex-start'
| 'flex-end';
flexWrap?: 'nowrap' | 'wrap' | 'wrap-reverse';
}
export const SMixinFlex = ({
direction = 'row',
justifyContent = 'stretch',
alignItems = 'center',
flexWrap = 'nowrap',
}: ISMixinFlex = {}) => `
display: flex;
flex-wrap: ${flexWrap};
flex-direction: ${direction};
justify-content: ${justifyContent};
align-items: ${alignItems};
`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment