Skip to content

Commit

Permalink
Implement basic configurations for motion related styles
Browse files Browse the repository at this point in the history
This commit implements some basic configurations for motion related
styles like animations inspired by "Material Designs" (1) great
documentations and guidelines about motion speed (2). This includes
values for speed like transition durations. It'll be used to set the
CSS transition for the base background and font color within the
`globals` CSS style module.

References:
  (1) https://material.io
  (2) https://material.io/design/motion/speed.html

GH-53
  • Loading branch information
arcticicestudio committed Dec 3, 2018
1 parent 244c758 commit c0e5f6f
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/styles/theme/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,18 @@

import colors, { nord, palettes } from "./colors";
import globals from "./globals";
import motion from "./motion";
import normalize from "./normalize";
import { themedMode, themedModeVariant } from "./utils";
import typography from "./typography";
import { MODE_BRIGHT_SNOW_FLURRY, MODE_DARK_NIGHT_FROST, THEME_KEY_MODE } from "./constants";

const theme = { colors, typography };
const theme = { colors, motion, typography };

export {
colors,
globals,
motion,
nord,
normalize,
palettes,
Expand Down
23 changes: 23 additions & 0 deletions src/styles/theme/motion/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* 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 motion related values like animations inspired by Material Design Guidelines.
* @author Arctic Ice Studio <[email protected]>
* @author Sven Greb <[email protected]>
* @see https://material.io/design/motion/speed.html
* @since 0.2.0
*/

import speed, { duration } from "./speed";

const motion = { speed };

export { speed, duration };
export default motion;
42 changes: 42 additions & 0 deletions src/styles/theme/motion/speed.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* 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 motion speed values.
* @author Arctic Ice Studio <[email protected]>
* @author Sven Greb <[email protected]>
* @see https://material.io/design/motion/speed.html
* @since 0.2.0
*/

/**
* The values for motion durations.
*
* @type {object}
* @see @see https://material.io/design/motion/speed.html#duration
* @since 0.2.0
*/
const duration = {
unit: "s",
transition: {
base: { themeModeSwitch: 0.4 },
area: { large: 0.4 }
}
};

/**
* The values for motion speed.
*
* @type {object}
* @since 0.2.0
*/
const speed = { duration };

export { duration };
export default speed;

0 comments on commit c0e5f6f

Please sign in to comment.