UNPKG

@atlaskit/theme

Version:

Theme contains solutions for global theming, colors, and other useful mixins.

24 lines (23 loc) 716 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = getTheme; var _constants = require("../constants"); // Resolves the different types of theme objects in the current API function getTheme(props) { if (props && props.theme) { // Theme is the global Atlaskit theme if (_constants.CHANNEL in props.theme) { return props.theme[_constants.CHANNEL]; } // User has provided alternative modes else if ('mode' in props.theme && _constants.THEME_MODES.includes(props.theme.mode)) { return props.theme; } } // If format not supported (or no theme provided), return standard theme return { mode: _constants.DEFAULT_THEME_MODE }; }