Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unified diff view styling #585

Merged
merged 1 commit into from
Jan 5, 2017
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
Fix unified diff view styling
Signed-off-by: Manuel Kuhlmann <[email protected]>
  • Loading branch information
mkuhlmann committed Jan 5, 2017
commit baec4fa1f018349a0fefa7d4257e8ab699bd3ef5
38 changes: 23 additions & 15 deletions public/css/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -1992,29 +1992,37 @@ footer .ui.language .menu {
padding-top: 8px;
padding-bottom: 8px;
}
.repository .diff-file-box .code-diff tbody tr.add-code td:nth-child(1),
.repository .diff-file-box .code-diff tbody tr.add-code td:nth-child(2),
.repository .diff-file-box .code-diff tbody tr.del-code td:nth-child(3),
.repository .diff-file-box .code-diff tbody tr.del-code td:nth-child(4) {
background-color: #fafafa;
.repository .diff-file-box .code-diff tbody tr .removed-code {
background-color: #ff9999;
}
.repository .diff-file-box .code-diff tbody tr .added-code {
background-color: #99ff99;
}
.repository .diff-file-box .code-diff tbody tr.del-code td:nth-child(1),
.repository .diff-file-box .code-diff tbody tr.del-code td:nth-child(2),
.repository .diff-file-box .code-diff tbody tr td.del-code {
.repository .diff-file-box .code-diff-unified tbody tr.del-code td {
background-color: #ffe0e0 !important;
border-color: #f1c0c0 !important;
}
.repository .diff-file-box .code-diff tbody tr.add-code td:nth-child(3),
.repository .diff-file-box .code-diff tbody tr.add-code td:nth-child(4),
.repository .diff-file-box .code-diff tbody tr td.add-code {
.repository .diff-file-box .code-diff-unified tbody tr.add-code td {
background-color: #d6fcd6 !important;
border-color: #c1e9c1 !important;
}
.repository .diff-file-box .code-diff tbody tr .removed-code {
background-color: #ff9999;
.repository .diff-file-box .code-diff-split tbody tr.add-code td:nth-child(1),
.repository .diff-file-box .code-diff-split tbody tr.add-code td:nth-child(2),
.repository .diff-file-box .code-diff-split tbody tr.del-code td:nth-child(3),
.repository .diff-file-box .code-diff-split tbody tr.del-code td:nth-child(4) {
background-color: #fafafa;
}
.repository .diff-file-box .code-diff tbody tr .added-code {
background-color: #99ff99;
.repository .diff-file-box .code-diff-split tbody tr.del-code td:nth-child(1),
.repository .diff-file-box .code-diff-split tbody tr.del-code td:nth-child(2),
.repository .diff-file-box .code-diff-split tbody tr td.del-code {
background-color: #ffe0e0 !important;
border-color: #f1c0c0 !important;
}
.repository .diff-file-box .code-diff-split tbody tr.add-code td:nth-child(3),
.repository .diff-file-box .code-diff-split tbody tr.add-code td:nth-child(4),
.repository .diff-file-box .code-diff-split tbody tr td.add-code {
background-color: #d6fcd6 !important;
border-color: #c1e9c1 !important;
}
.repository .diff-file-box.file-content img {
max-width: 100%;
Expand Down
48 changes: 30 additions & 18 deletions public/less/_repository.less
Original file line number Diff line number Diff line change
Expand Up @@ -922,24 +922,6 @@
// }
// }

// light gray for empty lines before / after commit
&.add-code td:nth-child(1), &.add-code td:nth-child(2),
&.del-code td:nth-child(3), &.del-code td:nth-child(4) {
background-color: #fafafa;
}

&.del-code td:nth-child(1), &.del-code td:nth-child(2),
td.del-code {
background-color: #ffe0e0 !important;
border-color: #f1c0c0 !important;
}

&.add-code td:nth-child(3), &.add-code td:nth-child(4),
td.add-code{
background-color: #d6fcd6 !important;
border-color: #c1e9c1 !important;
}

.removed-code {
background-color: #ff9999;
}
Expand All @@ -949,6 +931,36 @@
}
}
}
.code-diff-unified tbody tr {
&.del-code td {
background-color: #ffe0e0 !important;
border-color: #f1c0c0 !important;
}

&.add-code td {
background-color: #d6fcd6 !important;
border-color: #c1e9c1 !important;
}
}
.code-diff-split tbody tr {
// light gray for empty lines before / after commit
&.add-code td:nth-child(1), &.add-code td:nth-child(2),
&.del-code td:nth-child(3), &.del-code td:nth-child(4) {
background-color: #fafafa;
}

&.del-code td:nth-child(1), &.del-code td:nth-child(2),
td.del-code {
background-color: #ffe0e0 !important;
border-color: #f1c0c0 !important;
}

&.add-code td:nth-child(3), &.add-code td:nth-child(4),
td.add-code{
background-color: #d6fcd6 !important;
border-color: #c1e9c1 !important;
}
}
&.file-content {
img {
max-width: 100%;
Expand Down
2 changes: 1 addition & 1 deletion templates/repo/diff/box.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
<img src="{{$.RawPath}}/{{EscapePound .Name}}">
</div>
{{else}}
<div class="file-body file-code code-view code-diff">
<div class="file-body file-code code-view code-diff {{if $.IsSplitStyle}}code-diff-split{{else}}code-diff-unified{{end}}">
<table>
<tbody>
{{if $.IsSplitStyle}}
Expand Down