Skip to content

Commit 84a419d

Browse files
silverwindzeripath
andauthored
Replace code fold icons with octicons (#12222)
- replace font-awesome icons with octicons - clean up js and css surrounding the code expansion and file folding - fix hover color on arc-green - tweak diff line number colors Co-authored-by: zeripath <art27@cantab.net>
1 parent b49a195 commit 84a419d

File tree

8 files changed

+144
-103
lines changed

8 files changed

+144
-103
lines changed

templates/repo/diff/blob_excerpt.tmpl

+59-47
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,62 @@
11
{{if $.IsSplitStyle}}
2-
{{range $k, $line := $.section.Lines}}
3-
<tr class="{{DiffLineTypeToStr .GetType}}-code nl-{{$k}} ol-{{$k}}">
4-
{{if eq .GetType 4}}
5-
<td class="lines-num lines-num-old" data-line-num="{{if $line.LeftIdx}}{{$line.LeftIdx}}{{end}}">
6-
{{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5) }}
7-
<i class="ui blob-excerpt fa fa-caret-down" data-url="{{$.RepoLink}}/blob_excerpt/{{$.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=split&direction=down" data-anchor="{{$.Anchor}}"></i>
8-
{{end}}
9-
{{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4) }}
10-
<i class="ui blob-excerpt fa fa-caret-up" data-url="{{$.RepoLink}}/blob_excerpt/{{$.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=split&direction=up" data-anchor="{{$.Anchor}}"></i>
11-
{{end}}
12-
{{if eq $line.GetExpandDirection 2}}
13-
<span class="ui blob-excerpt" data-url="{{$.RepoLink}}/blob_excerpt/{{$.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=split&direction=" data-anchor="{{$.Anchor}}">{{svg "octicon-fold" 16}}</span>
14-
{{end}}
15-
</td>
16-
<td colspan="5" class="lines-code lines-code-old "><span class="mono wrap">{{$.section.GetComputedInlineDiffFor $line}}</span></td>
17-
{{else}}
18-
<td class="lines-num lines-num-old" data-line-num="{{if $line.LeftIdx}}{{$line.LeftIdx}}{{end}}"><span rel="{{if $line.LeftIdx}}diff-{{Sha1 $.fileName}}L{{$line.LeftIdx}}{{end}}"></span></td>
19-
<td class="blob-excerpt lines-type-marker lines-type-marker-old">{{if $line.LeftIdx}}<span class="mono" data-type-marker=""></span>{{end}}</td>
20-
<td class="blob-excerpt lines-code lines-code-old halfwidth"><span class="mono wrap">{{if $line.LeftIdx}}{{$.section.GetComputedInlineDiffFor $line}}{{end}}</span></td>
21-
<td class="lines-num lines-num-new" data-line-num="{{if $line.RightIdx}}{{$line.RightIdx}}{{end}}"><span rel="{{if $line.RightIdx}}diff-{{Sha1 $.fileName}}R{{$line.RightIdx}}{{end}}"></span></td>
22-
<td class="blob-excerpt lines-type-marker lines-type-marker-new">{{if $line.RightIdx}}<span class="mono" data-type-marker=""></span>{{end}}</td>
23-
<td class="blob-excerpt lines-code lines-code-new halfwidth"><span class="mono wrap">{{if $line.RightIdx}}{{$.section.GetComputedInlineDiffFor $line}}{{end}}</span></td>
24-
{{end}}
25-
</tr>
26-
{{end}}
2+
{{range $k, $line := $.section.Lines}}
3+
<tr class="{{DiffLineTypeToStr .GetType}}-code nl-{{$k}} ol-{{$k}}">
4+
{{if eq .GetType 4}}
5+
<td class="lines-num lines-num-old" data-line-num="{{if $line.LeftIdx}}{{$line.LeftIdx}}{{end}}">
6+
{{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5) }}
7+
<a role="button" class="blob-excerpt" data-url="{{$.RepoLink}}/blob_excerpt/{{$.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=split&direction=down" data-anchor="{{$.Anchor}}">
8+
{{svg "octicon-fold-down" 16}}
9+
</a>
10+
{{end}}
11+
{{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4) }}
12+
<a role="button" class="blob-excerpt" data-url="{{$.RepoLink}}/blob_excerpt/{{$.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=split&direction=up" data-anchor="{{$.Anchor}}">
13+
{{svg "octicon-fold-up" 16}}
14+
</a>
15+
{{end}}
16+
{{if eq $line.GetExpandDirection 2}}
17+
<a role="button" class="blob-excerpt" data-url="{{$.RepoLink}}/blob_excerpt/{{$.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=split&direction=" data-anchor="{{$.Anchor}}">
18+
{{svg "octicon-fold" 16}}
19+
</a>
20+
{{end}}
21+
</td>
22+
<td colspan="5" class="lines-code lines-code-old "><span class="mono wrap">{{$.section.GetComputedInlineDiffFor $line}}</span></td>
23+
{{else}}
24+
<td class="lines-num lines-num-old" data-line-num="{{if $line.LeftIdx}}{{$line.LeftIdx}}{{end}}"><span rel="{{if $line.LeftIdx}}diff-{{Sha1 $.fileName}}L{{$line.LeftIdx}}{{end}}"></span></td>
25+
<td class="blob-excerpt lines-type-marker lines-type-marker-old">{{if $line.LeftIdx}}<span class="mono" data-type-marker=""></span>{{end}}</td>
26+
<td class="blob-excerpt lines-code lines-code-old halfwidth"><span class="mono wrap">{{if $line.LeftIdx}}{{$.section.GetComputedInlineDiffFor $line}}{{end}}</span></td>
27+
<td class="lines-num lines-num-new" data-line-num="{{if $line.RightIdx}}{{$line.RightIdx}}{{end}}"><span rel="{{if $line.RightIdx}}diff-{{Sha1 $.fileName}}R{{$line.RightIdx}}{{end}}"></span></td>
28+
<td class="blob-excerpt lines-type-marker lines-type-marker-new">{{if $line.RightIdx}}<span class="mono" data-type-marker=""></span>{{end}}</td>
29+
<td class="blob-excerpt lines-code lines-code-new halfwidth"><span class="mono wrap">{{if $line.RightIdx}}{{$.section.GetComputedInlineDiffFor $line}}{{end}}</span></td>
30+
{{end}}
31+
</tr>
32+
{{end}}
2733
{{else}}
28-
{{range $k, $line := $.section.Lines}}
29-
<tr class="{{DiffLineTypeToStr .GetType}}-code nl-{{$k}} ol-{{$k}}">
30-
{{if eq .GetType 4}}
31-
<td colspan="2" class="lines-num">
32-
{{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4) }}
33-
<i class="ui blob-excerpt fa fa-caret-up" data-url="{{$.RepoLink}}/blob_excerpt/{{$.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=unified&direction=up" data-anchor="{{$.Anchor}}"></i>
34-
{{end}}
35-
{{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5) }}
36-
<i class="ui blob-excerpt fa fa-caret-down" data-url="{{$.RepoLink}}/blob_excerpt/{{$.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=unified&direction=down" data-anchor="{{$.Anchor}}"></i>
37-
{{end}}
38-
{{if eq $line.GetExpandDirection 2}}
39-
<span class="ui blob-excerpt" data-url="{{$.RepoLink}}/blob_excerpt/{{$.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=unified&direction=" data-anchor="{{$.Anchor}}">{{svg "octicon-fold" 16}}</span>
40-
{{end}}
41-
</td>
42-
{{else}}
43-
<td class="lines-num lines-num-old" data-line-num="{{if $line.LeftIdx}}{{$line.LeftIdx}}{{end}}"><span rel="{{if $line.LeftIdx}}diff-{{Sha1 $.fileName}}L{{$line.LeftIdx}}{{end}}"></span></td>
44-
<td class="lines-num lines-num-new" data-line-num="{{if $line.RightIdx}}{{$line.RightIdx}}{{end}}"><span rel="{{if $line.RightIdx}}diff-{{Sha1 $.fileName}}R{{$line.RightIdx}}{{end}}"></span></td>
45-
{{end}}
46-
<td class="blob-excerpt lines-type-marker"><span class="mono" data-type-marker="{{$line.GetLineTypeMarker}}"></span></td>
47-
<td class="blob-excerpt lines-code{{if (not $line.RightIdx)}} lines-code-old{{end}}"><span class="mono wrap">{{$.section.GetComputedInlineDiffFor $line}}</span></td>
48-
</tr>
49-
{{end}}
34+
{{range $k, $line := $.section.Lines}}
35+
<tr class="{{DiffLineTypeToStr .GetType}}-code nl-{{$k}} ol-{{$k}}">
36+
{{if eq .GetType 4}}
37+
<td colspan="2" class="lines-num">
38+
{{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5) }}
39+
<a role="button" class="blob-excerpt" data-url="{{$.RepoLink}}/blob_excerpt/{{$.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=unified&direction=down" data-anchor="{{$.Anchor}}">
40+
{{svg "octicon-fold-down" 16}}
41+
</a>
42+
{{end}}
43+
{{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4) }}
44+
<a role="button" class="blob-excerpt" data-url="{{$.RepoLink}}/blob_excerpt/{{$.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=unified&direction=up" data-anchor="{{$.Anchor}}">
45+
{{svg "octicon-fold-up" 16}}
46+
</a>
47+
{{end}}
48+
{{if eq $line.GetExpandDirection 2}}
49+
<a role="button" class="blob-excerpt" data-url="{{$.RepoLink}}/blob_excerpt/{{$.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=unified&direction=" data-anchor="{{$.Anchor}}">
50+
{{svg "octicon-fold" 16}}
51+
</a>
52+
{{end}}
53+
</td>
54+
{{else}}
55+
<td class="lines-num lines-num-old" data-line-num="{{if $line.LeftIdx}}{{$line.LeftIdx}}{{end}}"><span rel="{{if $line.LeftIdx}}diff-{{Sha1 $.fileName}}L{{$line.LeftIdx}}{{end}}"></span></td>
56+
<td class="lines-num lines-num-new" data-line-num="{{if $line.RightIdx}}{{$line.RightIdx}}{{end}}"><span rel="{{if $line.RightIdx}}diff-{{Sha1 $.fileName}}R{{$line.RightIdx}}{{end}}"></span></td>
57+
{{end}}
58+
<td class="blob-excerpt lines-type-marker"><span class="mono" data-type-marker="{{$line.GetLineTypeMarker}}"></span></td>
59+
<td class="blob-excerpt lines-code{{if (not $line.RightIdx)}} lines-code-old{{end}}"><span class="mono wrap">{{$.section.GetComputedInlineDiffFor $line}}</span></td>
60+
</tr>
61+
{{end}}
5062
{{end}}

templates/repo/diff/box.tmpl

+13-6
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
{{else}}
1919
<div>
2020
<div class="diff-detail-box diff-box sticky">
21-
<i class="fa fa-retweet"></i>
22-
{{.i18n.Tr "repo.diff.stats_desc" .Diff.NumFiles .Diff.TotalAddition .Diff.TotalDeletion | Str2html}}
21+
{{svg "octicon-diff" 16}} {{.i18n.Tr "repo.diff.stats_desc" .Diff.NumFiles .Diff.TotalAddition .Diff.TotalDeletion | Str2html}}
2322
<div class="ui right">
2423
{{if .PageIsPullFiles}}
2524
{{template "repo/diff/whitespace_dropdown" .}}
@@ -88,7 +87,9 @@
8887
{{$isImage = (call $.IsImageFileInHead $file.Name)}}
8988
{{end}}
9089
{{if or (not $file.IsBin) $isImage}}
91-
<i class="ui fold-code grey fa fa-chevron-down"></i>
90+
<a role="button" class="fold-file">
91+
{{svg "octicon-chevron-down" 18}}
92+
</a>
9293
{{end}}
9394
<div class="diff-counter count">
9495
{{if $file.IsBin}}
@@ -126,13 +127,19 @@
126127
{{if eq .GetType 4}}
127128
<td class="lines-num lines-num-old">
128129
{{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5) }}
129-
<i class="ui blob-excerpt fa fa-caret-down" data-url="{{$.RepoLink}}/blob_excerpt/{{$.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=split&direction=down" data-anchor="diff-{{Sha1 $file.Name}}K{{$line.SectionInfo.RightIdx}}"></i>
130+
<a role="button" class="blob-excerpt" data-url="{{$.RepoLink}}/blob_excerpt/{{$.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=split&direction=down" data-anchor="diff-{{Sha1 $file.Name}}K{{$line.SectionInfo.RightIdx}}">
131+
{{svg "octicon-fold-down" 16}}
132+
</a>
130133
{{end}}
131134
{{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4) }}
132-
<i class="ui blob-excerpt fa fa-caret-up" data-url="{{$.RepoLink}}/blob_excerpt/{{$.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=split&direction=up" data-anchor="diff-{{Sha1 $file.Name}}K{{$line.SectionInfo.RightIdx}}"></i>
135+
<a role="button" class="blob-excerpt" data-url="{{$.RepoLink}}/blob_excerpt/{{$.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=split&direction=up" data-anchor="diff-{{Sha1 $file.Name}}K{{$line.SectionInfo.RightIdx}}">
136+
{{svg "octicon-fold-up" 16}}
137+
</a>
133138
{{end}}
134139
{{if eq $line.GetExpandDirection 2}}
135-
<span class="ui blob-excerpt" data-url="{{$.RepoLink}}/blob_excerpt/{{$.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=split&direction=" data-anchor="diff-{{Sha1 $file.Name}}K{{$line.SectionInfo.RightIdx}}">{{svg "octicon-fold" 16}}</span>
140+
<a role="button" class="blob-excerpt" data-url="{{$.RepoLink}}/blob_excerpt/{{$.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=split&direction=" data-anchor="diff-{{Sha1 $file.Name}}K{{$line.SectionInfo.RightIdx}}">
141+
{{svg "octicon-fold" 16}}
142+
</a>
136143
{{end}}
137144
</td>
138145
<td colspan="5" class="lines-code lines-code-old "><span class="mono wrap">{{$section.GetComputedInlineDiffFor $line}}</span></td>

templates/repo/diff/section_unified.tmpl

+9-3
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,19 @@
55
{{if eq .GetType 4}}
66
<td colspan="2" class="lines-num">
77
{{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 5) }}
8-
<i class="ui blob-excerpt fa fa-caret-down" data-url="{{$.root.RepoLink}}/blob_excerpt/{{$.root.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=unified&direction=down" data-anchor="diff-{{Sha1 $file.Name}}K{{$line.SectionInfo.RightIdx}}"></i>
8+
<a role="button" class="blob-excerpt" data-url="{{$.root.RepoLink}}/blob_excerpt/{{$.root.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=unified&direction=down" data-anchor="diff-{{Sha1 $file.Name}}K{{$line.SectionInfo.RightIdx}}">
9+
{{svg "octicon-fold-down" 16}}
10+
</a>
911
{{end}}
1012
{{if or (eq $line.GetExpandDirection 3) (eq $line.GetExpandDirection 4) }}
11-
<i class="ui blob-excerpt fa fa-caret-up" data-url="{{$.root.RepoLink}}/blob_excerpt/{{$.root.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=unified&direction=up" data-anchor="diff-{{Sha1 $file.Name}}K{{$line.SectionInfo.RightIdx}}"></i>
13+
<a role="button" class="blob-excerpt" data-url="{{$.root.RepoLink}}/blob_excerpt/{{$.root.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=unified&direction=up" data-anchor="diff-{{Sha1 $file.Name}}K{{$line.SectionInfo.RightIdx}}">
14+
{{svg "octicon-fold-up" 16}}
15+
</a>
1216
{{end}}
1317
{{if eq $line.GetExpandDirection 2}}
14-
<span class="ui blob-excerpt" data-url="{{$.root.RepoLink}}/blob_excerpt/{{$.root.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=unified&direction=" data-anchor="diff-{{Sha1 $file.Name}}K{{$line.SectionInfo.RightIdx}}">{{svg "octicon-fold" 16}}</span>
18+
<a role="button" class="blob-excerpt" data-url="{{$.root.RepoLink}}/blob_excerpt/{{$.root.AfterCommitID}}" data-query="{{$line.GetBlobExcerptQuery}}&style=unified&direction=" data-anchor="diff-{{Sha1 $file.Name}}K{{$line.SectionInfo.RightIdx}}">
19+
{{svg "octicon-fold" 16}}
20+
</a>
1521
{{end}}
1622
</td>
1723
{{else}}

web_src/js/index.js

+9-14
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import initTableSort from './features/tablesort.js';
1919
import ActivityTopAuthors from './components/ActivityTopAuthors.vue';
2020
import {initNotificationsTable, initNotificationCount} from './features/notification.js';
2121
import {createCodeEditor} from './features/codeeditor.js';
22-
import {svgs} from './svg.js';
22+
import {svg, svgs} from './svg.js';
2323

2424
const {AppSubUrl, StaticUrlPrefix, csrf} = window.config;
2525

@@ -2017,22 +2017,17 @@ function initCodeView() {
20172017
}
20182018
}).trigger('hashchange');
20192019
}
2020-
$('.fold-code').on('click', ({target}) => {
2021-
const box = target.closest('.file-content');
2020+
$(document).on('click', '.fold-file', ({currentTarget}) => {
2021+
const box = currentTarget.closest('.file-content');
20222022
const folded = box.dataset.folded !== 'true';
2023-
target.classList.add(`fa-chevron-${folded ? 'right' : 'down'}`);
2024-
target.classList.remove(`fa-chevron-${folded ? 'down' : 'right'}`);
2023+
currentTarget.innerHTML = svg(`octicon-chevron-${folded ? 'right' : 'down'}`, 18);
20252024
box.dataset.folded = String(folded);
20262025
});
2027-
function insertBlobExcerpt(e) {
2028-
const $blob = $(e.currentTarget);
2029-
const $row = $blob.parent().parent();
2030-
$.get(`${$blob.data('url')}?${$blob.data('query')}&anchor=${$blob.data('anchor')}`, (blob) => {
2031-
$row.replaceWith(blob);
2032-
$(`[data-anchor="${$blob.data('anchor')}"]`).on('click', (e) => { insertBlobExcerpt(e) });
2033-
});
2034-
}
2035-
$('.ui.blob-excerpt').on('click', (e) => { insertBlobExcerpt(e) });
2026+
$(document).on('click', '.blob-excerpt', async ({currentTarget}) => {
2027+
const {url, query, anchor} = currentTarget.dataset;
2028+
const blob = await $.get(`${url}?${query}&anchor=${anchor}`);
2029+
currentTarget.closest('tr').outerHTML = blob;
2030+
});
20362031
}
20372032

20382033
function initU2FAuth() {

web_src/js/svg.js

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import octiconChevronDown from '../../public/img/svg/octicon-chevron-down.svg';
2+
import octiconChevronRight from '../../public/img/svg/octicon-chevron-right.svg';
13
import octiconGitMerge from '../../public/img/svg/octicon-git-merge.svg';
24
import octiconGitPullRequest from '../../public/img/svg/octicon-git-pull-request.svg';
35
import octiconInternalRepo from '../../public/img/svg/octicon-internal-repo.svg';
@@ -12,6 +14,8 @@ import octiconRepoTemplate from '../../public/img/svg/octicon-repo-template.svg'
1214
import octiconRepoTemplatePrivate from '../../public/img/svg/octicon-repo-template-private.svg';
1315

1416
export const svgs = {
17+
'octicon-chevron-down': octiconChevronDown,
18+
'octicon-chevron-right': octiconChevronRight,
1519
'octicon-git-merge': octiconGitMerge,
1620
'octicon-git-pull-request': octiconGitPullRequest,
1721
'octicon-internal-repo': octiconInternalRepo,

web_src/less/_repository.less

+17-12
Original file line numberDiff line numberDiff line change
@@ -1694,6 +1694,11 @@
16941694
padding: 0 5px !important;
16951695
}
16961696

1697+
.tag-code .lines-num,
1698+
.tag-code td {
1699+
padding: 0 !important;
1700+
}
1701+
16971702
tbody {
16981703
tr {
16991704
td.halfwidth {
@@ -1727,17 +1732,21 @@
17271732

17281733
.code-diff-unified tbody tr {
17291734
&.del-code td {
1730-
background-color: #ffeef0 !important;
1731-
border-color: #f1c0c0 !important;
1735+
background-color: #ffeef0;
1736+
border-color: #f1c0c0;
17321737
}
17331738

17341739
&.add-code td {
17351740
background-color: #e6ffed;
1741+
border-color: #bef5cb;
1742+
}
1743+
1744+
&.del-code td.lines-num {
1745+
background-color: #ffe5e4;
17361746
}
17371747

17381748
&.add-code td.lines-num {
17391749
background-color: #cdffd8;
1740-
border-color: #bef5cb;
17411750
}
17421751

17431752
}
@@ -3001,19 +3010,15 @@ tbody.commit-list {
30013010
margin: 0 !important;
30023011
}
30033012

3013+
.tag-code {
3014+
height: 28px;
3015+
}
3016+
30043017
.tag-code,
30053018
.tag-code td {
3006-
background-color: #e6f1f6;
3019+
background-color: #f0f9ff;
30073020
border-color: #f1f8ff !important;
3008-
padding-top: 8px;
3009-
padding-bottom: 8px;
30103021
vertical-align: middle;
3011-
color: rgba(27, 31, 35, .7);
3012-
}
3013-
3014-
.tag-code td.lines-num {
3015-
background-color: #f6e6eb !important;
3016-
border-color: #dbedff;
30173022
}
30183023

30193024
.issue-keyword {

web_src/less/_review.less

+14-17
Original file line numberDiff line numberDiff line change
@@ -133,27 +133,24 @@
133133
color: rgba(0, 0, 0, .87);
134134
}
135135

136-
.ui.fold-code {
137-
margin-right: 1em;
138-
padding-left: 5px;
139-
cursor: pointer;
140-
width: 22px;
141-
font-size: 12px;
136+
a.fold-file {
137+
margin-right: 10px;
138+
color: inherit;
142139
}
143140

144-
.ui.fold-code:hover {
145-
color: #428bca;
141+
a.blob-excerpt {
142+
color: #575a68;
143+
height: 28px;
144+
display: flex;
145+
justify-content: center;
146+
align-items: center;
147+
width: 100%;
148+
background: #daecfe;
146149
}
147150

148-
.ui.blob-excerpt {
149-
display: block;
150-
line-height: 20px;
151-
font-size: 16px;
152-
cursor: pointer;
153-
}
154-
155-
.ui.blob-excerpt:hover {
156-
color: #428bca;
151+
a.blob-excerpt:hover {
152+
background: #428bca;
153+
color: #fff;
157154
}
158155

159156
.btn-review > .dropdown.icon {

web_src/less/themes/theme-arc-green.less

+19-4
Original file line numberDiff line numberDiff line change
@@ -1056,11 +1056,19 @@ a.ui.basic.green.label:hover {
10561056
border-color: #634343 !important;
10571057
}
10581058

1059+
.repository .diff-file-box .code-diff-unified tbody tr.del-code td.lines-num {
1060+
background-color: #4e2c2c !important;
1061+
}
1062+
10591063
.repository .diff-file-box .code-diff-unified tbody tr.add-code td {
10601064
background-color: #283e2d !important;
10611065
border-color: #314a37 !important;
10621066
}
10631067

1068+
.repository .diff-file-box .code-diff-unified tbody tr.add-code td.lines-num {
1069+
background-color: #2c4632 !important;
1070+
}
1071+
10641072
.removed-code {
10651073
background-color: #5f3737;
10661074
}
@@ -1071,12 +1079,11 @@ a.ui.basic.green.label:hover {
10711079

10721080
.tag-code,
10731081
.tag-code td {
1074-
background: #242637 !important;
1082+
background: #353945 !important;
10751083

10761084
}
10771085
.tag-code td.lines-num {
1078-
background-color: #242637 !important;
1079-
border-color: transparent !important;
1086+
background-color: #3a3e4c !important;
10801087
}
10811088

10821089
.tag-code td.lines-type-marker,
@@ -1424,7 +1431,6 @@ input {
14241431
}
14251432

14261433
.lines-num {
1427-
background: #2e323e !important;
14281434
color: #9e9e9e !important;
14291435
border-color: #2d2d2d !important;
14301436
}
@@ -1433,6 +1439,15 @@ td.blob-excerpt {
14331439
background-color: rgba(0, 0, 0, .15);
14341440
}
14351441

1442+
a.blob-excerpt {
1443+
color: #ccc;
1444+
background: #393d4a;
1445+
}
1446+
1447+
a.blob-excerpt:hover {
1448+
background: #87ab63;
1449+
}
1450+
14361451
.code-view .lines-code.active {
14371452
background: #534d1b !important;
14381453
}

0 commit comments

Comments
 (0)