Skip to content

Commit

Permalink
feat(input): Add a Flex.modules CSS file to share flexbox styles amon…
Browse files Browse the repository at this point in the history
…g components
  • Loading branch information
ryanoglesby08 committed Sep 11, 2017
1 parent b7e9c40 commit 1a15b60
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 15 deletions.
9 changes: 9 additions & 0 deletions src/components/Flexbox.modules.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.column {
display: flex;
flex-direction: column;
}

.row {
display: flex;
flex-direction: row;
}
3 changes: 1 addition & 2 deletions src/components/Input/Input.modules.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
.inputWrapper {
composes: thin rounded from '../Borders.modules.scss';

display: flex;
flex-direction: row;
composes: row from '../Flexbox.modules.scss';
align-items: center;
}

Expand Down
7 changes: 1 addition & 6 deletions src/components/Input/WithSpacing/WithSpacing.modules.scss
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
@import '../../../scss/settings/spacing';

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

.evenMarginBottom-1 {
composes: flexColumn;
composes: column from '../../Flexbox.modules.scss';

> * {
margin-bottom: $spacing-x-tight;
Expand Down
3 changes: 2 additions & 1 deletion src/components/Notification/Notification.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import Icon from '../../old-components/Icon/Icon'
import ColoredTextProvider from '../Typography/ColoredTextProvider/ColoredTextProvider'
import Paragraph from '../Typography/Paragraph/Paragraph'

import flexboxStyles from '../Flexbox.modules.scss'
import styles from './Notification.modules.scss'

const { Container, Row, Column } = Grid
Expand Down Expand Up @@ -52,7 +53,7 @@ const Notification = ({ variant, children, ...rest }) => (
<Container limitWidth>
<Row>
<Column xs={12}>
<div className={styles.flexRow}>
<div className={flexboxStyles.row}>
{isImportant(variant) ? renderIcon(iconByVariant[variant]) : undefined}

{renderContent(variant, children)}
Expand Down
5 changes: 0 additions & 5 deletions src/components/Notification/Notification.modules.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@
background-color: $color-lavender-blush;
}

.flexRow {
display: flex;
flex-direction: row;
}

.icon {
margin-right: $spacing-base;
line-height: 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ exports[`<Notification /> renders 1`] = `
xs={12}
>
<div
className="flexRow"
className="row"
>
<Paragraph
align="left"
Expand Down

0 comments on commit 1a15b60

Please sign in to comment.