-
-
Notifications
You must be signed in to change notification settings - Fork 819
Fix clock line break in voice message player on monospace font #8815
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -806,3 +806,25 @@ legend { | |
mask-repeat: no-repeat; | ||
mask-size: contain; | ||
} | ||
|
||
@define-mixin AudioPlayer { | ||
.mx_PlayPauseButton { | ||
margin-inline-end: $spacing-8; | ||
} | ||
|
||
// For audio player and voice message player | ||
.mx_SeekBar, | ||
.mx_RecordingPlayback_timelineLayoutMiddle { | ||
flex: 1; | ||
|
||
+ .mx_Clock { | ||
margin-inline-start: $spacing-8; | ||
} | ||
} | ||
|
||
.mx_Clock { | ||
min-width: $font-42px; // for flexbox | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. which flexbox? |
||
text-align: justify; | ||
white-space: nowrap; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,18 +19,17 @@ limitations under the License. | |
|
||
// Container for live recording and playback controls | ||
.mx_MediaBody.mx_VoiceMessagePrimaryContainer { | ||
// The waveform (right) has a 1px padding on it that we want to account for, otherwise | ||
// inherit from mx_MediaBody | ||
padding-right: 11px; | ||
@mixin AudioPlayer; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I feel like we should be using a class rather than a mixin. |
||
|
||
// Cheat at alignment a bit | ||
display: flex; | ||
align-items: center; | ||
|
||
contain: content; | ||
|
||
// Waveforms are present in live recording only | ||
.mx_Waveform { | ||
flex: 1; // Keep space for waveforms | ||
|
||
.mx_Waveform_bar { | ||
background-color: $quaternary-content; | ||
height: 100%; | ||
|
@@ -45,18 +44,9 @@ limitations under the License. | |
} | ||
} | ||
|
||
.mx_Clock { | ||
width: $font-42px; // we're not using a monospace font, so fake it | ||
min-width: $font-42px; // force sensible layouts in awkward flexboxes (file panel, for example) | ||
padding-right: 6px; // with the fixed width this ends up as a visual 8px most of the time, as intended. | ||
padding-left: 8px; // isolate from recording circle / play control | ||
} | ||
|
||
.mx_RecordingPlayback_timelineLayoutMiddle { | ||
margin-left: 8px; | ||
margin-right: 6px; | ||
position: relative; | ||
display: inline-block; | ||
display: flex; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nested flexboxes end up going poorly on Safari/Firefox, and I don't think we need it here. |
||
flex: 1; | ||
height: 30px; // same height as mx_Waveform, needed for automatic vertical centering | ||
|
||
|
@@ -69,7 +59,6 @@ limitations under the License. | |
position: absolute; | ||
left: 0; | ||
height: 30px; | ||
top: -2px; // visually vertically centered | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this was moving the seek bar 2px up, which is still needed. |
||
|
||
// Hide the hairline progress bar since we're at 100% height. Need to have distinct rules | ||
// because CSS is weird. | ||
|
@@ -96,13 +85,17 @@ limitations under the License. | |
background-color: transparent; | ||
} | ||
} | ||
} | ||
} | ||
|
||
// For timeline-rendered playback, the clock is on the other side of the waveform. | ||
& + .mx_Clock { | ||
text-align: right; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
.mx_MessageComposer_controls { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We shouldn't be targeting the composer here - we need to be targeting the PlaybackContainer classes itself. |
||
.mx_Waveform { | ||
margin-inline-start: $spacing-8; | ||
} | ||
|
||
// Take the padding off the clock because it's accounted for by the `timelineLayoutMiddle` | ||
padding: 0; | ||
} | ||
.mx_VoiceMessagePrimaryContainer { | ||
// The waveform (right) has a 1px padding on it that we want to account for, otherwise | ||
// inherit from mx_MediaBody | ||
padding-right: 11px; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be tightly scoped?