fix: update text autospace classes in ListItem, EntryTitle, and ArticleLayout components

- Replaced `[text-autospace:auto]` with `autospace-normal` class in ListItem, EntryTitle, and ArticleLayout components to standardize text spacing.
- Added a new utility class `autospace-normal` in tailwind.css to ensure consistent text rendering across the application.

Signed-off-by: Innei <tukon479@gmail.com>
This commit is contained in:
Innei
2025-10-19 23:44:44 +08:00
parent 9e28fcd738
commit ef0af46e6f
5 changed files with 12 additions and 6 deletions
@@ -183,13 +183,13 @@ export function ListItem({
>
{entry?.title ? (
<EntryTranslation
className={cn("hyphens-auto font-medium", lineClamp.title)}
className={cn("autospace-normal hyphens-auto font-medium", lineClamp.title)}
source={titleCase(entry?.title ?? "")}
target={titleCase(translation?.title ?? "")}
/>
) : (
<EntryTranslation
className={cn("hyphens-auto", lineClamp.description)}
className={cn("autospace-normal hyphens-auto", lineClamp.description)}
source={entry?.description}
target={translation?.description}
/>
@@ -205,7 +205,7 @@ export function ListItem({
)}
>
<EntryTranslation
className={cn("hyphens-auto", lineClamp.description)}
className={cn("autospace-normal hyphens-auto", lineClamp.description)}
source={entry?.description}
target={translation?.description}
/>
@@ -107,7 +107,7 @@ export const EntryTitle = ({
<EntryTranslation
source={titleCase(entry.title ?? "")}
target={titleCase(translation?.title ?? "")}
className="text-text inline-block select-text hyphens-auto duration-200"
className="text-text autospace-normal inline-block select-text hyphens-auto duration-200"
inline={false}
bilingual
/>
@@ -157,7 +157,7 @@ const Renderer: React.FC<{
noMedia={noMedia}
accessory={contentAccessories}
as="article"
className="prose dark:prose-invert prose-h1:text-[1.6em] prose-h1:font-bold !max-w-full hyphens-auto [text-autospace:auto]"
className="prose dark:prose-invert prose-h1:text-[1.6em] prose-h1:font-bold autospace-normal !max-w-full hyphens-auto"
style={stableRenderStyle}
renderInlineStyle={readerRenderInlineStyle}
>
@@ -66,7 +66,7 @@ export const HTML = <A extends keyof React.JSX.IntrinsicElements = "div">(props:
{
...rest,
ref: setRefElement,
className: clsx("prose mx-auto px-5 pb-8 [text-autospace:auto]", "dark:prose-invert"),
className: clsx("prose mx-auto px-5 pb-8 [text-autospace:normal]", "dark:prose-invert"),
},
markdownElement,
)}
@@ -59,3 +59,9 @@
i {
@apply select-none;
}
@layer utilities {
.autospace-normal {
text-autospace: normal;
}
}