Skip to content

Commit 6b8d1a0

Browse files
committed
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.
1 parent c722b58 commit 6b8d1a0

File tree

14 files changed

+34
-40
lines changed

14 files changed

+34
-40
lines changed

frontends/web/src/components/guide/guide.module.css

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,7 @@
6969

7070
.content h2 {
7171
margin: 0px;
72-
font-size: 1.1em;
73-
line-height: 1.2em;
72+
font-size: var(--size-subheader);
7473
font-weight: 400;
7574
}
7675

@@ -99,6 +98,7 @@
9998
width: 16px;
10099
line-height: 1.2em;
101100
display: flex;
101+
font-size: var(--size-subheader);
102102
flex-direction: row;
103103
justify-content: flex-start;
104104
align-items: center;

frontends/web/src/components/password.module.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
line-height: 42px;
55
position: absolute;
66
right: 0;
7-
width: 2rem;
7+
width: 32px;
88
}

frontends/web/src/components/pillbuttongroup/pillbuttongroup.module.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
appearance: none;
1010
background: var(--background-secondary);
1111
border: 2px solid var(--background-secondary);
12-
border-radius: 2rem;
12+
border-radius: 32px;
1313
color: var(--color-default);
1414
font-size: var(--size-default);
1515
line-height: 1.75;

frontends/web/src/components/terms/terms.module.css

+5-11
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,6 @@
1212
width: 100%;
1313
}
1414

15-
.title {
16-
font-size: 2rem;
17-
font-weight: 400;
18-
text-align: center;
19-
}
20-
2115
.disclaimer {
2216
background-color: var(--background-secondary);
2317
flex-basis: 100%;
@@ -34,19 +28,19 @@
3428
background-color: #fff;
3529
}
3630

37-
.disclaimer .title {
38-
font-size: .875rem;
31+
.title {
32+
font-size: 14px;
3933
font-weight: bold;
4034
text-align: left;
4135
}
4236

4337
.disclaimer p {
44-
font-size: .875rem;
38+
font-size: 14px;
4539
line-height: 1.5;
4640
}
4741

4842
.disclaimer p + .title {
49-
margin: 2.5rem 0 0 0;
43+
margin: 40px 0 0 0;
5044
}
5145

5246
.table {
@@ -55,7 +49,7 @@
5549

5650
.table table {
5751
border-collapse: collapse;
58-
font-size: .875rem;
52+
font-size: 14px;
5953
text-align: left;
6054
}
6155

frontends/web/src/routes/account/add/add.module.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
.successCheck {
1515
background-color: var(--color-success);
16-
border: .5rem solid var(--color-success);
16+
border: 8px solid var(--color-success);
1717
border-radius: 100px;
1818
}
1919

frontends/web/src/routes/account/info/info.module.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
clear: both;
3737
display: flex;
3838
justify-content: space-between;
39-
min-height: 3.5rem;
39+
min-height: 56px;
4040
}
4141

4242
.verifyButton {

frontends/web/src/routes/account/send/components/dialogs/message-wait-dialog.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ const IconAndMessage = ({ messageType }: TIconProps) => {
3131
case 'sent':
3232
return (
3333
<>
34-
<Checked style={{ height: 18, marginRight: '1rem' }} />
34+
<Checked style={{ height: 18, marginRight: '16px' }} />
3535
{t('send.success')}
3636
</>
3737
);
3838
case 'abort':
3939
return (
4040
<>
41-
<Cancel alt="Abort" style={{ height: 18, marginRight: '1rem' }} />
41+
<Cancel alt="Abort" style={{ height: 18, marginRight: '16px' }} />
4242
{t('send.abort')}
4343
</>
4444
);

frontends/web/src/routes/account/summary/accountssummary.module.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@
193193
}
194194

195195
.coinName img {
196-
left: -2rem;
196+
left: -32px;
197197
position: absolute;
198198
top: -3px;
199199
}

frontends/web/src/routes/account/summary/chart.module.css

+7-7
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
}
6565

6666
.totalValue {
67-
font-size: 2rem;
67+
font-size: 32px;
6868
display: flex;
6969
align-items: flex-end;
7070
}
@@ -73,8 +73,8 @@
7373
color: var(--color-secondary);
7474
display: inline-block;
7575
margin-bottom: 3px;
76-
font-size: 1.4rem;
77-
padding: 0 .25rem;
76+
font-size: 22px;
77+
padding: 0 4px;
7878
}
7979

8080
.chartCanvas {
@@ -95,7 +95,7 @@
9595
font-size: var(--size-small);
9696
margin-top: -25px;
9797
min-width: 140px;
98-
padding: .75rem .6rem;
98+
padding: 12px 10px;
9999
pointer-events: none;
100100
position: absolute;
101101
text-align: center;
@@ -105,14 +105,14 @@
105105

106106
.toolTipValue {
107107
font-weight: normal;
108-
font-size: 1rem;
109-
margin: 0 0 .25rem 0;
108+
font-size: 16px;
109+
margin: 0 0 4px 0;
110110
}
111111

112112
.toolTipUnit {
113113
color: var(--color-secondary);
114114
font-size: var(--size-small);
115-
padding: 0 .125rem;
115+
padding: 0 2px;
116116
}
117117

118118
.toolTipTime {

frontends/web/src/routes/account/summary/percentage-diff.module.css

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
.arrow img {
3-
margin-right: .25rem;
3+
margin-right: 4px;
44
vertical-align: text-bottom;
55
}
66

@@ -13,10 +13,10 @@
1313
}
1414

1515
.diffValue {
16-
font-size: 1.2rem;
16+
font-size: 19px;
1717
}
1818

1919
.diffUnit {
20-
font-size: 1rem;
21-
padding: 0 .25rem;
20+
font-size: 16px;
21+
padding: 0 4px;
2222
}

frontends/web/src/routes/buy/exchange.module.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
}
8181

8282
.title {
83-
font-size: 2rem;
83+
font-size: 32px;
8484
font-weight: 400;
8585
margin-top: 0;
8686
margin-bottom: var(--space-default);

frontends/web/src/routes/device/bitbox01/check.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ class Check extends Component {
9999
onClose={this.abort}>
100100
{ message ? (
101101
<div>
102-
<p style={{ minHeight: '3rem' }}>{message}</p>
102+
<p style={{ minHeight: '48px' }}>{message}</p>
103103
<div className={style.actions}>
104104
<Button secondary onClick={this.abort}>
105105
{t('button.back')}

frontends/web/src/routes/device/components/backups.module.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
}
3737

3838
.agreements {
39-
margin-bottom: 1rem;
39+
margin-bottom: 16px;
4040
}
4141

4242
.emptyText {

frontends/web/src/style/variables.css

+6-6
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@
3737
--color-danger: var(--color-error);
3838

3939
/* font sizes */
40-
--size-extra-large: 2.2rem;
41-
--size-large: 2rem;
42-
--size-large-mobile: 1.4rem;
40+
--size-extra-large: 35px;
41+
--size-large: 32px;
42+
--size-large-mobile: 22px;
4343
--size-subheader: 18px;
4444
--size-medium: var(--size-default);
4545
--size-default: 14px;
@@ -53,9 +53,9 @@
5353
--size-wizard-text: 16px;
5454

5555
/* spacing */
56-
--spacing-large: 2rem;
57-
--spacing-default: 1rem;
58-
--spacing-half: .5rem;
56+
--spacing-large: 32px;
57+
--spacing-default: 16px;
58+
--spacing-half: 8px;
5959

6060
--space-large: 64px;
6161
--space-default: 32px;

0 commit comments

Comments
 (0)