Skip to content

Commit

Permalink
Create "theme mode" constants for Nord "auras"
Browse files Browse the repository at this point in the history
Initially Nord Docs will be build with the "bright snow flurry" and
"dark night frost" theme modes representing Nord "auras". The names
have been implemented as constants to be used with the theme utility
functions to define the styles of a component for each available global
theme.

GH-53
  • Loading branch information
arcticicestudio committed Dec 3, 2018
1 parent 6c7eb7c commit 687d30f
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/components/containers/core/Root/index.js
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
/*
* Copyright (C) 2018-present Arctic Ice Studio <[email protected]>
* Copyright (C) 2018-present Sven Greb <[email protected]>
*
* Project: Nord Docs
* Repository: https://github.com/arcticicestudio/nord-docs
* License: MIT
*/

export { default } from "./Root";
41 changes: 41 additions & 0 deletions src/styles/theme/constants.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* Copyright (C) 2018-present Arctic Ice Studio <[email protected]>
* Copyright (C) 2018-present Sven Greb <[email protected]>
*
* Project: Nord Docs
* Repository: https://github.com/arcticicestudio/nord-docs
* License: MIT
*/

/**
* @file Provides theme constants.
* @author Arctic Ice Studio <[email protected]>
* @author Sven Greb <[email protected]>
* @since 0.2.0
*/

/**
* Name of Nord's "bright snow flurry" aura for usage as theme mode.
*
* @constant {string}
* @since 0.2.0
*/
const MODE_BRIGHT_SNOW_FLURRY = "BRIGHT_SNOW_FLURRY";

/**
* Name of Nord's "dark night frost" aura for usage as theme mode.
*
* @constant {string}
* @since 0.2.0
*/
const MODE_DARK_NIGHT_FROST = "DARK_NIGHT_FROST";

/**
* The name of the theme key for "theme modes".
*
* @constant {string}
* @since 0.2.0
*/
const THEME_KEY_MODE = "mode";

export { MODE_BRIGHT_SNOW_FLURRY, MODE_DARK_NIGHT_FROST, THEME_KEY_MODE };
8 changes: 7 additions & 1 deletion src/styles/theme/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,14 @@
import globals from "./globals";
import normalize from "./normalize";
import typography from "./typography";
import { MODE_BRIGHT_SNOW_FLURRY, MODE_DARK_NIGHT_FROST, THEME_KEY_MODE } from "./constants";

const theme = { typography };
const theme = {
typography,
MODE_BRIGHT_SNOW_FLURRY,
MODE_DARK_NIGHT_FROST,
THEME_KEY_MODE
};

export { globals, normalize, typography };

Expand Down

0 comments on commit 687d30f

Please sign in to comment.