Skip to content

Commit

Permalink
feat(input): Add a Messaging.modules CSS file to share messaging rela…
Browse files Browse the repository at this point in the history
…ted styles for Notification and
  • Loading branch information
ryanoglesby08 committed Sep 11, 2017
1 parent 1a15b60 commit 2221b6c
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 28 deletions.
3 changes: 2 additions & 1 deletion src/components/Input/Helper/Helper.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import safeRest from '../../../safeRest'
import ColoredTextProvider from '../../Typography/ColoredTextProvider/ColoredTextProvider'
import Paragraph from '../../Typography/Paragraph/Paragraph'

import messagingStyles from '../../Messaging.modules.scss'
import styles from './Helper.modules.scss'

const getClassName = feedback => (feedback ? styles[feedback] : styles.default)
Expand All @@ -18,7 +19,7 @@ const renderContent = (feedback, children) => {

if (feedback === 'error') {
return (
<ColoredTextProvider colorClassName={styles.errorText}>
<ColoredTextProvider colorClassName={messagingStyles.errorText}>
{content}
</ColoredTextProvider>
)
Expand Down
16 changes: 3 additions & 13 deletions src/components/Input/Helper/Helper.modules.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,19 @@
composes: rounded from '../../Borders.modules.scss';

padding: $spacing-base;

// transition: background-color .1s linear; TODO: Why?
}

.default {
composes: base;

background: $color-athens-grey;
composes: default from '../../Messaging.modules.scss';
}

.success {
composes: base;

background: $color-panache;
composes: success from '../../Messaging.modules.scss';
}

.error {
composes: base;

background-color: $color-lavender-blush;
}

// TODO: This is duplicated in Notification...
.errorText {
color: $color-cardinal;
composes: error from '../../Messaging.modules.scss';
}
3 changes: 0 additions & 3 deletions src/components/Input/Input.modules.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
@import '../../scss/settings/typography';
@import '../../scss/settings/spacing';

// TODO: Bring over the responsive styles
// TODO: Bring over/globalize the browser specific styles for the pseudo elements/placeholders

.inputWrapper {
composes: thin rounded from '../Borders.modules.scss';

Expand Down
17 changes: 17 additions & 0 deletions src/components/Messaging.modules.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
@import '../scss/settings/colours';

.default {
background-color: $color-athens-grey;
}

.success {
background-color: $color-panache;
}

.error {
background-color: $color-lavender-blush;
}

.errorText {
color: $color-cardinal;
}
3 changes: 2 additions & 1 deletion src/components/Notification/Notification.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import ColoredTextProvider from '../Typography/ColoredTextProvider/ColoredTextPr
import Paragraph from '../Typography/Paragraph/Paragraph'

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

const { Container, Row, Column } = Grid
Expand All @@ -35,7 +36,7 @@ const renderContent = (variant, children) => {

if (variant === 'error') {
return (
<ColoredTextProvider colorClassName={styles.errorText}>
<ColoredTextProvider colorClassName={messagingStyles.errorText}>
{content}
</ColoredTextProvider>
)
Expand Down
13 changes: 3 additions & 10 deletions src/components/Notification/Notification.modules.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@

.instructional {
composes: base;

background-color: $color-athens-grey;
composes: default from '../Messaging.modules.scss';
}

.branded {
Expand All @@ -19,21 +18,15 @@

.success {
composes: base;

background-color: $color-panache;
composes: success from '../Messaging.modules.scss';
}

.error {
composes: base;

background-color: $color-lavender-blush;
composes: error from '../Messaging.modules.scss';
}

.icon {
margin-right: $spacing-base;
line-height: 1;
}

.errorText {
color: $color-cardinal;
}

0 comments on commit 2221b6c

Please sign in to comment.