Extra checks for prevent weird font size

This commit is contained in:
Lim Chee Aun 2023-03-06 18:20:49 +08:00
parent d32f4b95a2
commit 2cb22c34e3
2 changed files with 5 additions and 2 deletions

View file

@ -317,7 +317,7 @@
}
.status.large .content {
font-size: 150%;
font-size: calc(100% + 50% / var(--content-text-weight));
font-size: min(calc(100% + 50% / var(--content-text-weight)), 150%);
}
.status.large .poll,
.status.large .actions {

View file

@ -229,7 +229,10 @@ function Status({
const unauthInteractionErrorMessage = `Sorry, your current logged-in instance can't interact with this status from another instance.`;
const textWeight = () =>
Math.round((spoilerText.length + htmlContentLength(content)) / 140) || 1;
Math.max(
Math.round((spoilerText.length + htmlContentLength(content)) / 140) || 1,
1,
);
const createdDateText = niceDateTime(createdAtDate);
const editedDateText = editedAt && niceDateTime(editedAtDate);