Skip to content

Commit

Permalink
feat(box): Set flexbox properties to stacked boxes
Browse files Browse the repository at this point in the history
  • Loading branch information
lzcabrera committed Nov 10, 2017
1 parent 0ee8049 commit c087582
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/Box/Box.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const getBetweenClasses = (betweenSize, inline) => {
const direction = inline ? 'Right' : 'Bottom'
return joinClassNames(
styles[`between${direction}Margin-${betweenSize}`],
inline ? styles.betweenRight : undefined
inline ? styles.betweenRight : styles.betweenBottom
)
}

Expand Down
5 changes: 5 additions & 0 deletions src/components/Box/Box.modules.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ $responsive-spacings: (
align-items: center;
}

.betweenBottom {
display: flex;
flex-direction: column;
}

// Todo remove unneeded classes related to margin
@mixin spacingClasses ($level, $value) {
.verticalPadding-#{$level} {
Expand Down
4 changes: 2 additions & 2 deletions src/components/Card/Card.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import styles from './Card.modules.scss'
*
* <span class="docs--badge__updated">updated!</span> <span class="docs--badge__version">v0.26.0</span>
*/
const Card = ({variant, children, ...rest}) => (
<Box {...safeRest(rest)} horizontal={3} vertical={4} dangerouslyAddClassName={styles[variant]}>
const Card = ({ variant, children, ...rest }) => (
<Box {...safeRest(rest)} horizontal={4} vertical={4} dangerouslyAddClassName={styles[variant]}>
{children}
</Box>
)
Expand Down

0 comments on commit c087582

Please sign in to comment.