Skip to content

frontend: prepare for responsive font-size #2708

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions frontends/web/src/components/guide/guide.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,9 @@
}

.content h2 {
font-size: 1.1em;
font-size: var(--size-subheader);
font-weight: 400;
line-height: 1.2em;
margin: 0px;
margin: 0;
}

.guide p {
Expand All @@ -104,6 +103,7 @@
.entryTitle .entryToggle {
align-items: center;
display: flex;
font-size: var(--size-subheader);
flex-direction: row;
font-weight: bold;
justify-content: flex-start;
Expand Down
2 changes: 1 addition & 1 deletion frontends/web/src/components/password.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
line-height: 42px;
position: absolute;
right: 0;
width: 2rem;
width: 32px;
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,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;
Expand Down
16 changes: 5 additions & 11 deletions frontends/web/src/components/terms/terms.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -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%;
Expand All @@ -30,19 +24,19 @@
padding: var(--space-quarter) 1em 1em 1em;
}

.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 {
Expand All @@ -51,7 +45,7 @@

.table table {
border-collapse: collapse;
font-size: .875rem;
font-size: 14px;
text-align: left;
}

Expand Down
2 changes: 1 addition & 1 deletion frontends/web/src/routes/account/add/add.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion frontends/web/src/routes/account/info/info.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
clear: both;
display: flex;
justify-content: space-between;
min-height: 3.5rem;
min-height: 56px;
}

.verifyButton {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/**
* Copyright 2023-2024 Shift Crypto AG
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { useTranslation } from 'react-i18next';
import { ISendTx } from '@/api/account';
import { Cancel, Checked } from '@/components/icon/icon';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@
}

.coinName img {
left: -2rem;
left: -32px;
position: absolute;
top: -3px;
}
Expand Down
14 changes: 7 additions & 7 deletions frontends/web/src/routes/account/summary/chart.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
}

.totalValue {
font-size: 2rem;
font-size: 32px;
display: flex;
align-items: flex-end;
}
Expand All @@ -87,8 +87,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 {
Expand All @@ -109,7 +109,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;
Expand All @@ -119,14 +119,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 {
Expand Down
11 changes: 11 additions & 0 deletions frontends/web/src/routes/account/summary/chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { PercentageDiff } from './percentage-diff';
import { Filters } from './filters';
import { getDarkmode } from '@/components/darkmode/darkmode';
import { DefaultCurrencyRotator } from '@/components/rates/rates';
import { RatesContext } from '@/contexts/RatesContext';
import { AppContext, TChartDisplay } from '@/contexts/AppContext';
import styles from './chart.module.css';

Expand Down Expand Up @@ -137,6 +138,7 @@ export const Chart = ({

const { t, i18n } = useTranslation();
const { chartDisplay, setChartDisplay } = useContext(AppContext);
const { defaultCurrency } = useContext(RatesContext);
const [searchParams] = useSearchParams();

const ref = useRef<HTMLDivElement>(null);
Expand All @@ -163,6 +165,15 @@ export const Chart = ({
toolTipTime: 0,
});

useEffect(() => {
setTooltipData({
toolTipVisible: false,
toolTipTop: 0,
toolTipLeft: 0,
toolTipTime: 0,
});
}, [defaultCurrency]);

const [showAnimationOverlay, setAnimationOverlay] = useState(true);

const prevChartDataDaily = usePrevious(data.chartDataDaily);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

.arrow img {
margin-right: .25rem;
margin-right: 4px;
vertical-align: text-bottom;
}

Expand All @@ -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;
}
5 changes: 0 additions & 5 deletions frontends/web/src/routes/bitsurance/account.module.css

This file was deleted.

2 changes: 1 addition & 1 deletion frontends/web/src/routes/device/bitbox01/check.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class Check extends Component {
onClose={this.abort}>
{ message ? (
<div>
<p style={{ minHeight: '3rem' }}>{message}</p>
<p style={{ minHeight: '48px' }}>{message}</p>
<div className={style.actions}>
<Button secondary onClick={this.abort}>
{t('button.back')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
}

.agreements {
margin-bottom: 1rem;
margin-bottom: 16px;
}

.emptyText {
Expand Down
2 changes: 1 addition & 1 deletion frontends/web/src/routes/exchange/exchange.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
}

.title {
font-size: 2rem;
font-size: 32px;
font-weight: 400;
margin-top: 0;
margin-bottom: var(--space-default);
Expand Down
5 changes: 0 additions & 5 deletions frontends/web/src/routes/exchange/info.module.css

This file was deleted.

12 changes: 6 additions & 6 deletions frontends/web/src/style/variables.css
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@
--color-error-border: rgba(227, 6, 19, .33);

/* font sizes */
--size-extra-large: 2.2rem;
--size-large: 2rem;
--size-large-mobile: 1.4rem;
--size-extra-large: 35px;
--size-large: 32px;
--size-large-mobile: 22px;
--size-subheader: 18px;
--size-medium: var(--size-default);
--size-default: 14px;
Expand All @@ -64,9 +64,9 @@
--size-wizard-text: 16px;

/* spacing */
--spacing-large: 2rem;
--spacing-default: 1rem;
--spacing-half: .5rem;
--spacing-large: 32px;
--spacing-default: 16px;
--spacing-half: 8px;

--space-large: 64px;
--space-default: 32px;
Expand Down