Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
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
13 changes: 0 additions & 13 deletions styles/file-patch-list-view.less
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,3 @@
.github-MergeConflictPaths .github-FilePatchListView-icon:last-child {
margin-left: @component-padding / 2;
}

//
// States
// -----------------------------------------

.github-StagingView-group.is-focused .is-selected {
background: @background-color-highlight;
color: @text-color-highlight;
.github-StagingView:focus & {
background: @background-color-selected;
color: @text-color-selected;
}
}
49 changes: 26 additions & 23 deletions styles/hunk-view.less
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@import "ui-variables";

@hunk-fg-color: @text-color-subtle;
@hunk-bg-color: @pane-item-background-color;

.github-HunkView {
Expand Down Expand Up @@ -40,21 +41,24 @@
&-line {
display:flex;
line-height: 1.5em;
color: @text-color-subtle;
color: @hunk-fg-color;
&.is-unchanged {
-webkit-font-smoothing: antialiased;
}
}

&-lineNumber {
flex: 0 0 3em; // TODO: Make width dynamic, currently capped at 3 chars
overflow: hidden;
padding: 0 .5em;
text-align: right;
color: @text-color-subtle;
border-right: 1px solid @base-border-color;
-webkit-font-smoothing: antialiased;
}

&-plusMinus {
margin-right: 1ch;
color: fade(@text-color, 33%);
}

&-lineContent {
Expand All @@ -71,38 +75,25 @@
// States
// -------------------------------

// Highlight hunk title
.github-HunkView {
&.is-selected.is-hunkMode &-header {
background-color: @background-color-selected;
}
&.is-selected.is-hunkMode &-title {
color: @text-color-selected;
}
&-title:hover {
color: @text-color-highlight;
}
.github-HunkView-title:hover {
color: @text-color-highlight;
}

.github-HunkView-line {

&.is-selected .github-HunkView-lineNumber {
color: fade(@text-color-selected, 50%);
background-color: @background-color-selected;
}

// mixin
.hunk-line-mixin(@fg; @bg) {
&:hover {
background-color: @background-color-highlight;
}
.github-HunkView-lineContent {
color: mix(@fg, @text-color-highlight, 75%);
background-color: mix(@bg, @hunk-bg-color, 8%);
}
&.is-selected .github-HunkView-lineContent {
color: mix(@fg, @text-color-highlight, 50%);
background-color: mix(@bg, @hunk-bg-color, 20%);
background-color: mix(@bg, @hunk-bg-color, 12%);
}
// hightlight when focused + selected
.github-FilePatchView:focus &.is-selected .github-HunkView-lineContent {
color: mix(@fg, @text-color-highlight, 30%);
background-color: mix(@bg, @hunk-bg-color, 24%);
}
}

Expand All @@ -113,5 +104,17 @@
&.is-added {
.hunk-line-mixin(@text-color-success, @background-color-success);
}
}

// focus colors
.github-FilePatchView:focus {
.github-HunkView.is-selected.is-hunkMode .github-HunkView-title,
.github-HunkView.is-selected.is-hunkMode .github-HunkView-header,
.github-HunkView-line.is-selected .github-HunkView-lineNumber {
color: contrast(@button-background-color-selected);
background: @button-background-color-selected;
}
.github-HunkView-line.is-selected .github-HunkView-lineNumber {
border-color: mix(@button-border-color, @button-background-color-selected, 25%);
}
}
17 changes: 17 additions & 0 deletions styles/staging-view.less
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,20 @@
overflow-x: auto;
}
}


//
// States
// -----------------------------------------

.github-StagingView-group.is-focused .is-selected {
// is selected
color: @text-color-selected;
background: @background-color-selected;

// also has focus
.github-StagingView:focus & {
color: contrast(@button-background-color-selected);
background: @button-background-color-selected;
}
}