Skip to content

Commit f3420e7

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 c6aeea8 commit f3420e7

File tree

12 files changed

+32
-38
lines changed

12 files changed

+32
-38
lines changed

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

Lines changed: 1 addition & 1 deletion
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/terms/terms.module.css

Lines changed: 5 additions & 11 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
appearance: none;
7373
background: var(--background-secondary);
7474
border: 2px solid var(--background-secondary);
75-
border-radius: 2rem;
75+
border-radius: 32px;
7676
color: var(--color-default);
7777
font-size: var(--size-default);
7878
line-height: 1.75;
@@ -117,7 +117,7 @@
117117

118118

119119
.totalValue {
120-
font-size: 2rem;
120+
font-size: 32px;
121121
display: flex;
122122
align-items: flex-end;
123123
}
@@ -126,8 +126,8 @@
126126
color: var(--color-secondary);
127127
display: inline-block;
128128
margin-bottom: 3px;
129-
font-size: 1.4rem;
130-
padding: 0 .25rem;
129+
font-size: 22px;
130+
padding: 0 4px;
131131
}
132132

133133
.chartCanvas {
@@ -149,7 +149,7 @@
149149
font-size: var(--size-small);
150150
margin-top: -25px;
151151
min-width: 140px;
152-
padding: .75rem .6rem;
152+
padding: 12px 10px;
153153
pointer-events: none;
154154
position: absolute;
155155
text-align: center;
@@ -159,14 +159,14 @@
159159

160160
.toolTipValue {
161161
font-weight: normal;
162-
font-size: 1rem;
163-
margin: 0 0 .25rem 0;
162+
font-size: 16px;
163+
margin: 0 0 4px 0;
164164
}
165165

166166
.toolTipUnit {
167167
color: var(--color-secondary);
168168
font-size: var(--size-small);
169-
padding: 0 .125rem;
169+
padding: 0 2px;
170170
}
171171

172172
.toolTipTime {

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

Lines changed: 4 additions & 4 deletions
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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
}
8080

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

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

Lines changed: 1 addition & 1 deletion
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')}

0 commit comments

Comments
 (0)