fix(markdown): broken layout in translate page if rendered as long markdown (#10187)

* style(markdown): improve code block styling and layout

- Add text-wrap to pre elements for better readability
- Force background color for code blocks with !important
- Change display to grid in translate page for consistent layout
- Add overflow hidden to output container

* style(markdown): remove redundant !important from code block styling

Move !important declaration to output container's markdown pre selector where it's actually needed
This commit is contained in:
Phantom
2025-09-16 02:10:28 +08:00
committed by GitHub
parent d44654f003
commit c641b116ba
2 changed files with 8 additions and 1 deletions

View File

@@ -121,6 +121,7 @@
border-radius: 5px;
word-break: keep-all;
white-space: pre;
text-wrap: wrap;
}
.markdown code {

View File

@@ -846,7 +846,8 @@ const ContentContainer = styled.div<{ $historyDrawerVisible: boolean }>`
`
const AreaContainer = styled.div`
display: flex;
display: grid;
grid-template-columns: 1fr 1fr;
flex: 1;
gap: 8px;
`
@@ -917,6 +918,11 @@ const OutputContainer = styled.div`
border-radius: 10px;
padding: 10px 5px;
height: calc(100vh - var(--navbar-height) - 70px);
overflow: hidden;
& > div > .markdown > pre {
background-color: var(--color-background-mute) !important;
}
&:hover .copy-button {
opacity: 1;