Skip to content

Commit 60adbfb

Browse files
Tomasvrbathisconnect
authored andcommitted
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 8521526 commit 60adbfb

39 files changed

+92
-88
lines changed

frontends/web/src/components/actionable-item/actionable-item.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.container {
2-
--size-default: 14px;
2+
--size-default: 1.4rem;
33
align-items: center;
44
background-color: var(--background-secondary);
55
border: none;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,6 @@
4242
}
4343
@media (min-width: 1200px) {
4444
.message {
45-
--size-default: 18px;
45+
--size-default: 1.8rem;
4646
}
4747
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,13 @@
3030
/* guard dialog and wait-dialog from view styles */
3131
@media (min-width: 1200px) {
3232
.header .title {
33-
--size-subheader: 16px;
33+
--size-subheader: 1.6rem;
3434
}
3535
.modal {
3636
margin-left: var(--sidebar-width-large);
3737
}
3838
.modal .contentContainer p {
39-
--size-default: 14px;
39+
--size-default: 1.4rem;
4040
}
4141
}
4242

frontends/web/src/components/forms/radio.module.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.radio {
2-
--size-default: 14px;
2+
--size-default: 1.4rem;
33
line-height: 1.5;
44
}
55

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

0 commit comments

Comments
 (0)