Skip to content

Commit cb73170

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 ac8c3a0 commit cb73170

File tree

13 files changed

+33
-39
lines changed

13 files changed

+33
-39
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,9 @@
8080
}
8181

8282
.content h2 {
83-
font-size: 1.1em;
83+
font-size: var(--size-subheader);
8484
font-weight: 400;
85-
line-height: 1.2em;
86-
margin: 0px;
85+
margin: 0;
8786
}
8887

8988
.guide p {
@@ -115,6 +114,7 @@
115114
.entryTitle .entryToggle {
116115
align-items: center;
117116
display: flex;
117+
font-size: var(--size-subheader);
118118
flex-direction: row;
119119
font-weight: bold;
120120
justify-content: flex-start;

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/pillbuttongroup/pillbuttongroup.module.css

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

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%;
@@ -30,19 +24,19 @@
3024
padding: var(--space-quarter) 1em 1em 1em;
3125
}
3226

33-
.disclaimer .title {
34-
font-size: .875rem;
27+
.title {
28+
font-size: 14px;
3529
font-weight: bold;
3630
text-align: left;
3731
}
3832

3933
.disclaimer p {
40-
font-size: .875rem;
34+
font-size: 14px;
4135
line-height: 1.5;
4236
}
4337

4438
.disclaimer p + .title {
45-
margin: 2.5rem 0 0 0;
39+
margin: 40px 0 0 0;
4640
}
4741

4842
.table {
@@ -51,7 +45,7 @@
5145

5246
.table table {
5347
border-collapse: collapse;
54-
font-size: .875rem;
48+
font-size: 14px;
5549
text-align: left;
5650
}
5751

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
@@ -33,7 +33,7 @@
3333
clear: both;
3434
display: flex;
3535
justify-content: space-between;
36-
min-height: 3.5rem;
36+
min-height: 56px;
3737
}
3838

3939
.verifyButton {

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: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
}
8383

8484
.totalValue {
85-
font-size: 2rem;
85+
font-size: 32px;
8686
display: flex;
8787
align-items: flex-end;
8888
}
@@ -91,8 +91,8 @@
9191
color: var(--color-secondary);
9292
display: inline-block;
9393
margin-bottom: 3px;
94-
font-size: 1.4rem;
95-
padding: 0 .25rem;
94+
font-size: 22px;
95+
padding: 0 4px;
9696
}
9797

9898
.chartCanvas {
@@ -113,7 +113,7 @@
113113
font-size: var(--size-small);
114114
margin-top: -25px;
115115
min-width: 140px;
116-
padding: .75rem .6rem;
116+
padding: 12px 10px;
117117
pointer-events: none;
118118
position: absolute;
119119
text-align: center;
@@ -123,14 +123,14 @@
123123

124124
.toolTipValue {
125125
font-weight: normal;
126-
font-size: 1rem;
127-
margin: 0 0 .25rem 0;
126+
font-size: 16px;
127+
margin: 0 0 4px 0;
128128
}
129129

130130
.toolTipUnit {
131131
color: var(--color-secondary);
132132
font-size: var(--size-small);
133-
padding: 0 .125rem;
133+
padding: 0 2px;
134134
}
135135

136136
.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/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)