Commit ea015d16 authored by Moody Salem's avatar Moody Salem

Stop reloading fonts when light mode/dark mode switch

parent d40d81ca
...@@ -11,7 +11,7 @@ import ApplicationContextProvider, { Updater as ApplicationContextUpdater } from ...@@ -11,7 +11,7 @@ import ApplicationContextProvider, { Updater as ApplicationContextUpdater } from
import TransactionContextProvider, { Updater as TransactionContextUpdater } from './contexts/Transactions' import TransactionContextProvider, { Updater as TransactionContextUpdater } from './contexts/Transactions'
import BalancesContextProvider, { Updater as BalancesContextUpdater } from './contexts/Balances' import BalancesContextProvider, { Updater as BalancesContextUpdater } from './contexts/Balances'
import App from './pages/App' import App from './pages/App'
import ThemeProvider, { GlobalStyle } from './theme' import ThemeProvider, { FixedGlobalStyle, ThemedGlobalStyle } from './theme'
import './i18n' import './i18n'
const Web3ProviderNetwork = createWeb3ReactRoot(NetworkContextName) const Web3ProviderNetwork = createWeb3ReactRoot(NetworkContextName)
...@@ -57,18 +57,21 @@ function Updaters() { ...@@ -57,18 +57,21 @@ function Updaters() {
} }
ReactDOM.render( ReactDOM.render(
<>
<FixedGlobalStyle />
<Web3ReactProvider getLibrary={getLibrary}> <Web3ReactProvider getLibrary={getLibrary}>
<Web3ProviderNetwork getLibrary={getLibrary}> <Web3ProviderNetwork getLibrary={getLibrary}>
<ContextProviders> <ContextProviders>
<Updaters /> <Updaters />
<ThemeProvider> <ThemeProvider>
<> <>
<GlobalStyle /> <ThemedGlobalStyle />
<App /> <App />
</> </>
</ThemeProvider> </ThemeProvider>
</ContextProviders> </ContextProviders>
</Web3ProviderNetwork> </Web3ProviderNetwork>
</Web3ReactProvider>, </Web3ReactProvider>
</>,
document.getElementById('root') document.getElementById('root')
) )
...@@ -178,7 +178,7 @@ export const TYPE = { ...@@ -178,7 +178,7 @@ export const TYPE = {
} }
} }
export const GlobalStyle = createGlobalStyle` export const FixedGlobalStyle = createGlobalStyle`
@import url('https://rsms.me/inter/inter.css'); @import url('https://rsms.me/inter/inter.css');
html { font-family: 'Inter', sans-serif; letter-spacing: -0.018em;} html { font-family: 'Inter', sans-serif; letter-spacing: -0.018em;}
@supports (font-variation-settings: normal) { @supports (font-variation-settings: normal) {
...@@ -203,10 +203,15 @@ body > div { ...@@ -203,10 +203,15 @@ body > div {
html { html {
font-size: 16px; font-size: 16px;
font-variant: none; font-variant: none;
color: ${({ theme }) => theme.text1};
background-color: ${({ theme }) => theme.bg2};
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
} }
` `
export const ThemedGlobalStyle = createGlobalStyle`
html {
color: ${({ theme }) => theme.text1};
background-color: ${({ theme }) => theme.bg2};
}
`
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment