Skip to content

Commit

Permalink
[field] Fix word-break
Browse files Browse the repository at this point in the history
  • Loading branch information
mariuslundgard authored and rexxars committed Oct 6, 2020
1 parent 4afe0dd commit 09e0963
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
.segment {
line-height: calc(1.25em + 2px);
position: relative;
word-break: break-all;
border-radius: var(--border-radius-small);

@nest &:hover {
Expand Down
2 changes: 2 additions & 0 deletions packages/@sanity/field/src/diff/components/Change.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
.from {
display: block;
text-decoration: none;
word-break: break-all;
}

.to {
display: block;
text-decoration: none;
word-break: break-all;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.root {
word-break: break-all;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import React from 'react'
import {DiffComponent, StringDiff, AnnotatedStringDiff, Change} from '../../../diff'
import {StringPreview} from '../preview/StringPreview'

import styles from './StringFieldDiff.css'

export const StringFieldDiff: DiffComponent<StringDiff> = ({diff, schemaType}) => {
const {options} = schemaType

Expand All @@ -11,5 +13,9 @@ export const StringFieldDiff: DiffComponent<StringDiff> = ({diff, schemaType}) =
return <Change diff={diff} previewComponent={StringPreview} schemaType={schemaType} />
}

return <AnnotatedStringDiff diff={diff} />
return (
<div className={styles.root}>
<AnnotatedStringDiff diff={diff} />
</div>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
display: inline-block;
padding: var(--extra-small-padding) var(--small-padding);
border-radius: var(--border-radius-small);
word-break: break-all;

@nest del & {
text-decoration: line-through;
Expand Down

0 comments on commit 09e0963

Please sign in to comment.