@@ -14,6 +14,7 @@ export interface ReactDiffViewerStyles {
1414 wordAdded ?: string ;
1515 wordRemoved ?: string ;
1616 codeFoldGutter ?: string ;
17+ emptyGutter ?: string ;
1718 emptyLine ?: string ;
1819 codeFold ?: string ;
1920 [ key : string ] : string ;
@@ -42,6 +43,7 @@ export interface ReactDiffViewerStylesOverride {
4243 diffRemoved ?: Interpolation ;
4344 diffAdded ?: Interpolation ;
4445 marker ?: Interpolation ;
46+ emptyGutter ?: Interpolation ;
4547 highlightedLine ?: Interpolation ;
4648 highlightedGutter ?: Interpolation ;
4749 gutter ?: Interpolation ;
@@ -110,6 +112,23 @@ export default (styleOverride: ReactDiffViewerStylesOverride): ReactDiffViewerSt
110112 label : 'diff-added' ,
111113 } ) ;
112114
115+ const wordDiff = css ( {
116+ padding : 2 ,
117+ display : 'inline-flex' ,
118+ borderRadius : 1 ,
119+ label : 'word-diff' ,
120+ } ) ;
121+
122+ const wordAdded = css ( {
123+ background : variables . wordAddedBackground ,
124+ label : 'word-added' ,
125+ } ) ;
126+
127+ const wordRemoved = css ( {
128+ background : variables . wordRemovedBackground ,
129+ label : 'word-removed' ,
130+ } ) ;
131+
113132 const codeFoldGutter = css ( {
114133 backgroundColor : variables . codeFoldGutterBackground ,
115134 label : 'code-fold-gutter' ,
@@ -155,6 +174,9 @@ export default (styleOverride: ReactDiffViewerStylesOverride): ReactDiffViewerSt
155174 const highlightedLine = css ( {
156175 background : variables . highlightBackground ,
157176 label : 'highlighted-line' ,
177+ [ `.${ wordAdded } , .${ wordRemoved } ` ] : {
178+ backgroundColor : 'initial' ,
179+ } ,
158180 } ) ;
159181
160182 const highlightedGutter = css ( {
@@ -166,10 +188,10 @@ export default (styleOverride: ReactDiffViewerStylesOverride): ReactDiffViewerSt
166188 minWidth : 40 ,
167189 padding : '0 10px' ,
168190 label : 'gutter' ,
169- cursor : 'pointer' ,
170191 textAlign : 'right' ,
171192 background : variables . gutterBackground ,
172193 '&:hover' : {
194+ cursor : 'pointer' ,
173195 background : variables . gutterBackgroundDark ,
174196 pre : {
175197 opacity : 1 ,
@@ -192,28 +214,19 @@ export default (styleOverride: ReactDiffViewerStylesOverride): ReactDiffViewerSt
192214 } ,
193215 } ) ;
194216
217+ const emptyGutter = css ( {
218+ '&:hover' : {
219+ background : variables . gutterBackground ,
220+ cursor : 'initial' ,
221+ } ,
222+ label : 'empty-gutter' ,
223+ } ) ;
224+
195225 const line = css ( {
196226 verticalAlign : 'baseline' ,
197227 label : 'line' ,
198228 } ) ;
199229
200- const wordDiff = css ( {
201- padding : 2 ,
202- display : 'inline-flex' ,
203- borderRadius : 1 ,
204- label : 'word-diff' ,
205- } ) ;
206-
207- const wordAdded = css ( {
208- background : variables . wordAddedBackground ,
209- label : 'word-added' ,
210- } ) ;
211-
212- const wordRemoved = css ( {
213- background : variables . wordRemovedBackground ,
214- label : 'word-removed' ,
215- } ) ;
216-
217230 const defaultStyles : any = {
218231 diffContainer,
219232 diffRemoved,
@@ -228,6 +241,7 @@ export default (styleOverride: ReactDiffViewerStylesOverride): ReactDiffViewerSt
228241 wordRemoved,
229242 codeFoldGutter,
230243 codeFold,
244+ emptyGutter,
231245 emptyLine,
232246 } ;
233247
0 commit comments