diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index b6babc6eb..4b776a694 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -106,15 +106,13 @@ function init(options: InitOptions): OnboardAPI { connect, containerElements, transactionPreview, - theme, + theme = 'default', disableFontDownload, unstoppableResolution, chainsPolkadot, wcConfigOption } = options - - if (containerElements) updateConfiguration({ containerElements }) const { device, svelteInstance } = configuration diff --git a/packages/core/src/themes.ts b/packages/core/src/themes.ts index ea0663682..803e0175f 100644 --- a/packages/core/src/themes.ts +++ b/packages/core/src/themes.ts @@ -4,14 +4,14 @@ import type { BuiltInThemes, Theme, ThemingMap } from './types' export const themes = { default: { - '--w3o-background-color': 'unset', - '--w3o-foreground-color': 'unset', - '--w3o-text-color': 'unset', - '--w3o-border-color': 'unset', - '--w3o-action-color': 'unset', - '--w3o-border-radius': 'unset', + '--w3o-background-color': '#0C0C0C', + '--w3o-foreground-color': '#0C0C0C', + '--w3o-text-color': 'rgba(255, 255, 255, 0.8)', + '--w3o-border-color': '#212121', + '--w3o-action-color': '#252525', + '--w3o-border-radius': '16px', '--w3o-font-family': 'inherit', - '--w3o-background-color-item': 'inherit' + '--w3o-background-color-item': '#1A1A1A' }, light: { '--w3o-background-color': '#ffffff', diff --git a/packages/core/src/types.ts b/packages/core/src/types.ts index 7a3420076..86980bdd2 100644 --- a/packages/core/src/types.ts +++ b/packages/core/src/types.ts @@ -105,7 +105,8 @@ export type ThemingMap = { '--w3o-text-color'?: string '--w3o-border-color'?: string '--w3o-action-color'?: string - '--w3o-border-radius'?: string + '--w3o-border-radius'?: string, + '--w3o-background-color-item'?: string, } export interface ConnectOptions { autoSelect?: { label: string; disableModals: boolean, type : WalletState['type'] } diff --git a/packages/core/src/validation.ts b/packages/core/src/validation.ts index c2d0295a0..ac8560ec1 100644 --- a/packages/core/src/validation.ts +++ b/packages/core/src/validation.ts @@ -222,7 +222,8 @@ const themeMap = Joi.object({ '--w3o-text-color': Joi.string(), '--w3o-border-color': Joi.string(), '--w3o-action-color': Joi.string(), - '--w3o-border-radius': Joi.string() + '--w3o-border-radius': Joi.string(), + '--w3o-background-color-item': Joi.string() }) const presetTheme = Joi.string().valid('default', 'dark', 'light', 'system') diff --git a/packages/core/src/views/connect/ConnectingWallet.svelte b/packages/core/src/views/connect/ConnectingWallet.svelte index b930aaf7b..8cf933007 100644 --- a/packages/core/src/views/connect/ConnectingWallet.svelte +++ b/packages/core/src/views/connect/ConnectingWallet.svelte @@ -27,11 +27,11 @@ if(isOpen && modal && uri !== ''){ try{ await modal.openModal({ uri }); - }catch (e) { + } catch (e) { console.log(e) } - }else{ - modal.closeModal(); + } else { + modal?.closeModal(); } }) diff --git a/packages/core/src/views/connect/Index.svelte b/packages/core/src/views/connect/Index.svelte index e46d148ba..999b50326 100644 --- a/packages/core/src/views/connect/Index.svelte +++ b/packages/core/src/views/connect/Index.svelte @@ -87,7 +87,7 @@ if(isOpen && modal && uri !== ''){ modal.openModal({ uri }) }else{ - modal.closeModal(); + modal?.closeModal(); } })