From 4a6b618239941e1a6e7fc11f01fbc747a3308c9f Mon Sep 17 00:00:00 2001 From: Lucas Azevedo Date: Fri, 15 Jul 2022 22:59:12 -0300 Subject: [PATCH 1/6] Use body text color in #repo-files-table links --- templates/repo/view_list.tmpl | 4 ++-- web_src/less/_repository.less | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/templates/repo/view_list.tmpl b/templates/repo/view_list.tmpl index 664dfaf9b9a21..82e730fbb7b7e 100644 --- a/templates/repo/view_list.tmpl +++ b/templates/repo/view_list.tmpl @@ -8,9 +8,9 @@ {{if .LatestCommitUser}} {{avatar .LatestCommitUser 24}} {{if .LatestCommitUser.FullName}} - {{.LatestCommitUser.FullName}} + {{.LatestCommitUser.FullName}} {{else}} - {{if .LatestCommit.Author}}{{.LatestCommit.Author.Name}}{{else}}{{.LatestCommitUser.Name}}{{end}} + {{if .LatestCommit.Author}}{{.LatestCommit.Author.Name}}{{else}}{{.LatestCommitUser.Name}}{{end}} {{end}} {{else}} {{if .LatestCommit.Author}} diff --git a/web_src/less/_repository.less b/web_src/less/_repository.less index 0ad937f028cab..9fa11cc07db2a 100644 --- a/web_src/less/_repository.less +++ b/web_src/less/_repository.less @@ -323,6 +323,11 @@ .ui.avatar { margin-bottom: 5px; } + + .author, + .commit-summary a { + color: var(--color-text); + } } tbody { @@ -364,6 +369,10 @@ width: 33%; max-width: calc(100vw - 140px); + + a { + color: var(--color-text); + } } &.message { @@ -377,10 +386,15 @@ max-width: 250px; } width: 66%; + + a:not(.ref-issue) { + color: var(--color-text-light-2); + } } &.age { width: 120px; + color: var(--color-text-light-2); } .truncate { From 515354b41bd2a20a7d3e2ad22d8ea8a196ee08fa Mon Sep 17 00:00:00 2001 From: Lucas Azevedo Date: Sat, 16 Jul 2022 19:02:22 -0300 Subject: [PATCH 2/6] Save a selector by using .muted --- templates/repo/view_list.tmpl | 8 ++++---- web_src/less/_repository.less | 5 ----- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/templates/repo/view_list.tmpl b/templates/repo/view_list.tmpl index 82e730fbb7b7e..0c3697d959cf6 100644 --- a/templates/repo/view_list.tmpl +++ b/templates/repo/view_list.tmpl @@ -8,9 +8,9 @@ {{if .LatestCommitUser}} {{avatar .LatestCommitUser 24}} {{if .LatestCommitUser.FullName}} - {{.LatestCommitUser.FullName}} + {{.LatestCommitUser.FullName}} {{else}} - {{if .LatestCommit.Author}}{{.LatestCommit.Author.Name}}{{else}}{{.LatestCommitUser.Name}}{{end}} + {{if .LatestCommit.Author}}{{.LatestCommit.Author.Name}}{{else}}{{.LatestCommitUser.Name}}{{end}} {{end}} {{else}} {{if .LatestCommit.Author}} @@ -63,7 +63,7 @@ {{$subJumpablePathName := $entry.GetSubJumpablePathName}} {{$subJumpablePath := SubJumpablePath $subJumpablePathName}} {{svg "octicon-file-directory-fill"}} - + {{if eq (len $subJumpablePath) 2}} {{index $subJumpablePath 0}}{{index $subJumpablePath 1}} {{else}} @@ -72,7 +72,7 @@ {{else}} {{svg (printf "octicon-%s" (EntryIcon $entry))}} - {{$entry.Name}} + {{$entry.Name}} {{end}} {{end}} diff --git a/web_src/less/_repository.less b/web_src/less/_repository.less index 9fa11cc07db2a..f99deeb39efb4 100644 --- a/web_src/less/_repository.less +++ b/web_src/less/_repository.less @@ -324,7 +324,6 @@ margin-bottom: 5px; } - .author, .commit-summary a { color: var(--color-text); } @@ -369,10 +368,6 @@ width: 33%; max-width: calc(100vw - 140px); - - a { - color: var(--color-text); - } } &.message { From 8b04e0d301b1da69cc3a1f21721620b6f982c9f1 Mon Sep 17 00:00:00 2001 From: Lucas Azevedo Date: Sat, 16 Jul 2022 19:03:26 -0300 Subject: [PATCH 3/6] Improve contrast of file list message and age --- web_src/less/_repository.less | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web_src/less/_repository.less b/web_src/less/_repository.less index f99deeb39efb4..e3b3c4776311d 100644 --- a/web_src/less/_repository.less +++ b/web_src/less/_repository.less @@ -383,13 +383,13 @@ width: 66%; a:not(.ref-issue) { - color: var(--color-text-light-2); + color: var(--color-text-light); } } &.age { width: 120px; - color: var(--color-text-light-2); + color: var(--color-text-light); } .truncate { From 2475d5e8e02b8396bb7684546c479de8876a9cd5 Mon Sep 17 00:00:00 2001 From: Lucas Azevedo Date: Sat, 16 Jul 2022 19:08:10 -0300 Subject: [PATCH 4/6] Avoid :not by targeting .default-link instead --- web_src/less/_repository.less | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web_src/less/_repository.less b/web_src/less/_repository.less index e3b3c4776311d..3e253f9be1b53 100644 --- a/web_src/less/_repository.less +++ b/web_src/less/_repository.less @@ -324,7 +324,7 @@ margin-bottom: 5px; } - .commit-summary a { + .commit-summary a.default-link { color: var(--color-text); } } @@ -382,7 +382,7 @@ } width: 66%; - a:not(.ref-issue) { + a.default-link { color: var(--color-text-light); } } From ac6ee523fc5e69d116309e917e3d085953cfcaab Mon Sep 17 00:00:00 2001 From: Lucas Azevedo Date: Sun, 17 Jul 2022 20:01:07 -0300 Subject: [PATCH 5/6] Fix hover state and save more selectors Additionally, add a new --color-text-light-1 color. Co-authored-by: silverwind --- modules/markup/html.go | 2 +- templates/repo/view_list.tmpl | 2 +- web_src/less/_base.less | 6 ++++++ web_src/less/_repository.less | 16 +++------------- web_src/less/themes/theme-arc-green.less | 1 + 5 files changed, 12 insertions(+), 15 deletions(-) diff --git a/modules/markup/html.go b/modules/markup/html.go index 6071180501c42..a5606dbb516ad 100644 --- a/modules/markup/html.go +++ b/modules/markup/html.go @@ -1176,7 +1176,7 @@ func genDefaultLinkProcessor(defaultLink string) processor { node.DataAtom = atom.A node.Attr = []html.Attribute{ {Key: "href", Val: defaultLink}, - {Key: "class", Val: "default-link"}, + {Key: "class", Val: "default-link muted"}, } node.FirstChild, node.LastChild = ch, ch } diff --git a/templates/repo/view_list.tmpl b/templates/repo/view_list.tmpl index 0c3697d959cf6..af47b34463021 100644 --- a/templates/repo/view_list.tmpl +++ b/templates/repo/view_list.tmpl @@ -65,7 +65,7 @@ {{svg "octicon-file-directory-fill"}} {{if eq (len $subJumpablePath) 2}} - {{index $subJumpablePath 0}}{{index $subJumpablePath 1}} + {{index $subJumpablePath 0}}{{index $subJumpablePath 1}} {{else}} {{index $subJumpablePath 0}} {{end}} diff --git a/web_src/less/_base.less b/web_src/less/_base.less index 638801e3928c4..3bf524ba150dc 100644 --- a/web_src/less/_base.less +++ b/web_src/less/_base.less @@ -118,6 +118,7 @@ --color-text-dark: #080808; --color-text: #212121; --color-text-light: #555555; + --color-text-light-1: #6a6a6a; --color-text-light-2: #808080; --color-text-light-3: #a0a0a0; --color-box-header: #f7f7f7; @@ -275,6 +276,7 @@ a.muted { a:hover, a.muted:hover, +a.muted:hover [class*="color-text"], .ui.breadcrumb a:hover { color: var(--color-primary); } @@ -2206,3 +2208,7 @@ table th[data-sortt-desc] { } } } + +.color-text-light-2 { + color: var(--color-text-light-2); +} diff --git a/web_src/less/_repository.less b/web_src/less/_repository.less index 3e253f9be1b53..354ed81dd1e2e 100644 --- a/web_src/less/_repository.less +++ b/web_src/less/_repository.less @@ -323,10 +323,6 @@ .ui.avatar { margin-bottom: 5px; } - - .commit-summary a.default-link { - color: var(--color-text); - } } tbody { @@ -371,6 +367,8 @@ } &.message { + color: var(--color-text-light-1); + @media @mediaXl { max-width: 400px; } @@ -381,15 +379,11 @@ max-width: 250px; } width: 66%; - - a.default-link { - color: var(--color-text-light); - } } &.age { width: 120px; - color: var(--color-text-light); + color: var(--color-text-light-1); } .truncate { @@ -441,10 +435,6 @@ padding-bottom: 8px; width: calc(100% - 1.25rem); } - - .jumpable-path { - color: var(--color-text-light-2); - } } .non-diff-file-content { diff --git a/web_src/less/themes/theme-arc-green.less b/web_src/less/themes/theme-arc-green.less index 01150d353e311..b35e8c9229361 100644 --- a/web_src/less/themes/theme-arc-green.less +++ b/web_src/less/themes/theme-arc-green.less @@ -98,6 +98,7 @@ --color-text-dark: #dbe0ea; --color-text: #bbc0ca; --color-text-light: #a6aab5; + --color-text-light-1: #979ba6; --color-text-light-2: #8a8e99; --color-text-light-3: #707687; --color-footer: #2e323e; From acf0ad41df149e370411226f77560bb12387b0d3 Mon Sep 17 00:00:00 2001 From: Lucas Azevedo Date: Tue, 19 Jul 2022 18:58:46 -0300 Subject: [PATCH 6/6] Mute submodule name --- templates/repo/view_list.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/repo/view_list.tmpl b/templates/repo/view_list.tmpl index af47b34463021..43441b56c128b 100644 --- a/templates/repo/view_list.tmpl +++ b/templates/repo/view_list.tmpl @@ -54,7 +54,7 @@ {{svg "octicon-file-submodule"}} {{$refURL := $subModuleFile.RefURL AppUrl $.Repository.FullName $.SSHDomain}} {{if $refURL}} - {{$entry.Name}}@{{ShortSha $subModuleFile.RefID}} + {{$entry.Name}}@{{ShortSha $subModuleFile.RefID}} {{else}} {{$entry.Name}}@{{ShortSha $subModuleFile.RefID}} {{end}}