fix(ui) add round for line height values
This commit is contained in:
@@ -72,9 +72,10 @@ const getDisplayFileName = (file: string): string => {
|
||||
const TurnChangedFileChipContent = React.memo(({ file, interactive = false }: { file: TurnChangedFile; interactive?: boolean }) => (
|
||||
<span
|
||||
className={cn(
|
||||
'inline-flex max-w-full items-center gap-1.5 rounded-lg border border-border/30 bg-muted/30 px-2 py-1 text-xs leading-[1.35] text-muted-foreground',
|
||||
'inline-flex max-w-full items-center gap-1.5 rounded-lg border border-border/30 bg-muted/30 px-2 py-1 text-xs text-muted-foreground',
|
||||
interactive && 'transition-colors hover:border-border/60 hover:bg-interactive-hover'
|
||||
)}
|
||||
style={{ lineHeight: 'round(1.35em, 1px)' }}
|
||||
>
|
||||
<FileTypeIcon filePath={file.file} className="h-3.5 w-3.5 flex-shrink-0" />
|
||||
<span className="max-w-52 truncate text-foreground/80" title={file.file}>{getDisplayFileName(file.file)}</span>
|
||||
|
||||
@@ -629,7 +629,9 @@ const sidebarBaseRgb = hexToRgb(theme.colors.surface.muted);
|
||||
vars.push(' --code-inline-line-height: 1rem;');
|
||||
vars.push(' --code-inline-letter-spacing: 0;');
|
||||
vars.push(' --code-inline-font-weight: 400;');
|
||||
vars.push(' --code-block-line-height: 1.4rem;');
|
||||
// Tool and Markdown code output can stream. Keep its used line height on
|
||||
// the pixel grid so incremental content growth cannot accumulate remainders.
|
||||
vars.push(' --code-block-line-height: round(1.4rem, 1px);');
|
||||
vars.push(' --code-block-letter-spacing: 0;');
|
||||
vars.push(' --code-block-font-weight: 400;');
|
||||
vars.push(' --code-line-numbers-line-height: 1.25rem;');
|
||||
@@ -659,7 +661,7 @@ const sidebarBaseRgb = hexToRgb(theme.colors.surface.muted);
|
||||
vars.push(' --markdown-link-line-height: 1.5rem;');
|
||||
vars.push(' --markdown-link-letter-spacing: 0;');
|
||||
vars.push(' --markdown-link-font-weight: var(--ui-regular-font-weight, 400);');
|
||||
vars.push(' --markdown-code-line-height: 1.35;');
|
||||
vars.push(' --markdown-code-line-height: round(1.35em, 1px);');
|
||||
vars.push(' --markdown-code-letter-spacing: 0;');
|
||||
vars.push(' --markdown-code-font-weight: 400;');
|
||||
vars.push(' --markdown-code-block-letter-spacing: 0;');
|
||||
|
||||
Reference in New Issue
Block a user