/* * Copyright (c) 2018-present, Revolut LTD. * * This source code is licensed under the Apache 2.0 license found in the * LICENSE file in the root directory of this source tree. */ import { darken, lighten } from 'polished' import { SANS_SERIF, SERIF, SIZES, PADDING } from './constants' import { ColorsFields, FontFacesFields, FontSizesFields, ShadowsFields, ThemeFields, PaddingFields, } from './themeFields' import { BLUE, BRICK_RED, BUTTON_SHADOW, DARK_CYAN, DARK_GREY, DEEP_BLUE, GREEN, LIGHT_CYAN, LIGHT_GREY, LIGHTER_GREY, ROSE, WHITE, BLACK, BUTTON_BLUE, BUTTON_GROUP_SHADOW, SOFT_GREY, } from './colors' const colors = { [ColorsFields.Main]: DARK_CYAN, [ColorsFields.MainLight]: LIGHT_CYAN, [ColorsFields.Highlight]: ROSE, [ColorsFields.BackgroundMain]: WHITE, [ColorsFields.BackgroundOverlay]: BLACK, [ColorsFields.Border]: LIGHT_GREY, [ColorsFields.Primary]: BLUE, [ColorsFields.PrimaryDarken]: darken(0.1, BLUE), [ColorsFields.PrimaryLighten]: lighten(0.1, BLUE), [ColorsFields.Danger]: BRICK_RED, [ColorsFields.DangerDarken]: darken(0.1, BRICK_RED), [ColorsFields.DangerLighten]: lighten(0.1, BRICK_RED), [ColorsFields.Success]: GREEN, [ColorsFields.SuccessDarken]: darken(0.1, GREEN), [ColorsFields.SuccessLighten]: lighten(0.1, GREEN), [ColorsFields.Text]: DARK_GREY, [ColorsFields.TextInverted]: WHITE, [ColorsFields.TextSuccess]: darken(0.2, GREEN), [ColorsFields.TextDanger]: darken(0.2, BRICK_RED), [ColorsFields.TextInactive]: LIGHT_GREY, [ColorsFields.ControlNeutral]: LIGHTER_GREY, [ColorsFields.ControlActive]: DEEP_BLUE, [ColorsFields.Button]: BUTTON_BLUE, [ColorsFields.SelectedToggleButton]: BUTTON_BLUE, [ColorsFields.SelectedToggleText]: WHITE, [ColorsFields.LightText]: LIGHT_GREY, [ColorsFields.HoverLightBackground]: SOFT_GREY, } export type DefaultTheme = { [ThemeFields.Breakpoints]: number[] [ThemeFields.FontSizes]: { [K in FontSizesFields]: string } [ThemeFields.FontFaces]: { [K in FontFacesFields]: string } [ThemeFields.Colors]: { [K in ColorsFields]: string } [ThemeFields.Shadows]: { [K in ShadowsFields]: string } [ThemeFields.Padding]: { [K in PaddingFields]: string } } export const theme: DefaultTheme = { [ThemeFields.Breakpoints]: [32, 48, 64], [ThemeFields.FontSizes]: { [FontSizesFields.Smaller]: SIZES.SMALLER, [FontSizesFields.Small]: SIZES.SMALL, [FontSizesFields.Regular]: SIZES.REGULAR, [FontSizesFields.H3]: SIZES.H3, [FontSizesFields.H2]: SIZES.H2, [FontSizesFields.H1]: SIZES.H1, [FontSizesFields.Big]: SIZES.BIG, [FontSizesFields.Huge]: SIZES.HUGE, }, [ThemeFields.FontFaces]: { [FontFacesFields.Sans]: SANS_SERIF, [FontFacesFields.Serif]: SERIF, }, [ThemeFields.Colors]: colors, [ThemeFields.Shadows]: { [ShadowsFields.Button]: BUTTON_SHADOW, [ShadowsFields.ButtonGroupShadow]: BUTTON_GROUP_SHADOW, }, [ThemeFields.Padding]: { [PaddingFields.ButtonRegular]: PADDING.BUTTON_REGULAR, [PaddingFields.ButtonSmall]: PADDING.BUTTON_SMALL, }, }