Skip to content

Commit

Permalink
Merge "darkened" section background color as new "tertiary" variant
Browse files Browse the repository at this point in the history
This simplifies the usage of a "darkened" background color for sections
and containers by add it as new "tertiary" variant prop instead of
definiting it as shared style.

GH-115
  • Loading branch information
arcticicestudio committed Jan 26, 2019
1 parent 2010dfd commit b0512cd
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 17 deletions.
10 changes: 8 additions & 2 deletions src/components/containers/core/Section/Section.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,18 @@ import styled from "styled-components";

import { motion } from "styles/theme";

import { baseBackgroundColor, primaryBackgroundColor, secondaryBackgroundColor } from "../shared/styles";
import {
baseBackgroundColor,
primaryBackgroundColor,
secondaryBackgroundColor,
tertiaryBackgroundColor
} from "../shared/styles";

const variants = {
base: baseBackgroundColor,
primary: primaryBackgroundColor,
secondary: secondaryBackgroundColor
secondary: secondaryBackgroundColor,
tertiary: tertiaryBackgroundColor
};

/**
Expand Down
7 changes: 6 additions & 1 deletion src/components/containers/core/shared/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,9 @@ const secondaryBackgroundColor = themedMode({
[MODE_DARK_NIGHT_FROST]: colors.background.sectioning.secondary[MODE_DARK_NIGHT_FROST]
});

export { baseBackgroundColor, primaryBackgroundColor, secondaryBackgroundColor };
const tertiaryBackgroundColor = themedMode({
[MODE_BRIGHT_SNOW_FLURRY]: colors.background.sectioning.tertiary[MODE_BRIGHT_SNOW_FLURRY],
[MODE_DARK_NIGHT_FROST]: colors.background.sectioning.tertiary[MODE_DARK_NIGHT_FROST]
});

export { baseBackgroundColor, primaryBackgroundColor, secondaryBackgroundColor, tertiaryBackgroundColor };
4 changes: 1 addition & 3 deletions src/components/organisms/page/landing/shared/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,8 @@ import {
Z_INDEX_ELEMENTS
} from "styles/theme";

import { darkenedSectionBackgroundColor } from "../../shared/styles";

const darkenedThemeModeBackgroundbackgroundColor = themedMode({
[MODE_DARK_NIGHT_FROST]: darkenedSectionBackgroundColor
[MODE_DARK_NIGHT_FROST]: colors.background.sectioning.tertiary[MODE_DARK_NIGHT_FROST]
});

const decorationBaseStyles = css`
Expand Down
12 changes: 2 additions & 10 deletions src/components/organisms/page/shared/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@
*/

import { css } from "styled-components";
import { darken } from "polished";

import { media, nord } from "styles/theme";
import { media } from "styles/theme";

const emptyStateIllustrationStyles = css`
width: 7em;
Expand All @@ -43,11 +42,4 @@ const errorState404IllustrationStyles = css`
`}
`;

/**
* A darkened background color for landing page section components.
*
* @since 0.6.0
*/
const darkenedSectionBackgroundColor = darken(0.045, nord.nord0);

export { darkenedSectionBackgroundColor, emptyStateIllustrationStyles, errorState404IllustrationStyles };
export { emptyStateIllustrationStyles, errorState404IllustrationStyles };
13 changes: 12 additions & 1 deletion src/styles/theme/colors/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@ const sectioningSecondary = {
[MODE_DARK_NIGHT_FROST]: darken(0.025, nord.nord0)
};

/**
* A darkened background color for landing page section components.
*
* @since 0.6.0
*/
const tertiarySecondary = {
[MODE_BRIGHT_SNOW_FLURRY]: lighten(0.08, nord.nord5),
[MODE_DARK_NIGHT_FROST]: darken(0.045, nord.nord0)
};

/**
* Provides theme background colors.
*
Expand All @@ -37,7 +47,8 @@ const background = {
base,
sectioning: {
primary: sectioningPrimary,
secondary: sectioningSecondary
secondary: sectioningSecondary,
tertiary: tertiarySecondary
}
};

Expand Down

0 comments on commit b0512cd

Please sign in to comment.