-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Use body text color in repository files table links #20386
Conversation
598becd
to
4a6b618
Compare
You can use the |
web_src/less/_repository.less
Outdated
|
||
a:not(.ref-issue) { | ||
color: var(--color-text-light-2); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can probably avoid this :not
by using a > a
selector instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately it didn't work, as the anchors are siblings. Maybe I am missing something?
<span class="truncate">
<a href="..." class="default-link">Add support for http signatures (</a>
<a href="..." class="ref-issue">#553</a>
<a href="..." class="default-link">)</a>
</span>
But now that you mentioned it, I noticed that there other types of links that should be highlighted as well.
So I guess its safer to explicitly target .default-link
instead of every link except .ref-issue
.
Just pushed this change, will add new screenshots.
Thanks for reviewing. Here are updated screenshots, with a submodule this time. |
Try this patch, it fixes hover states and adds a new color for columns 2 and 3: diff --git a/modules/markup/html.go b/modules/markup/html.go
index 607118050..a5606dbb5 100644
--- a/modules/markup/html.go
+++ b/modules/markup/html.go
@@ -1175,9 +1175,9 @@ func genDefaultLinkProcessor(defaultLink string) processor {
node.Data = "a"
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 0c3697d95..af47b3446 100644
--- a/templates/repo/view_list.tmpl
+++ b/templates/repo/view_list.tmpl
@@ -64,9 +64,9 @@
{{$subJumpablePath := SubJumpablePath $subJumpablePathName}}
{{svg "octicon-file-directory-fill"}}
<a class="muted" href="{{$.TreeLink}}/{{PathEscapeSegments $subJumpablePathName}}" title="{{$subJumpablePathName}}">
{{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}}
{{index $subJumpablePath 0}}
{{end}}
</a>
diff --git a/web_src/less/_base.less b/web_src/less/_base.less
index 638801e39..3bf524ba1 100644
--- a/web_src/less/_base.less
+++ b/web_src/less/_base.less
@@ -117,8 +117,9 @@
--color-body: #ffffff;
--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;
--color-box-body: #ffffff;
@@ -274,8 +275,9 @@ a.muted {
}
a:hover,
a.muted:hover,
+a.muted:hover [class*="color-text"],
.ui.breadcrumb a:hover {
color: var(--color-primary);
}
@@ -2205,4 +2207,8 @@ table th[data-sortt-desc] {
position: initial;
}
}
}
+
+.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 3e253f9be..354ed81dd 100644
--- a/web_src/less/_repository.less
+++ b/web_src/less/_repository.less
@@ -322,12 +322,8 @@
.ui.avatar {
margin-bottom: 5px;
}
-
- .commit-summary a.default-link {
- color: var(--color-text);
- }
}
tbody {
.svg {
@@ -370,8 +366,10 @@
max-width: calc(100vw - 140px);
}
&.message {
+ color: var(--color-text-light-1);
+
@media @mediaXl {
max-width: 400px;
}
@media @mediaLg {
@@ -380,17 +378,13 @@
@media @mediaMd {
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 {
display: inline-block;
@@ -440,12 +434,8 @@
padding-top: 8px;
padding-bottom: 8px;
width: calc(100% - 1.25rem);
}
-
- .jumpable-path {
- color: var(--color-text-light-2);
- }
}
.non-diff-file-content {
.header {
diff --git a/web_src/less/themes/theme-arc-green.less b/web_src/less/themes/theme-arc-green.less
index 01150d353..b35e8c922 100644
--- a/web_src/less/themes/theme-arc-green.less
+++ b/web_src/less/themes/theme-arc-green.less
@@ -97,8 +97,9 @@
--color-box-body: #303440;
--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;
--color-timeline: #4c525e; |
Additionally, add a new --color-text-light-1 color. Co-authored-by: silverwind <me@silverwind.io>
Can leave it unsquashed. I think we should probably mute the left-side of |
* giteaofficial/main: Fix Ruby package parsing by removed unused email field (go-gitea#20470) [skip ci] Updated translations via Crowdin Add repository condition for issue count (go-gitea#20454) Prepend commit message to template content (go-gitea#20429) Improve pprof doc (go-gitea#20463) Improve code diff highlight, fix incorrect rendered diff result (go-gitea#19958) Add Cache-Control header to html and api responses, add no-transform (go-gitea#20432) [skip ci] Updated translations via Crowdin Allow non-semver packages in the Conan package registry (go-gitea#20412) Use body text color in repository files table links (go-gitea#20386) Correct code block in installation docs for Snap (go-gitea#20440) Downgrade golangci-lint to 1.47.0 (go-gitea#20445) Add eslint-plugin-sonarjs (go-gitea#20431) Fix: Actor is required to get user repositories (go-gitea#20443) Add "X-Gitea-Object-Type" header for GET `/raw/` & `/media/` API (go-gitea#20438) Simplify visibility checks (go-gitea#20406)
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>
Hi, this is my first contribution here! 👋
Use body text color in for links in the repository files table:
--color-text
.--color-text-light-2
.Issue/PR links (
.ref-issue
) will not be affected, as seen in other git services.Gitea theme before/after
Before:
After:
Arc Green theme before/after
Before:
After:
PS: I found it more convenient to create this PR without a prior issue, as this is such a small change.