Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit cf05beb

Browse files
Merge pull request #4355 from JorikSchellekens/joriks/font-scaling-fixes
Fix scaling issues
2 parents 60d51a0 + 6606771 commit cf05beb

File tree

23 files changed

+128
-82
lines changed

23 files changed

+128
-82
lines changed

res/css/_font-sizes.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17+
$font-1px: 0.067rem;
18+
$font-2px: 0.133rem;
19+
$font-3px: 0.200rem;
20+
$font-4px: 0.267rem;
21+
$font-5px: 0.333rem;
22+
$font-6px: 0.400rem;
23+
$font-7px: 0.467rem;
1724
$font-8px: 0.533rem;
1825
$font-9px: 0.600rem;
1926
$font-10px: 0.667rem;
@@ -60,4 +67,5 @@ $font-49px: 3.267rem;
6067
$font-50px: 3.333rem;
6168
$font-51px: 3.400rem;
6269
$font-52px: 3.467rem;
70+
$font-88px: 5.887rem;
6371
$font-400px: 26.667rem;

res/css/structures/_RoomSubList.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ limitations under the License.
7474

7575
.mx_RoomSubList_badge > div {
7676
flex: 0 0 auto;
77-
border-radius: 8px;
77+
border-radius: $font-16px;
7878
font-weight: 600;
7979
font-size: $font-12px;
8080
padding: 0 5px;

res/css/structures/_TagPanel.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ limitations under the License.
6969
height: 100%;
7070
}
7171
.mx_TagPanel .mx_TagPanel_tagTileContainer > div {
72-
height: 40px;
72+
height: $font-40px;
7373
padding: 10px 0 9px 0;
7474
}
7575

@@ -110,13 +110,13 @@ limitations under the License.
110110

111111
.mx_TagPanel .mx_TagTile.mx_TagTile_selected::before {
112112
content: '';
113-
height: 56px;
113+
height: calc(100% + 16px);
114114
background-color: $accent-color;
115115
width: 5px;
116116
position: absolute;
117117
left: -15px;
118118
border-radius: 0 3px 3px 0;
119-
top: -8px; // (56 - 40)/2
119+
top: -8px; // (16px / 2)
120120
}
121121

122122
.mx_TagPanel .mx_TagTile.mx_AccessibleButton:focus {

res/css/views/avatars/_MemberStatusMessageAvatar.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ limitations under the License.
1717
.mx_MessageComposer_avatar .mx_BaseAvatar {
1818
padding: 2px;
1919
border: 1px solid transparent;
20-
border-radius: 15px;
20+
border-radius: 100%;
2121
}
2222

2323
.mx_MessageComposer_avatar .mx_BaseAvatar_initial {

res/css/views/context_menus/_TopLeftMenu.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@ limitations under the License.
7272
.mx_AccessibleButton::after {
7373
mask-repeat: no-repeat;
7474
mask-position: 0 center;
75-
mask-size: 16px;
75+
mask-size: $font-16px;
7676
position: absolute;
77-
width: 16px;
78-
height: 16px;
77+
width: $font-16px;
78+
height: $font-16px;
7979
content: "";
8080
top: 5px;
8181
left: 14px;

res/css/views/elements/_Dropdown.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ limitations under the License.
6767
text-overflow: ellipsis;
6868
white-space: nowrap;
6969
flex: 1;
70+
display: inline-flex;
71+
align-items: center;
7072
}
7173

7274
.mx_Dropdown_option div {

res/css/views/elements/_RichText.scss

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@
66
.mx_RoomPill,
77
.mx_GroupPill,
88
.mx_AtRoomPill {
9-
border-radius: 16px;
10-
display: inline-block;
11-
height: 20px;
12-
line-height: $font-20px;
13-
padding-left: 5px;
9+
display: inline-flex;
10+
align-items: center;
11+
vertical-align: middle;
12+
border-radius: $font-16px;
13+
line-height: $font-15px;
14+
padding-left: 0;
1415
}
1516

1617
a.mx_Pill {
@@ -21,6 +22,18 @@ a.mx_Pill {
2122
max-width: calc(100% - 1ch);
2223
}
2324

25+
.mx_Pill {
26+
padding: $font-1px;
27+
padding-right: 0.4em;
28+
}
29+
30+
/* More specific to override `.markdown-body a` color */
31+
.mx_EventTile_content .markdown-body a.mx_GroupPill,
32+
.mx_GroupPill {
33+
color: $accent-fg-color;
34+
background-color: $rte-group-pill-color;
35+
}
36+
2437
/* More specific to override `.markdown-body a` text-decoration */
2538
.mx_EventTile_content .markdown-body a.mx_Pill {
2639
text-decoration: none;
@@ -31,7 +44,6 @@ a.mx_Pill {
3144
.mx_UserPill {
3245
color: $primary-fg-color;
3346
background-color: $other-user-pill-bg-color;
34-
padding-right: 5px;
3547
}
3648

3749
.mx_UserPill_selected {
@@ -45,7 +57,6 @@ a.mx_Pill {
4557
.mx_MessageComposer_input .mx_AtRoomPill {
4658
color: $accent-fg-color;
4759
background-color: $mention-user-pill-bg-color;
48-
padding-right: 5px;
4960
}
5061

5162
/* More specific to override `.markdown-body a` color */
@@ -55,15 +66,6 @@ a.mx_Pill {
5566
.mx_GroupPill {
5667
color: $accent-fg-color;
5768
background-color: $rte-room-pill-color;
58-
padding-right: 5px;
59-
}
60-
61-
/* More specific to override `.markdown-body a` color */
62-
.mx_EventTile_content .markdown-body a.mx_GroupPill,
63-
.mx_GroupPill {
64-
color: $accent-fg-color;
65-
background-color: $rte-group-pill-color;
66-
padding-right: 5px;
6769
}
6870

6971
.mx_EventTile_body .mx_UserPill,
@@ -77,8 +79,10 @@ a.mx_Pill {
7779
.mx_GroupPill .mx_BaseAvatar,
7880
.mx_AtRoomPill .mx_BaseAvatar {
7981
position: relative;
80-
left: -3px;
81-
top: 2px;
82+
display: inline-flex;
83+
align-items: center;
84+
border-radius: 10rem;
85+
margin-right: 0.24rem;
8286
}
8387

8488
.mx_Markdown_BOLD {

res/css/views/elements/_ToggleSwitch.scss

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,19 @@ limitations under the License.
1616

1717
.mx_ToggleSwitch {
1818
transition: background-color 0.20s ease-out 0.1s;
19-
width: 48px;
20-
height: 24px;
21-
border-radius: 14px;
19+
20+
width: $font-44px;
21+
height: $font-20px;
22+
border-radius: 1.5rem;
23+
padding: 2px;
24+
2225
background-color: $togglesw-off-color;
23-
position: relative;
2426
opacity: 0.5;
27+
28+
display: flex;
29+
flex-direction: row;
30+
flex: 0 0 auto;
31+
align-items: center;
2532
}
2633

2734
.mx_ToggleSwitch_enabled {
@@ -35,19 +42,12 @@ limitations under the License.
3542

3643
.mx_ToggleSwitch_ball {
3744
transition: left 0.15s ease-out 0.1s;
38-
margin: 2px;
39-
width: 20px;
40-
height: 20px;
41-
border-radius: 20px;
45+
width: $font-20px;
46+
height: $font-20px;
47+
border-radius: $font-20px;
4248
background-color: $togglesw-ball-color;
43-
position: absolute;
44-
top: 0;
45-
}
46-
47-
.mx_ToggleSwitch_on > .mx_ToggleSwitch_ball {
48-
left: 23px; // 48px switch - 20px ball - 5px padding = 23px
4949
}
5050

51-
.mx_ToggleSwitch:not(.mx_ToggleSwitch_on) > .mx_ToggleSwitch_ball {
52-
left: 2px;
51+
.mx_ToggleSwitch_on {
52+
flex-direction: row-reverse;
5353
}

res/css/views/right_panel/_UserInfo.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ limitations under the License.
9898
position: absolute;
9999
top: 0;
100100
left: 0;
101-
width: 100%;
102-
height: 100%;
101+
width: 100% !important;
102+
height: 100% !important;
103103
}
104104

105105
.mx_UserInfo_avatar .mx_BaseAvatar_initial {
@@ -109,7 +109,7 @@ limitations under the License.
109109
justify-content: center;
110110

111111
// override the calculated sizes so that the letter isn't HUGE
112-
font-size: 56px !important;
112+
font-size: 6rem !important;
113113
width: 100% !important;
114114
transition: font-size 0.5s;
115115
}

res/css/views/rooms/_Autocomplete.scss

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,10 @@
3131
}
3232

3333
.mx_Autocomplete_Completion_pill {
34-
border-radius: 17px;
35-
height: 34px;
36-
padding: 0px 5px;
34+
box-sizing: border-box;
35+
border-radius: 2rem;
36+
height: $font-34px;
37+
padding: 0.4rem;
3738
display: flex;
3839
user-select: none;
3940
cursor: pointer;
@@ -42,7 +43,7 @@
4243
}
4344

4445
.mx_Autocomplete_Completion_pill > * {
45-
margin: 0 3px;
46+
margin-right: 0.3rem;
4647
}
4748

4849
/* styling for common completion elements */

0 commit comments

Comments
 (0)