* Inject theme using styled-components' ThemeProvider (#3) * Apply colors from design, styles refactoring (#5) * Add new tip and accounts screen without accounts (#7) * Sync with upstream (#10) * Use Nunito font (#11) * Create account first page (#14) * Customizable identicon (#13) * Inline buttons (#16) * Welcome screen styling (#17) * Account creation second step (#15) * Add new header (#20) * change welcome screen (#19) * Account screen (#18) * Update from upstream (#21) * Window title (#25) * New authorize (#24) * Refactor and remove unnecessary stuff from theme (#22) * refactor add accounts screen (#29) * Export and forget screens, change general padding to 24px (#27) * Signing screen (#26) * Import account screens (#31) * Change header with settings (#28) * Refactor button and mnemonic (#30) * Restyle checkbox (#33) * Remove opacity from background; add borders (#32) * Code style polishing (#34) * Move fileMock to __mocks__ (#35) * Add light theme (#36) * Small design changes (#38) * Change background color (#39) * Sync with upstream (#41) * Update screenshots in readme * [CI Skip] 0.14.0-beta.7 skip-checks: true * fix error for display menu (#42) * fix display of authorization (#43) * firefox scrol (#45) * small change for rename account (#44) * Sync with upstream * Print and back button (#48) * delete print button and change cancel to back button * Set body color (#49) * Fix the fix of account rename (#52) * Update generic sign screen (#47) * Improve UI/UX design (#53) * [CI Skip] 0.14.0-beta.10 skip-checks: true * Improve QR code recognition on dark theme (#54) * Add proper tx/sign texts and headers (#55) Co-authored-by: Kamil Dąbrowski <kamil@ethworks.io>
86 lines
2.4 KiB
TypeScript
86 lines
2.4 KiB
TypeScript
// Copyright 2019 @polkadot/extension-ui authors & contributors
|
|
// This software may be modified and distributed under the terms
|
|
// of the Apache-2.0 license. See the LICENSE file for details.
|
|
|
|
const darkTheme = {
|
|
id: 'dark',
|
|
background: '#26272C',
|
|
bodyColor: '#20222A',
|
|
highlightedAreaBackground: '#212226',
|
|
popupBackground: '#38393F',
|
|
accountBackground: '#1A1B20',
|
|
buttonBackground: '#E86F00',
|
|
buttonBackgroundHover: '#ED9329',
|
|
buttonBackgroundDanger: '#AF1111',
|
|
buttonBackgroundDangerHover: '#D93B3B',
|
|
buttonTextColor: '#FFFFFF',
|
|
textColor: '#FFFFFF',
|
|
subTextColor: '#DDD',
|
|
textColorDanger: '#FF8686',
|
|
errorBorderColor: '#7E3530',
|
|
errorColor: '#E42F2F',
|
|
primaryColor: '#FF7D01',
|
|
inputBackground: '#111218',
|
|
inputBorderColor: '#43444B',
|
|
readonlyInputBackground: '#1A1B20',
|
|
boxBorderColor: '#43444B',
|
|
identiconBackground: '#F4F5F8',
|
|
accountDotsIconColor: '#8E8E8E',
|
|
iconWarningColor: '#FF7D01',
|
|
iconDangerColor: '#AF1111',
|
|
iconNeutralColor: '#8E8E8E',
|
|
labelColor: '#9F9E99',
|
|
addAccountImageBackground: '#1A1B20',
|
|
boxShadow: 'rgba(0, 0, 0, 0.86)',
|
|
fontFamily: 'Nunito, sans-serif',
|
|
fontSize: '16px',
|
|
lineHeight: '26px',
|
|
labelFontSize: '13px',
|
|
labelLineHeight: '18px',
|
|
borderRadius: '4px',
|
|
boxMargin: '0.75rem 0',
|
|
boxPadding: '0 0.25rem'
|
|
};
|
|
|
|
const lightTheme: Theme = {
|
|
...darkTheme,
|
|
id: 'light',
|
|
background: '#FAFAFA',
|
|
bodyColor: '#FFFFFF',
|
|
highlightedAreaBackground: '#EFEFEF',
|
|
accountBackground: '#FFFFFF',
|
|
popupBackground: '#FFFFFF',
|
|
textColor: '#242529',
|
|
subTextColor: '#454545',
|
|
errorBorderColor: '#E42F2F',
|
|
textColorDanger: '#F24A4A',
|
|
buttonBackgroundDanger: '#DC2222',
|
|
iconDangerColor: '#DC2222',
|
|
inputBackground: '#FFFFFF',
|
|
inputBorderColor: '#DDE1EB',
|
|
readonlyInputBackground: '#FFF',
|
|
boxBorderColor: '#DADFEA',
|
|
iconNeutralColor: '#939CB1',
|
|
labelColor: '#333333',
|
|
addAccountImageBackground: '#FFF',
|
|
boxShadow: 'rgba(0, 0, 0, 0.06)'
|
|
};
|
|
|
|
export function chooseTheme (): AvailableThemes {
|
|
const preferredTheme = localStorage.getItem('theme');
|
|
if (preferredTheme) {
|
|
return preferredTheme === 'dark' ? 'dark' : 'light';
|
|
}
|
|
const isLightColorSchemePreferred = window.matchMedia && window.matchMedia('(prefers-color-scheme: light)').matches;
|
|
return isLightColorSchemePreferred ? 'light' : 'dark';
|
|
}
|
|
|
|
export declare type Theme = typeof darkTheme;
|
|
|
|
export const themes = {
|
|
dark: darkTheme,
|
|
light: lightTheme
|
|
};
|
|
|
|
export declare type AvailableThemes = keyof typeof themes;
|