Use body text color in repository files table links (#20386)

Use body text color in for links in the repository files table
Issue/PR links (`.ref-issue`) will not be affected, as seen in other git services.

Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: Lauris BH <lauris@nix.lv>
This commit is contained in:
Lucas Azevedo 2022-07-22 07:49:24 -03:00 committed by GitHub
parent 1a70fc9bc6
commit 599ae09a94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 17 additions and 11 deletions

View File

@ -1176,7 +1176,7 @@ func genDefaultLinkProcessor(defaultLink string) processor {
node.DataAtom = atom.A node.DataAtom = atom.A
node.Attr = []html.Attribute{ node.Attr = []html.Attribute{
{Key: "href", Val: defaultLink}, {Key: "href", Val: defaultLink},
{Key: "class", Val: "default-link"}, {Key: "class", Val: "default-link muted"},
} }
node.FirstChild, node.LastChild = ch, ch node.FirstChild, node.LastChild = ch, ch
} }

View File

@ -8,9 +8,9 @@
{{if .LatestCommitUser}} {{if .LatestCommitUser}}
{{avatar .LatestCommitUser 24}} {{avatar .LatestCommitUser 24}}
{{if .LatestCommitUser.FullName}} {{if .LatestCommitUser.FullName}}
<a href="{{.LatestCommitUser.HomeLink}}"><strong>{{.LatestCommitUser.FullName}}</strong></a> <a class="muted" href="{{.LatestCommitUser.HomeLink}}"><strong>{{.LatestCommitUser.FullName}}</strong></a>
{{else}} {{else}}
<a href="{{.LatestCommitUser.HomeLink}}"><strong>{{if .LatestCommit.Author}}{{.LatestCommit.Author.Name}}{{else}}{{.LatestCommitUser.Name}}{{end}}</strong></a> <a class="muted" href="{{.LatestCommitUser.HomeLink}}"><strong>{{if .LatestCommit.Author}}{{.LatestCommit.Author.Name}}{{else}}{{.LatestCommitUser.Name}}{{end}}</strong></a>
{{end}} {{end}}
{{else}} {{else}}
{{if .LatestCommit.Author}} {{if .LatestCommit.Author}}
@ -54,7 +54,7 @@
{{svg "octicon-file-submodule"}} {{svg "octicon-file-submodule"}}
{{$refURL := $subModuleFile.RefURL AppUrl $.Repository.FullName $.SSHDomain}} {{$refURL := $subModuleFile.RefURL AppUrl $.Repository.FullName $.SSHDomain}}
{{if $refURL}} {{if $refURL}}
<a href="{{$refURL}}">{{$entry.Name}}</a><span class="at">@</span><a href="{{$refURL}}/commit/{{PathEscape $subModuleFile.RefID}}">{{ShortSha $subModuleFile.RefID}}</a> <a class="muted" href="{{$refURL}}">{{$entry.Name}}</a><span class="at">@</span><a href="{{$refURL}}/commit/{{PathEscape $subModuleFile.RefID}}">{{ShortSha $subModuleFile.RefID}}</a>
{{else}} {{else}}
{{$entry.Name}}<span class="at">@</span>{{ShortSha $subModuleFile.RefID}} {{$entry.Name}}<span class="at">@</span>{{ShortSha $subModuleFile.RefID}}
{{end}} {{end}}
@ -63,16 +63,16 @@
{{$subJumpablePathName := $entry.GetSubJumpablePathName}} {{$subJumpablePathName := $entry.GetSubJumpablePathName}}
{{$subJumpablePath := SubJumpablePath $subJumpablePathName}} {{$subJumpablePath := SubJumpablePath $subJumpablePathName}}
{{svg "octicon-file-directory-fill"}} {{svg "octicon-file-directory-fill"}}
<a href="{{$.TreeLink}}/{{PathEscapeSegments $subJumpablePathName}}" title="{{$subJumpablePathName}}"> <a class="muted" href="{{$.TreeLink}}/{{PathEscapeSegments $subJumpablePathName}}" title="{{$subJumpablePathName}}">
{{if eq (len $subJumpablePath) 2}} {{if eq (len $subJumpablePath) 2}}
<span class="jumpable-path">{{index $subJumpablePath 0}}</span>{{index $subJumpablePath 1}} <span class="color-text-light-2">{{index $subJumpablePath 0}}</span>{{index $subJumpablePath 1}}
{{else}} {{else}}
{{index $subJumpablePath 0}} {{index $subJumpablePath 0}}
{{end}} {{end}}
</a> </a>
{{else}} {{else}}
{{svg (printf "octicon-%s" (EntryIcon $entry))}} {{svg (printf "octicon-%s" (EntryIcon $entry))}}
<a href="{{$.TreeLink}}/{{PathEscapeSegments $entry.Name}}" title="{{$entry.Name}}">{{$entry.Name}}</a> <a class="muted" href="{{$.TreeLink}}/{{PathEscapeSegments $entry.Name}}" title="{{$entry.Name}}">{{$entry.Name}}</a>
{{end}} {{end}}
{{end}} {{end}}
</span> </span>

View File

@ -118,6 +118,7 @@
--color-text-dark: #080808; --color-text-dark: #080808;
--color-text: #212121; --color-text: #212121;
--color-text-light: #555555; --color-text-light: #555555;
--color-text-light-1: #6a6a6a;
--color-text-light-2: #808080; --color-text-light-2: #808080;
--color-text-light-3: #a0a0a0; --color-text-light-3: #a0a0a0;
--color-box-header: #f7f7f7; --color-box-header: #f7f7f7;
@ -275,6 +276,7 @@ a.muted {
a:hover, a:hover,
a.muted:hover, a.muted:hover,
a.muted:hover [class*="color-text"],
.ui.breadcrumb a:hover { .ui.breadcrumb a:hover {
color: var(--color-primary); color: var(--color-primary);
} }
@ -2206,3 +2208,7 @@ table th[data-sortt-desc] {
} }
} }
} }
.color-text-light-2 {
color: var(--color-text-light-2);
}

View File

@ -367,6 +367,8 @@
} }
&.message { &.message {
color: var(--color-text-light-1);
@media @mediaXl { @media @mediaXl {
max-width: 400px; max-width: 400px;
} }
@ -381,6 +383,7 @@
&.age { &.age {
width: 120px; width: 120px;
color: var(--color-text-light-1);
} }
.truncate { .truncate {
@ -432,10 +435,6 @@
padding-bottom: 8px; padding-bottom: 8px;
width: calc(100% - 1.25rem); width: calc(100% - 1.25rem);
} }
.jumpable-path {
color: var(--color-text-light-2);
}
} }
.non-diff-file-content { .non-diff-file-content {

View File

@ -98,6 +98,7 @@
--color-text-dark: #dbe0ea; --color-text-dark: #dbe0ea;
--color-text: #bbc0ca; --color-text: #bbc0ca;
--color-text-light: #a6aab5; --color-text-light: #a6aab5;
--color-text-light-1: #979ba6;
--color-text-light-2: #8a8e99; --color-text-light-2: #8a8e99;
--color-text-light-3: #707687; --color-text-light-3: #707687;
--color-footer: #2e323e; --color-footer: #2e323e;