Skip to content

Commit d9da08d

Browse files
committed
frontend: implement responsive font-size using 62.5% trick
Set html { font-size: 62.5%; } to make 1rem = 10px for easier responsive calculations. Convert all hardcoded px font-sizes to rem units throughout the codebase. This enables easier responsive font scaling by allowing components to scale proportionally when the root font-size changes for different screen sizes or user preferences. Conversions: - 10px → 1.0rem - 11px → 1.1rem - 12px → 1.2rem - 14px → 1.4rem - 16px → 1.6rem - 18px → 1.8rem - 19px → 1.9rem - 20px → 2.0rem - 22px → 2.2rem - 24px → 2.4rem - 32px → 3.2rem - 35px → 3.5rem This follows the standard '62.5% Font Size Trick' pattern where setting the root font-size to 62.5% (of browser default 16px) makes 1rem equal to 10px, simplifying rem-to-pixel mental math.
1 parent a4ea9f9 commit d9da08d

30 files changed

+81
-77
lines changed

frontends/web/src/components/amount/conversion-amount.module.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414
.txPrefix,
1515
.txUnit {
1616
color: var(--color-secondary);
17-
font-size: 14px;
17+
font-size: 1.4rem;
1818
line-height: 1.285714;
1919
white-space: nowrap;
2020
}
2121

2222
.txConversionAmount .txUnit {
23-
font-size: 12px;
23+
font-size: 1.2rem;
2424
flex-shrink: 0;
2525
}
2626

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
@media (max-width: 382px) {
3030
.badge {
31-
font-size: 10px;
31+
font-size: 1rem;
3232
}
3333
}
3434

frontends/web/src/components/bottom-navigation/bottom-navigation.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
align-items: center;
1818
color: var(--color-text);
1919
display: flex;
20-
font-size: 12px;
20+
font-size: 1.2rem;
2121
flex-direction: column;
2222
gap: 4px;
2323
justify-content: center;

frontends/web/src/components/devices/bitbox02bootloader/bitbox02bootloader.module.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88

99
.progressInfo {
1010
display: flex;
11-
font-size: 16px;
11+
font-size: 1.6rem;
1212
justify-content: space-between;
1313
margin: 0 0 var(--space-default);
1414
}
1515

1616
.additionalUpgrade {
17-
font-size: 16px;
17+
font-size: 1.6rem;
1818
margin: 0;
1919
margin-top: var(--space-eight);
2020
}
@@ -23,7 +23,7 @@
2323
.content,
2424
.additionalUpgrade
2525
{
26-
font-size: 14px;
26+
font-size: 1.4rem;
2727
}
2828
}
2929

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363

6464
.header a {
6565
cursor: pointer;
66-
font-size: 20px;
66+
font-size: 2rem;
6767
}
6868

6969
.content {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
animation: changeContent .8s linear infinite;
5252
display: block;
5353
content: "⠋";
54-
font-size: 14px;
54+
font-size: 1.4rem;
5555
margin-left: 3px;
5656
}
5757

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
}
3737

3838
.text {
39-
font-size: 16px;
39+
font-size: 1.6rem;
4040
}
4141

4242
.dialogButtonsContainer {

frontends/web/src/components/spinner/ascii.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
animation: changeContent .8s linear infinite;
1414
display: block;
1515
content: "⠋";
16-
font-size: 14px;
16+
font-size: 1.4rem;
1717
margin-left: 3px;
1818
}
1919

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,18 @@
2525
}
2626

2727
.title {
28-
font-size: 14px;
28+
font-size: 1.4rem;
2929
font-weight: bold;
3030
text-align: left;
3131
}
3232

3333
.disclaimer p {
34-
font-size: 14px;
34+
font-size: 1.4rem;
3535
line-height: 1.5;
3636
}
3737

3838
.disclaimer p + .title {
39-
margin: 40px 0 0 0;
39+
margin: 4rem 0 0 0;
4040
}
4141

4242
.table {
@@ -45,7 +45,7 @@
4545

4646
.table table {
4747
border-collapse: collapse;
48-
font-size: 14px;
48+
font-size: 1.4rem;
4949
text-align: left;
5050
}
5151

frontends/web/src/components/transactions/transaction.module.css

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
flex-direction: column;
6060
flex-grow: 1;
6161
flex-shrink: 0;
62-
font-size: 14px;
62+
font-size: 1.4rem;
6363
line-height: 1.285714;
6464
padding: 0 var(--space-quarter) 0 48px;
6565
text-align: right;
@@ -81,7 +81,7 @@
8181

8282
.txAmount {
8383
align-items: baseline;
84-
font-size: 16px;
84+
font-size: 1.6rem;
8585
font-variant: tabular-nums;
8686
gap: 3px;
8787
justify-content: flex-end;
@@ -105,7 +105,7 @@
105105

106106
.txUnit {
107107
color: var(--color-secondary);
108-
font-size: 14px;
108+
font-size: 1.4rem;
109109
line-height: 1.285714;
110110
}
111111

@@ -116,7 +116,7 @@
116116
}
117117
.txNoteText {
118118
color: var(--color-default);
119-
font-size: 16px;
119+
font-size: 1.6rem;
120120
line-height: 1.25;
121121
}
122122
@media (max-width: 560px) {
@@ -130,7 +130,7 @@
130130
align-items: center;
131131
color: var(--color-secondary);
132132
display: flex;
133-
font-size: 14px;
133+
font-size: 1.4rem;
134134
line-height: 1.285714;
135135
padding-bottom: 6px;
136136
}
@@ -174,13 +174,13 @@
174174
}
175175
.addresses {
176176
color: var(--color-secondary);
177-
font-size: 14px;
177+
font-size: 1.4rem;
178178
font-weight: normal;
179179
line-height: 1.285714;
180180
}
181181
.txType {
182182
color: var(--color-default);
183-
font-size: 16px;
183+
font-size: 1.6rem;
184184
line-height: 1.25;
185185
}
186186

0 commit comments

Comments
 (0)