From d654980acea9db0e82bc2a14041fcf5f2a198e89 Mon Sep 17 00:00:00 2001 From: thisconnect Date: Thu, 9 May 2024 11:06:05 +0200 Subject: [PATCH 01/10] frontend: remove unused css files Seems as these files are not imported anywhere. --- frontends/web/src/routes/bitsurance/account.module.css | 5 ----- frontends/web/src/routes/buy/info.module.css | 5 ----- 2 files changed, 10 deletions(-) delete mode 100644 frontends/web/src/routes/bitsurance/account.module.css delete mode 100644 frontends/web/src/routes/buy/info.module.css diff --git a/frontends/web/src/routes/bitsurance/account.module.css b/frontends/web/src/routes/bitsurance/account.module.css deleted file mode 100644 index 3af60ceb6b..0000000000 --- a/frontends/web/src/routes/bitsurance/account.module.css +++ /dev/null @@ -1,5 +0,0 @@ -.title { - font-size: 2rem; - font-weight: 400; - text-align: center; -} diff --git a/frontends/web/src/routes/buy/info.module.css b/frontends/web/src/routes/buy/info.module.css deleted file mode 100644 index 3af60ceb6b..0000000000 --- a/frontends/web/src/routes/buy/info.module.css +++ /dev/null @@ -1,5 +0,0 @@ -.title { - font-size: 2rem; - font-weight: 400; - text-align: center; -} From c6aeea8967bb9586a97e17d289ecc28ca113a38e Mon Sep 17 00:00:00 2001 From: thisconnect Date: Thu, 9 May 2024 11:16:56 +0200 Subject: [PATCH 02/10] frontend: cleanup imports Small cleanup: - import from same utils module - group imports from api - import styles last --- frontends/web/src/routes/account/account.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/frontends/web/src/routes/account/account.tsx b/frontends/web/src/routes/account/account.tsx index 9a0f411780..f5511de51a 100644 --- a/frontends/web/src/routes/account/account.tsx +++ b/frontends/web/src/routes/account/account.tsx @@ -23,6 +23,7 @@ import { statusChanged, syncAddressesCount, syncdone } from '../../api/accountsy import { bitsuranceLookup } from '../../api/bitsurance'; import { TDevices } from '../../api/devices'; import { getExchangeBuySupported, SupportedExchanges } from '../../api/exchanges'; +import { useLoad } from '../../hooks/api'; import { useSDCard } from '../../hooks/sdcard'; import { unsubscribe } from '../../utils/subscriptions'; import { alertUser } from '../../components/alert/Alert'; @@ -33,20 +34,18 @@ import { Header } from '../../components/layout'; import { Spinner } from '../../components/spinner/Spinner'; import { Status } from '../../components/status/status'; import { Transactions } from '../../components/transactions/transactions'; -import { useLoad } from '../../hooks/api'; import { HideAmountsButton } from '../../components/hideamountsbutton/hideamountsbutton'; -import style from './account.module.css'; import { ActionButtons } from './actionButtons'; import { Insured } from './components/insuredtag'; import { AccountGuide } from './guide'; import { BuyReceiveCTA } from './info/buyReceiveCTA'; -import { isBitcoinBased } from './utils'; -import { getScriptName } from './utils'; +import { getScriptName, isBitcoinBased } from './utils'; import { MultilineMarkup } from '../../utils/markup'; import { Dialog } from '../../components/dialog/dialog'; import { A } from '../../components/anchor/anchor'; import { getConfig, setConfig } from '../../utils/config'; import { i18n } from '../../i18n/i18n'; +import style from './account.module.css'; type Props = { accounts: accountApi.IAccount[]; From f3420e7c5a56eaf78582c9cda615f8226d87b48a Mon Sep 17 00:00:00 2001 From: thisconnect Date: Thu, 9 May 2024 11:37:13 +0200 Subject: [PATCH 03/10] frontend: prepare for responsive font-size In order to change the CSS to change the codebase to use rem, using 'The 62.5% Font Size Trick' we need to first convert all existing rem units back to px. This is so that we don't accidentally already have rem values. If the default base font size is 16px, 1rem equals 16px. Changing back to pixel first makes it much easier to use the 62.5% trick where 1rem = 10px. This refactoring should not introduce any visual change and just converted rem to px. I.e. 1.5rem is now 24px as 1rem currently equals 16px. Also simplified terms.module.css a bit as the title was defined multiple times. --- frontends/web/src/components/password.module.css | 2 +- .../web/src/components/terms/terms.module.css | 16 +++++----------- .../web/src/routes/account/add/add.module.css | 2 +- .../web/src/routes/account/info/info.module.css | 2 +- .../components/dialogs/message-wait-dialog.tsx | 4 ++-- .../account/summary/accountssummary.module.css | 2 +- .../src/routes/account/summary/chart.module.css | 16 ++++++++-------- .../account/summary/percentage-diff.module.css | 8 ++++---- frontends/web/src/routes/buy/exchange.module.css | 2 +- .../web/src/routes/device/bitbox01/check.jsx | 2 +- .../routes/device/components/backups.module.css | 2 +- frontends/web/src/style/variables.css | 12 ++++++------ 12 files changed, 32 insertions(+), 38 deletions(-) diff --git a/frontends/web/src/components/password.module.css b/frontends/web/src/components/password.module.css index 313232864d..09fda96a40 100644 --- a/frontends/web/src/components/password.module.css +++ b/frontends/web/src/components/password.module.css @@ -4,5 +4,5 @@ line-height: 42px; position: absolute; right: 0; - width: 2rem; + width: 32px; } diff --git a/frontends/web/src/components/terms/terms.module.css b/frontends/web/src/components/terms/terms.module.css index 262e260e65..e72bbe7998 100644 --- a/frontends/web/src/components/terms/terms.module.css +++ b/frontends/web/src/components/terms/terms.module.css @@ -12,12 +12,6 @@ width: 100%; } -.title { - font-size: 2rem; - font-weight: 400; - text-align: center; -} - .disclaimer { background-color: var(--background-secondary); flex-basis: 100%; @@ -34,19 +28,19 @@ background-color: #fff; } -.disclaimer .title { - font-size: .875rem; +.title { + font-size: 14px; font-weight: bold; text-align: left; } .disclaimer p { - font-size: .875rem; + font-size: 14px; line-height: 1.5; } .disclaimer p + .title { - margin: 2.5rem 0 0 0; + margin: 40px 0 0 0; } .table { @@ -55,7 +49,7 @@ .table table { border-collapse: collapse; - font-size: .875rem; + font-size: 14px; text-align: left; } diff --git a/frontends/web/src/routes/account/add/add.module.css b/frontends/web/src/routes/account/add/add.module.css index 36a29ff564..7f432eac6c 100644 --- a/frontends/web/src/routes/account/add/add.module.css +++ b/frontends/web/src/routes/account/add/add.module.css @@ -13,7 +13,7 @@ .successCheck { background-color: var(--color-success); - border: .5rem solid var(--color-success); + border: 8px solid var(--color-success); border-radius: 100px; } diff --git a/frontends/web/src/routes/account/info/info.module.css b/frontends/web/src/routes/account/info/info.module.css index f6981d2b2e..6b7419f542 100644 --- a/frontends/web/src/routes/account/info/info.module.css +++ b/frontends/web/src/routes/account/info/info.module.css @@ -36,7 +36,7 @@ clear: both; display: flex; justify-content: space-between; - min-height: 3.5rem; + min-height: 56px; } .verifyButton { diff --git a/frontends/web/src/routes/account/send/components/dialogs/message-wait-dialog.tsx b/frontends/web/src/routes/account/send/components/dialogs/message-wait-dialog.tsx index 132d6b6340..cddb08db5a 100644 --- a/frontends/web/src/routes/account/send/components/dialogs/message-wait-dialog.tsx +++ b/frontends/web/src/routes/account/send/components/dialogs/message-wait-dialog.tsx @@ -31,14 +31,14 @@ const IconAndMessage = ({ messageType }: TIconProps) => { case 'sent': return ( <> - + {t('send.success')} ); case 'abort': return ( <> - + {t('send.abort')} ); diff --git a/frontends/web/src/routes/account/summary/accountssummary.module.css b/frontends/web/src/routes/account/summary/accountssummary.module.css index 167bf659e9..75ee00f466 100644 --- a/frontends/web/src/routes/account/summary/accountssummary.module.css +++ b/frontends/web/src/routes/account/summary/accountssummary.module.css @@ -193,7 +193,7 @@ } .coinName img { - left: -2rem; + left: -32px; position: absolute; top: -3px; } diff --git a/frontends/web/src/routes/account/summary/chart.module.css b/frontends/web/src/routes/account/summary/chart.module.css index 5616af273f..456afd33b4 100644 --- a/frontends/web/src/routes/account/summary/chart.module.css +++ b/frontends/web/src/routes/account/summary/chart.module.css @@ -72,7 +72,7 @@ appearance: none; background: var(--background-secondary); border: 2px solid var(--background-secondary); - border-radius: 2rem; + border-radius: 32px; color: var(--color-default); font-size: var(--size-default); line-height: 1.75; @@ -117,7 +117,7 @@ .totalValue { - font-size: 2rem; + font-size: 32px; display: flex; align-items: flex-end; } @@ -126,8 +126,8 @@ color: var(--color-secondary); display: inline-block; margin-bottom: 3px; - font-size: 1.4rem; - padding: 0 .25rem; + font-size: 22px; + padding: 0 4px; } .chartCanvas { @@ -149,7 +149,7 @@ font-size: var(--size-small); margin-top: -25px; min-width: 140px; - padding: .75rem .6rem; + padding: 12px 10px; pointer-events: none; position: absolute; text-align: center; @@ -159,14 +159,14 @@ .toolTipValue { font-weight: normal; - font-size: 1rem; - margin: 0 0 .25rem 0; + font-size: 16px; + margin: 0 0 4px 0; } .toolTipUnit { color: var(--color-secondary); font-size: var(--size-small); - padding: 0 .125rem; + padding: 0 2px; } .toolTipTime { diff --git a/frontends/web/src/routes/account/summary/percentage-diff.module.css b/frontends/web/src/routes/account/summary/percentage-diff.module.css index fb032d8493..d4380296b2 100644 --- a/frontends/web/src/routes/account/summary/percentage-diff.module.css +++ b/frontends/web/src/routes/account/summary/percentage-diff.module.css @@ -1,6 +1,6 @@ .arrow img { - margin-right: .25rem; + margin-right: 4px; vertical-align: text-bottom; } @@ -13,10 +13,10 @@ } .diffValue { - font-size: 1.2rem; + font-size: 19px; } .diffUnit { - font-size: 1rem; - padding: 0 .25rem; + font-size: 16px; + padding: 0 4px; } diff --git a/frontends/web/src/routes/buy/exchange.module.css b/frontends/web/src/routes/buy/exchange.module.css index 9939e128d5..e305ccfa95 100644 --- a/frontends/web/src/routes/buy/exchange.module.css +++ b/frontends/web/src/routes/buy/exchange.module.css @@ -79,7 +79,7 @@ } .title { - font-size: 2rem; + font-size: 32px; font-weight: 400; margin-top: 0; margin-bottom: var(--space-default); diff --git a/frontends/web/src/routes/device/bitbox01/check.jsx b/frontends/web/src/routes/device/bitbox01/check.jsx index f34a14270d..c829018178 100644 --- a/frontends/web/src/routes/device/bitbox01/check.jsx +++ b/frontends/web/src/routes/device/bitbox01/check.jsx @@ -99,7 +99,7 @@ class Check extends Component { onClose={this.abort}> { message ? (
-

{message}

+

{message}

)}
From 6d90bf6c6a70db26fb6c61f0cd09365b5e2bc719 Mon Sep 17 00:00:00 2001 From: thisconnect Date: Thu, 9 May 2024 12:24:39 +0200 Subject: [PATCH 10/10] frontend: style sidebar to be responsive Sidebar does not need to grow, as it works well if the font size is renderd at 200%. Changing back to px. --- frontends/web/src/components/sidebar/sidebar.module.css | 8 ++++---- frontends/web/src/style/layout.css | 1 + frontends/web/src/style/variables.css | 8 ++++---- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/frontends/web/src/components/sidebar/sidebar.module.css b/frontends/web/src/components/sidebar/sidebar.module.css index 05a8dd4c96..030e7c3211 100644 --- a/frontends/web/src/components/sidebar/sidebar.module.css +++ b/frontends/web/src/components/sidebar/sidebar.module.css @@ -113,9 +113,8 @@ cursor: default; display: flex; flex-direction: row; - height: var(--sidebar-item-height); + min-height: var(--sidebar-item-height); justify-content: center; - overflow: hidden; position: relative; text-decoration: none; } @@ -166,6 +165,7 @@ a.sidebarActive :global(.stacked) img:last-child, .single img { opacity: .6; transition: opacity 0.2s ease; + vertical-align: top; } a.sidebarActive .single img, @@ -179,10 +179,10 @@ a.sidebarActive .single img, line-height: 1; flex: 1; padding-top: 0; - padding-right: var(--space-default); + padding-right: 16px; font-size: var(--size-default); font-weight: 400; - transition: all 0.2s ease; + /* transition: all 0.2s ease; /* TODO: why all, what is this even supposed to be transitioning */ word-break: break-word; } diff --git a/frontends/web/src/style/layout.css b/frontends/web/src/style/layout.css index b2558881b1..1fa1a1134f 100644 --- a/frontends/web/src/style/layout.css +++ b/frontends/web/src/style/layout.css @@ -358,6 +358,7 @@ .stacked img { transition: opacity 0.2s ease; + vertical-align: top; } .stacked img:last-child { diff --git a/frontends/web/src/style/variables.css b/frontends/web/src/style/variables.css index 978ff60928..875ae5d553 100644 --- a/frontends/web/src/style/variables.css +++ b/frontends/web/src/style/variables.css @@ -74,10 +74,10 @@ /* sidebar */ --sidebar-width-large: 250px; - --sidebar-margin: 3.2rem; - --sidebar-item-height: 5.2rem; - --sidebar-icon-margin: 1.4rem; - --sidebar-icon-size: 2.4rem; + --sidebar-margin: 32px; + --sidebar-item-height: 52px; + --sidebar-icon-margin: 14px; + --sidebar-icon-size: 24px; --sidebar-header-size: 1.2rem; --sidebar-header-line-height: 1.6rem;