From 2cb22c34e392f37a2f1fad7adc4462ee489b109a Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Mon, 6 Mar 2023 18:20:49 +0800 Subject: [PATCH] Extra checks for prevent weird font size --- src/components/status.css | 2 +- src/components/status.jsx | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/status.css b/src/components/status.css index 424c0f87..1c77c1c2 100644 --- a/src/components/status.css +++ b/src/components/status.css @@ -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 { diff --git a/src/components/status.jsx b/src/components/status.jsx index 6b316be7..fca28e24 100644 --- a/src/components/status.jsx +++ b/src/components/status.jsx @@ -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);