Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 81dbde7

Browse files
authored
Merge pull request atom#1949 from atom/sm/diff-colors
Diff color tweaks
2 parents c9c758f + ed7e328 commit 81dbde7

File tree

1 file changed

+42
-14
lines changed

1 file changed

+42
-14
lines changed

styles/file-patch-view.less

Lines changed: 42 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -184,20 +184,32 @@
184184

185185
&-line {
186186
// mixin
187-
.hunk-line-mixin(@bg;) {
188-
background-color: fade(@bg, 16%);
187+
.hunk-line-mixin(@color) {
188+
background-color: fade(@color, 15%);
189189

190190
&.line.cursor-line {
191-
background-color: fade(@bg, 22%);
191+
background-color: fade(@color, 25%);
192192
}
193193
}
194194

195-
&--deleted {
196-
.hunk-line-mixin(@background-color-error);
195+
// light themes
196+
& when (lightness(@syntax-background-color) >= 50) {
197+
&--deleted {
198+
.hunk-line-mixin( hsl(353, 100%, 55%) ); // close to .com's hsl(353, 100%, 93%)
199+
}
200+
&--added {
201+
.hunk-line-mixin( hsl(133, 100%, 50%) ); // close to .com's hsl(133, 100%, 90%)
202+
}
197203
}
198204

199-
&--added {
200-
.hunk-line-mixin(@background-color-success);
205+
// dark themes
206+
& when (lightness(@syntax-background-color) < 50) {
207+
&--deleted {
208+
.hunk-line-mixin( hsl(353, 100%, 65%) ); // close to .com's hsl(353, 100%, 93%)
209+
}
210+
&--added {
211+
.hunk-line-mixin( hsl(133, 40%, 60%) ); // close to .com's hsl(133, 100%, 90%)
212+
}
201213
}
202214
}
203215

@@ -216,26 +228,32 @@
216228
}
217229

218230
&.icons .line-number {
219-
.octicon-font();
231+
padding: 0;
220232
opacity: 1;
221233
width: 2ch;
234+
font-family: @font-family;
235+
text-align: center;
236+
color: mix(@syntax-gutter-text-color, @syntax-text-color);
237+
-webkit-font-smoothing: antialiased;
222238

223239
&:before {
224240
display: inline-block;
225-
min-width: 1ch;
226-
text-align: center;
241+
min-width: 2ch;
227242
}
228243

229244
&.github-FilePatchView-line--added:before {
230-
content: @plus;
245+
content: "+";
231246
}
232247

233248
&.github-FilePatchView-line--deleted:before {
234-
content: @dash;
249+
content: "-";
235250
}
236251

237252
&.github-FilePatchView-line--nonewline:before {
238253
content: @no-newline;
254+
.octicon-font();
255+
width: inherit;
256+
min-width: auto;
239257
}
240258
}
241259
}
@@ -273,7 +291,7 @@
273291

274292
atom-text-editor {
275293
.selection .region {
276-
background-color: transparent;
294+
background-color: transparent; // remove default selection
277295
}
278296
}
279297
}
@@ -293,7 +311,17 @@
293311

294312
atom-text-editor {
295313
.selection .region {
296-
background-color: mix(@button-background-color-selected, @syntax-background-color, 24%);
314+
background-color: mix(@button-background-color-selected, @syntax-background-color, 25%);
315+
}
316+
}
317+
}
318+
319+
// Selected + focused hunkmode
320+
.github-FilePatchView.github-FilePatchView--hunkMode:focus-within {
321+
322+
atom-text-editor {
323+
.selection .region {
324+
background-color: mix(@button-background-color-selected, @syntax-background-color, 8%);
297325
}
298326
}
299327
}

0 commit comments

Comments
 (0)