fix(webui): restore CJK line height and refine text wrapping
This commit is contained in:
1 parent
6ff96f2a8f
commit
24033152c7
3 files changed
+27
-12
No files matched your search
@@ -78,7 +78,7 @@ const AlertDialogTitle = React.forwardRef<
|
||||
>(({ className, ...props }, ref) => (
|
||||
<AlertDialogPrimitive.Title
|
||||
ref={ref}
|
||||
className={cn("text-lg font-semibold", className)}
|
||||
className={cn("text-balance text-lg font-semibold", className)}
|
||||
{...props}
|
||||
/>
|
||||
));
|
||||
@@ -90,7 +90,7 @@ const AlertDialogDescription = React.forwardRef<
|
||||
>(({ className, ...props }, ref) => (
|
||||
<AlertDialogPrimitive.Description
|
||||
ref={ref}
|
||||
className={cn("text-sm text-muted-foreground", className)}
|
||||
className={cn("text-pretty text-sm text-muted-foreground", className)}
|
||||
{...props}
|
||||
/>
|
||||
));
|
||||
|
||||
@@ -176,7 +176,7 @@ const DialogTitle = React.forwardRef<
|
||||
<DialogPrimitive.Title
|
||||
ref={ref}
|
||||
className={cn(
|
||||
"text-lg font-semibold leading-none tracking-tight",
|
||||
"text-balance text-lg font-semibold leading-none tracking-tight",
|
||||
className,
|
||||
)}
|
||||
{...props}
|
||||
@@ -190,7 +190,7 @@ const DialogDescription = React.forwardRef<
|
||||
>(({ className, ...props }, ref) => (
|
||||
<DialogPrimitive.Description
|
||||
ref={ref}
|
||||
className={cn("text-sm text-muted-foreground", className)}
|
||||
className={cn("text-pretty text-sm text-muted-foreground", className)}
|
||||
{...props}
|
||||
/>
|
||||
));
|
||||
|
||||
+23
-8
@@ -120,6 +120,19 @@
|
||||
body {
|
||||
@apply bg-background text-foreground font-sans antialiased;
|
||||
overflow: hidden;
|
||||
text-autospace: normal;
|
||||
}
|
||||
|
||||
/* Keep source text and editable values visually literal. */
|
||||
pre,
|
||||
code,
|
||||
kbd,
|
||||
samp,
|
||||
.font-mono,
|
||||
input,
|
||||
textarea,
|
||||
[contenteditable="true"] {
|
||||
text-autospace: no-autospace;
|
||||
}
|
||||
|
||||
#root.visual-viewport {
|
||||
@@ -364,19 +377,21 @@
|
||||
@apply list-none pl-0;
|
||||
}
|
||||
|
||||
/* CJK-friendly line-height: prose paragraphs default to 1.625 which is
|
||||
tight for Chinese/Japanese/Korean characters. Bump to 1.8 for better
|
||||
readability when the browser detects a CJK primary font. */
|
||||
/* Set the default before locale overrides: html also matches :lang(). */
|
||||
:root {
|
||||
--cjk-line-height: 1.625;
|
||||
}
|
||||
|
||||
:lang(zh),
|
||||
:lang(zh-CN),
|
||||
:lang(zh-TW),
|
||||
:lang(zh-HK),
|
||||
:lang(ja),
|
||||
:lang(ko) {
|
||||
--cjk-line-height: 1.8;
|
||||
}
|
||||
:root {
|
||||
--cjk-line-height: 1.625;
|
||||
|
||||
/* Balance short headings; preserve explicit line breaks in chat prose. */
|
||||
.markdown-content :is(h1, h2, h3, h4, h5, h6),
|
||||
.settings-section-title {
|
||||
text-wrap: balance;
|
||||
}
|
||||
|
||||
/* L→R sheen clipped to live activity labels. The highlight lives inside
|
||||
|
||||
Reference in new issue
Block a user