Update style rules of MessageTimestamp (#10780)

* Remove an obsolete variable - `$MessageTimestamp_width_hover`

Added by 9b54aba4c0
Deprecated 5343be7814

* Replace a variable with a custom property - $MessageTimestamp_width

* Merge with an existing property in :root

rename

* Manage the variable on _MessageTimestamp.pcss
This commit is contained in:
Suguru Hirahara 2023-05-04 12:19:26 +00:00 committed by GitHub
parent 36ea338064
commit 9fc4410ee9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 15 additions and 15 deletions

View file

@ -21,7 +21,7 @@ limitations under the License.
padding: 10px; /* TODO: Use a spacing variable */
border-radius: 8px;
/* Reserve space for external timestamps, but also cap the width */
max-width: min(calc(100% - 2 * $MessageTimestamp_width), 600px);
max-width: min(calc(100% - 2 * var(--MessageTimestamp-width)), 600px);
box-sizing: border-box;
display: grid;
grid-template-columns: 24px minmax(0, 1fr) min-content min-content;

View file

@ -14,15 +14,18 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
.mx_MessageTimestamp {
:root {
--MessageTimestamp-width: 46px; /* 8 + 30 (avatar) + 8 */
--MessageTimestamp-max-width: 80px;
--MessageTimestamp-color: $event-timestamp-color;
}
.mx_MessageTimestamp {
color: var(--MessageTimestamp-color);
font-size: $font-10px;
font-variant-numeric: tabular-nums;
display: block; /* enable the width setting below */
width: $MessageTimestamp_width;
width: var(--MessageTimestamp-width);
white-space: nowrap;
user-select: none;
}