Skip to content

Commit a5a2b7c

Browse files
committed
frontend: trying responsive font size
This is a test to see if we can use responsive font size. This also sets the base font size so that 1rem is 10px (unless text zoom). With this technique elements can have responive dimension so that sizes using rem are also zoomed if the text font size is bigger.
1 parent 291f9f9 commit a5a2b7c

File tree

12 files changed

+54
-49
lines changed

12 files changed

+54
-49
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353

5454
.header a {
5555
cursor: pointer;
56-
font-size: 20px;
56+
font-size: 2rem;
5757
}
5858

5959
.content {

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
}
3434

3535
.text {
36-
font-size: 16px;
36+
font-size: 1.6rem;
3737
}
3838

3939
@media (max-width: 768px) {

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

+1-1
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/wallet-connect/incoming-signing-request.module.css

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.accountName {
2-
font-size: 16px;
2+
font-size: 1.6rem;
33
margin: 0 var(--space-half) 0 0;
44
}
55

@@ -9,7 +9,7 @@
99

1010
.address {
1111
color: var(--color-secondary);
12-
font-size: 16px;
12+
font-size: 1.6rem;
1313
margin: 0;
1414
}
1515

@@ -55,7 +55,7 @@
5555
}
5656

5757
.itemText {
58-
font-size: 16px;
58+
font-size: 1.6rem;
5959
margin: 0;
6060
}
6161

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
content: "";
4949
display: inline-block;
5050
flex-shrink: 0;
51-
font-size: 14px;
51+
font-size: 1.4rem;
5252
height: var(--icon-size);
5353
line-height: var(--icon-size);
5454
position: relative;

frontends/web/src/routes/account/walletconnect/components/header/header.module.css

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@
2626
}
2727

2828
.accountName {
29-
font-size: 20px;
29+
font-size: 2rem;
3030
}
3131

3232
.receiveAddress {
33-
font-size: 16px;
33+
font-size: 1.6rem;
3434
}
3535

3636
@media (max-width: 768px) {

frontends/web/src/routes/account/walletconnect/components/session-card/session-card.module.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
.container p {
1010
color: var(--color-default);
11-
font-size: 16px;
11+
font-size: 1.6rem;
1212
line-height: 1.9;
1313
margin-bottom: 0;
1414
}

frontends/web/src/routes/account/walletconnect/dashboard.module.css

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
.headerContainer p.receiveAddress {
1717
color: var(--color-secondary);
1818
margin-top: var(--space-quarter);
19-
font-size: 16px;
19+
font-size: 1.6rem;
2020
}
2121

2222
.noConnectedSessions {
2323
color: var(--color-secondary);
24-
font-size: 16px;
24+
font-size: 1.6rem;
2525
margin: 0;
2626
margin-top: var(--space-large);
2727
text-align: center;
@@ -41,7 +41,7 @@
4141

4242
.allSessionsHeading {
4343
color: var(--color-secondary);
44-
font-size: 16px;
44+
font-size: 1.6rem;
4545
margin: 0;
4646
margin-top: var(--space-half);
4747
}
@@ -54,7 +54,7 @@
5454
}
5555

5656
.headerContainer p {
57-
font-size: 16px;
57+
font-size: 1.6rem;
5858
}
5959

6060
.headerContainer p.receiveAddress,

frontends/web/src/routes/buy/components/countryselect.module.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
}
99

1010
.flag {
11-
font-size: 20px;
11+
font-size: 2rem;
1212
}
1313

1414
.globe {

frontends/web/src/routes/settings/manage-accounts.module.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
}
2222

2323
.walletTitle {
24-
font-size: 20px;
24+
font-size: 2rem;
2525
font-weight: 400;
2626
margin: 0 0 var(--space-quarter) 0;
2727
}

frontends/web/src/style/base.css

+9-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
html {
2-
text-size-adjust: 100%;
3-
}
4-
51
html,
62
body {
73
background-color: var(--background);
@@ -19,6 +15,15 @@ body {
1915
-webkit-app-region: drag;
2016
}
2117

18+
html {
19+
font-size: 62.5%;
20+
text-size-adjust: 100%;
21+
}
22+
23+
body {
24+
font-size: 1.6rem;
25+
}
26+
2227
/*
2328
::selection:not(textarea):not(input) {
2429
background-color: transparent;

frontends/web/src/style/variables.css

+29-29
Original file line numberDiff line numberDiff line change
@@ -40,50 +40,50 @@
4040
--size-extra-large: 2.2rem;
4141
--size-large: 2rem;
4242
--size-large-mobile: 1.4rem;
43-
--size-subheader: 18px;
43+
--size-subheader: 1.8rem;
4444
--size-medium: var(--size-default);
45-
--size-default: 14px;
46-
--size-small: 12px;
47-
--size-xsmall: 11px;
45+
--size-default: 1.4rem;
46+
--size-small: 1.2rem;
47+
--size-xsmall: 1.1rem;
4848
--size-label: var(--size-small);
4949
--size-button: var(--size-default);
50-
--size-title: 32px;
50+
--size-title: 3.2rem;
5151

5252
/* wizard */
53-
--size-wizard-text: 16px;
53+
--size-wizard-text: 1.6rem;
5454

5555
/* spacing */
5656
--spacing-large: 2rem;
5757
--spacing-default: 1rem;
5858
--spacing-half: .5rem;
5959

60-
--space-large: 64px;
61-
--space-default: 32px;
62-
--space-half: 16px;
63-
--space-quarter: 8px;
64-
--space-eight: 4px;
60+
--space-large: 6.4rem;
61+
--space-default: 3.2rem;
62+
--space-half: 1.6rem;
63+
--space-quarter: .8rem;
64+
--space-eight: .4rem;
6565

66-
--item-height-xsmall: 24px;
67-
--item-height-small: 36px;
68-
--item-height: 52px;
69-
--item-height-large: 72px;
70-
--item-height-xlarge: 84px;
66+
--item-height-xsmall: 2.4rem;
67+
--item-height-small: 3.6rem;
68+
--item-height: 5.2rem;
69+
--item-height-large: 7.2rem;
70+
--item-height-xlarge: 8.4rem;
7171

7272
/* typography */
7373
--font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Ubuntu", "Roboto", "Oxygen", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
7474

7575
/* sidebar */
7676
--sidebar-width-large: 250px;
77-
--sidebar-margin: 32px;
78-
--sidebar-item-height: 52px;
79-
--sidebar-icon-margin: 14px;
80-
--sidebar-icon-size: 24px;
81-
--sidebar-header-size: 12px;
82-
--sidebar-header-line-height: 16px;
77+
--sidebar-margin: 3.2rem;
78+
--sidebar-item-height: 5.2rem;
79+
--sidebar-icon-margin: 1.4rem;
80+
--sidebar-icon-size: 2.4rem;
81+
--sidebar-header-size: 1.2rem;
82+
--sidebar-header-line-height: 1.6rem;
8383

8484
/* header */
85-
--header-height: 70px;
86-
--header-default-font-size: 24px;
85+
--header-height: 7rem;
86+
--header-default-font-size: 2.4rem;
8787

8888
/* content */
8989
--content-width: 1080px;
@@ -182,16 +182,16 @@
182182

183183
@media (max-width: 1199px) {
184184
:root {
185-
--size-title: 18px;
185+
--size-title: 1.8rem;
186186
}
187187
}
188188

189189
@media (max-width: 768px) {
190190
:root {
191-
--header-default-font-size: 20px;
192-
--size-subheader: 16px;
193-
--size-title: 16px;
191+
--header-default-font-size: 2rem;
192+
--size-subheader: 1.6rem;
193+
--size-title: 1.6rem;
194194

195-
--size-wizard-text: 14px;
195+
--size-wizard-text: 1.4rem;
196196
}
197197
}

0 commit comments

Comments
 (0)