Skip to content

Commit ebaffb4

Browse files
borisyankovgnprice
authored andcommitted
msglist: Make padding and margin independent of font size.
Change the units used for padding and margins from 'rem' to 'px'. This makes these UI elements not scale with font size change. While this would be undesirable from a purely designer's point of view, and not something we would do for a web app, that is a best practice that the tested apps follow on mobile. This leaves more space for the text when enlarged, considering the limited space. [greg: separated small changes of actual lengths into an explicit preceding commit; cleaned out some noise of unrelated other changes]
1 parent 4955ea5 commit ebaffb4

File tree

1 file changed

+32
-32
lines changed

1 file changed

+32
-32
lines changed

src/webview/css/css.js

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ p {
2929
code {
3030
font-size: .857rem;
3131
white-space: pre-wrap;
32-
padding: 0 0.25rem;
32+
padding: 0 4px;
3333
}
3434
pre {
35-
padding: 0.5rem;
36-
margin: 0.5rem 0;
35+
padding: 8px;
36+
margin: 8px 0;
3737
font-size: 0.75rem;
3838
white-space: pre;
3939
overflow-x: auto;
@@ -57,10 +57,10 @@ thead {
5757
}
5858
th, td {
5959
align: center;
60-
padding: 0.25rem 0.5rem;
60+
padding: 4px 8px;
6161
}
6262
hr {
63-
margin: 1rem 0;
63+
margin: 16px 0;
6464
border: 0;
6565
border-top: 1px solid rgba(127, 127, 127, 0.5);
6666
}
@@ -74,20 +74,20 @@ hr {
7474
display: flex;
7575
flex-direction: row;
7676
justify-content: space-between;
77-
margin-bottom: 0.25rem;
77+
margin-bottom: 4px;
7878
}
7979
.timerow {
8080
text-align: center;
8181
color: #999;
8282
display: flex;
8383
align-items: center;
84-
padding: 0.5rem 0;
84+
padding: 8px 0;
8585
}
8686
.timerow-left,
8787
.timerow-right {
8888
flex: 1;
8989
height: 1px;
90-
margin: 0.5rem;
90+
margin: 8px;
9191
}
9292
.timerow-left {
9393
background: -webkit-linear-gradient(left, transparent 10%, #999 100%);
@@ -104,20 +104,20 @@ hr {
104104
.loading {
105105
display: flex;
106106
word-wrap: break-word;
107-
padding: 1rem;
107+
padding: 16px;
108108
}
109109
.message-brief {
110-
padding: 0 1rem 1rem 4rem;
110+
padding: 0 16px 16px 64px;
111111
}
112112
.message p + p {
113-
margin-top: 1rem;
113+
margin-top: 16px;
114114
}
115115
.avatar,
116116
.loading-avatar {
117117
min-width: 32px;
118118
width: 32px;
119119
height: 32px;
120-
margin-right: 1rem;
120+
margin-right: 16px;
121121
}
122122
.avatar img {
123123
width: 100%;
@@ -139,7 +139,7 @@ hr {
139139
white-space: nowrap;
140140
background-color: rgba(0, 0, 0, 0.1);
141141
border-radius: 3px;
142-
padding: 0 .125rem;
142+
padding: 0 2px;
143143
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.2);
144144
}
145145
.header-wrapper {
@@ -166,7 +166,7 @@ hr {
166166
white-space: nowrap;
167167
}
168168
.private-header {
169-
padding: 0 0.5rem;
169+
padding: 0 8px;
170170
}
171171
.topic-header {
172172
background: #ccc;
@@ -250,7 +250,7 @@ hr {
250250
width: 2rem;
251251
height: 2rem;
252252
border-radius: 50%;
253-
margin: 1rem auto;
253+
margin: 16px auto;
254254
font-size: 10px;
255255
border: 3px solid rgba(82, 194, 175, 0.25);
256256
border-left: 3px solid rgba(82, 194, 175, 0.75);
@@ -274,16 +274,16 @@ hr {
274274
object-fit: contain;
275275
}
276276
blockquote {
277-
padding-left: 0.5rem;
278-
margin: 0.5rem 0 0.5rem 0;
277+
padding-left: 8px;
278+
margin: 8px 0 8px 0;
279279
border-left: 3px solid rgba(127, 127, 127, 0.5);
280280
}
281281
.message ul {
282-
padding-left: 1.25rem;
283-
margin: 0.25rem 0 0 0;
282+
padding-left: 20px;
283+
margin: 4px 0 0 0;
284284
}
285285
.message ul + p {
286-
margin-top: 1rem;
286+
margin-top: 16px;
287287
}
288288
.codehilite .gi { color: #00a000; }
289289
.codehilite .gd { color: #a00000; }
@@ -300,34 +300,34 @@ blockquote {
300300
border: 2px solid rgba(29, 161, 242, 0.5);
301301
background: rgba(29, 161, 242, 0.1);
302302
border-radius: 6px;
303-
padding: 0.5rem 1rem;
304-
margin: 0.5rem 0;
303+
padding: 8px 16px;
304+
margin: 8px 0;
305305
}
306306
.twitter-avatar {
307307
border-radius: 3px;
308-
margin: 0.5rem 0.5rem 0.25rem 0;
308+
margin: 8px 8px 4px 0;
309309
float: left;
310310
width: 2.2rem;
311311
height: 2.2rem;
312312
}
313313
.twitter-image {
314314
text-align: center;
315-
margin: 0.5rem auto;
315+
margin: 8px auto;
316316
}
317317
.message-tags {
318318
text-align: right;
319-
margin: 0.25rem 0;
319+
margin: 4px 0;
320320
font-size: 0.7rem;
321321
}
322322
.message-tag {
323-
padding: 0.25rem 0.25rem;
324-
margin-left: 4;
323+
padding: 4px 4px;
324+
margin-left: 4px;
325325
border-radius: 3px;
326326
color: rgba(127, 127, 127, 0.75);
327327
background: rgba(0, 0, 0, 0.1);
328328
}
329329
.reaction-list {
330-
margin: 0.5rem 0;
330+
margin: 8px 0;
331331
}
332332
.reaction {
333333
color: rgba(127, 127, 127, 1);
@@ -337,7 +337,7 @@ blockquote {
337337
border: 1px solid rgba(127, 127, 127, 0.75);
338338
line-height: 1rem;
339339
height: 1rem;
340-
margin: .25rem 0.5rem .25rem 0;
340+
margin: 4px 8px 4px 0;
341341
}
342342
.reaction img {
343343
pointer-events: none;
@@ -377,11 +377,11 @@ blockquote {
377377
}
378378
#typing {
379379
display: flex;
380-
padding-left: 1rem;
380+
padding-left: 16px;
381381
}
382382
#typing .content {
383-
padding-top: 0.5rem;
384-
padding-bottom: 1rem;
383+
padding-top: 8px;
384+
padding-bottom: 16px;
385385
}
386386
#typing span {
387387
display: inline-block;

0 commit comments

Comments
 (0)