1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-08-04 13:48:56 +02:00

chore: use pre-wrap for whitespace to break when necessary. (#10245)

Use `white-space: pre-wrap` on event diff lines instead of just `pre`.
This prevents us from getting a horizontal overflow and will instead
wrap the lines if it needs to, but preserve indentation and other spaces
(as explained in [MDN's white-space
docs](https://developer.mozilla.org/en-US/docs/Web/CSS/white-space)).

Means that instead of getting a horizontal overflow and a scroll bar, we
get something like this instead:

![image](https://github.com/user-attachments/assets/d2fab200-6f14-47bc-8d4a-bcbb424fa762)
This commit is contained in:
Thomas Heartman 2025-06-30 14:44:51 +02:00 committed by GitHub
parent 88514077f5
commit d7c465fd20
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -29,7 +29,7 @@ interface IEventDiffProps {
const DiffStyles = styled('div')(({ theme }) => ({
color: theme.palette.text.secondary,
fontFamily: 'monospace',
whiteSpace: 'pre',
whiteSpace: 'pre-wrap',
fontSize: theme.typography.body2.fontSize,
'.deletion, .addition': {