Skip to content

Commit

Permalink
Refactor: dynamic wallet css overrides for non shadow dom
Browse files Browse the repository at this point in the history
  • Loading branch information
rdig committed Jan 29, 2025
1 parent 609b172 commit d13a035
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
7 changes: 7 additions & 0 deletions src/Entry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ const Entry = ({ store }: Props) => {
label: 'Recommended',
},
],
// Since we can't use the shadow Dom override for css styling, since that breaks the skeleton loader
// we have to resort to this method to override the css, which is very verbose
cssOverrides: isDarkMode ? (
<link rel="stylesheet" href="/src/styles/dynamicOverridesDark.css" />
) : (
<link rel="stylesheet" href="/src/styles/dynamicOverridesLight.css" />
),
overrides: {
evmNetworks: (networks) => {
// Only needed for embedded wallets
Expand Down
3 changes: 3 additions & 0 deletions src/styles/dynamicOverridesDark.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.badge__container__primary {
background-color: var(--dynamic-badge-dot-background) !important;
}
4 changes: 4 additions & 0 deletions src/styles/dynamicOverridesLight.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.badge__container__primary {
/* stylelint-disable-next-line color-no-hex */
background-color: #eff8ff !important;
}
13 changes: 0 additions & 13 deletions src/styles/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -124,16 +124,3 @@ body.ReactModal__Body--open:not(.show-header-in-modal) .modal-blur-navigation {
/* trezor wallet select modal */
--onboard-account-select-modal-z-index: 10000 !important;
}

body .dynamic-modal .badge__container__primary {
/* stylelint-disable-next-line color-no-hex */
background-color: #eff8ff !important;
}

body[data-dynamic-theme='dark'] .dynamic-modal .badge__container__primary {
background-color: var(--dynamic-badge-dot-background) !important;
}

body .dynamic-modal .divider {
border-color: transparent !important;
}

0 comments on commit d13a035

Please sign in to comment.