Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Diff color tweaks #1949

Merged
merged 4 commits into from
Feb 18, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 42 additions & 14 deletions styles/file-patch-view.less
Original file line number Diff line number Diff line change
Expand Up @@ -184,20 +184,32 @@

&-line {
// mixin
.hunk-line-mixin(@bg;) {
background-color: fade(@bg, 16%);
.hunk-line-mixin(@color) {
background-color: fade(@color, 15%);

&.line.cursor-line {
background-color: fade(@bg, 22%);
background-color: fade(@color, 25%);
}
}

&--deleted {
.hunk-line-mixin(@background-color-error);
// light themes
& when (lightness(@syntax-background-color) >= 50) {
&--deleted {
.hunk-line-mixin( hsl(353, 100%, 55%) ); // close to .com's hsl(353, 100%, 93%)
}
&--added {
.hunk-line-mixin( hsl(133, 100%, 50%) ); // close to .com's hsl(133, 100%, 90%)
}
}

&--added {
.hunk-line-mixin(@background-color-success);
// dark themes
& when (lightness(@syntax-background-color) < 50) {
&--deleted {
.hunk-line-mixin( hsl(353, 100%, 65%) ); // close to .com's hsl(353, 100%, 93%)
}
&--added {
.hunk-line-mixin( hsl(133, 40%, 60%) ); // close to .com's hsl(133, 100%, 90%)
}
}
}

Expand All @@ -216,26 +228,32 @@
}

&.icons .line-number {
.octicon-font();
padding: 0;
opacity: 1;
width: 2ch;
font-family: @font-family;
text-align: center;
color: mix(@syntax-gutter-text-color, @syntax-text-color);
-webkit-font-smoothing: antialiased;

&:before {
display: inline-block;
min-width: 1ch;
text-align: center;
min-width: 2ch;
}

&.github-FilePatchView-line--added:before {
content: @plus;
content: "+";
}

&.github-FilePatchView-line--deleted:before {
content: @dash;
content: "-";
}

&.github-FilePatchView-line--nonewline:before {
content: @no-newline;
.octicon-font();
width: inherit;
min-width: auto;
}
}
}
Expand Down Expand Up @@ -273,7 +291,7 @@

atom-text-editor {
.selection .region {
background-color: transparent;
background-color: transparent; // remove default selection
}
}
}
Expand All @@ -293,7 +311,17 @@

atom-text-editor {
.selection .region {
background-color: mix(@button-background-color-selected, @syntax-background-color, 24%);
background-color: mix(@button-background-color-selected, @syntax-background-color, 25%);
}
}
}

// Selected + focused hunkmode
.github-FilePatchView.github-FilePatchView--hunkMode:focus-within {

atom-text-editor {
.selection .region {
background-color: mix(@button-background-color-selected, @syntax-background-color, 8%);
}
}
}
Expand Down