@atlaskit/tokens
Version:
Design tokens are the single source of truth to name and store design decisions.
34 lines (31 loc) • 815 B
JavaScript
import { fg } from '@atlaskit/platform-feature-flags';
/**
* Can't evaluate typography feature flags at the module level,
* it will always resolve to false when server side rendered or when flags are loaded async.
*/
function getShapeDefault() {
if (fg('platform-dst-shape-theme-default')) {
return 'shape';
}
return undefined;
}
function getMotionDefault() {
if (fg('platform-dst-motion-theme-default')) {
return 'motion';
}
return undefined;
}
/**
* themeStateDefaults: the default values for ThemeState used by theming utilities
*/
export var themeStateDefaults = {
colorMode: 'auto',
contrastMode: 'auto',
dark: 'dark',
light: 'light',
shape: getShapeDefault,
spacing: 'spacing',
typography: 'typography',
motion: getMotionDefault,
UNSAFE_themeOptions: undefined
};