Skip to content

Commit 9296baf

Browse files
authored
Change <a> elements to underline on hover (go-gitea#17898)
Fomantic brings a opinionated style that removed underline on mouse hover which I think is important UX to have. This re-enables the underline in the Fomantic config and fixes a few cases where underline was deemed disruptive.
1 parent 8662ff6 commit 9296baf

File tree

6 files changed

+27
-29
lines changed

6 files changed

+27
-29
lines changed

templates/shared/issuelist.tmpl

+7-9
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,12 @@
3131
</div>
3232
<div class="issue-item-main f1 fc df">
3333
<div class="issue-item-top-row">
34-
<a class="title" href="{{if .HTMLURL}}{{.HTMLURL}}{{else}}{{$.Link}}/{{.Index}}{{end}}">
35-
{{RenderEmoji .Title}}
36-
{{if .IsPull }}
37-
{{if (index $.CommitStatus .PullRequest.ID)}}
38-
{{template "repo/commit_status" (index $.CommitStatus .PullRequest.ID)}}
39-
{{end}}
34+
<a class="title tdn" href="{{if .HTMLURL}}{{.HTMLURL}}{{else}}{{$.Link}}/{{.Index}}{{end}}">{{RenderEmoji .Title}}</a>
35+
{{if .IsPull}}
36+
{{if (index $.CommitStatus .PullRequest.ID)}}
37+
{{template "repo/commit_status" (index $.CommitStatus .PullRequest.ID)}}
4038
{{end}}
41-
</a>
39+
{{end}}
4240
<span class="labels-list ml-2">
4341
{{range .Labels}}
4442
<a class="ui label" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&state={{$.State}}&labels={{.ID}}{{if ne $.listType "milestone"}}&milestone={{$.MilestoneID}}{{end}}&assignee={{$.AssigneeID}}" style="color: {{.ForegroundColor}}; background-color: {{.Color}}" title="{{.Description | RenderEmojiPlain}}">{{.Name | RenderEmoji}}</a>
@@ -126,14 +124,14 @@
126124
</div>
127125
<div class="issue-item-icon-right text grey">
128126
{{range .Assignees}}
129-
<a class="ui assignee tooltip" href="{{.HomeLink}}" data-content="{{.GetDisplayName}}" data-position="left center">
127+
<a class="ui assignee tooltip tdn" href="{{.HomeLink}}" data-content="{{.GetDisplayName}}" data-position="left center">
130128
{{avatar .}}
131129
</a>
132130
{{end}}
133131
</div>
134132
<div class="issue-item-icon-right text grey">
135133
{{if .NumComments}}
136-
<a href="{{if .HTMLURL}}{{.HTMLURL}}{{else}}{{$.Link}}/{{.Index}}{{end}}">
134+
<a class="tdn" href="{{if .HTMLURL}}{{.HTMLURL}}{{else}}{{$.Link}}/{{.Index}}{{end}}">
137135
{{svg "octicon-comment" 16 "mr-2"}}{{.NumComments}}
138136
</a>
139137
{{end}}

web_src/fomantic/_site/globals/site.variables

+1
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@
66
@useCustomScrollbars: false;
77
@disabledOpacity: var(--opacity-disabled);
88
@variationPopupTooltip: false;
9+
@linkHoverUnderline: underline;

web_src/fomantic/build/semantic.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web_src/less/_base.less

+14-1
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ a,
236236
.ui.breadcrumb a {
237237
color: var(--color-primary);
238238
cursor: pointer;
239+
text-decoration-skip-ink: all;
239240
}
240241

241242
a.muted {
@@ -245,7 +246,19 @@ a.muted {
245246
a:hover,
246247
a.muted:hover,
247248
.ui.breadcrumb a:hover {
248-
color: var(--color-primary-dark-2);
249+
color: var(--color-primary);
250+
}
251+
252+
a.label,
253+
.repository-menu a,
254+
.ui.search .results a,
255+
.ui .menu a,
256+
.issue-keyword a {
257+
text-decoration: none !important;
258+
}
259+
260+
.ui.breadcrumb a:hover {
261+
text-decoration: underline !important;
249262
}
250263

251264
.ui.breadcrumb .divider {

web_src/less/_repository.less

+3-18
Original file line numberDiff line numberDiff line change
@@ -2837,20 +2837,6 @@ tbody.commit-list {
28372837
}
28382838
}
28392839

2840-
.commit-summary a {
2841-
&:hover {
2842-
text-decoration: underline solid;
2843-
}
2844-
2845-
&.default-link {
2846-
text-decoration: none;
2847-
2848-
&:hover {
2849-
text-decoration: underline solid;
2850-
}
2851-
}
2852-
}
2853-
28542840
.commit-list .commit-status-link {
28552841
display: inline-block;
28562842
vertical-align: middle;
@@ -3012,13 +2998,12 @@ td.blob-excerpt {
30122998
background-color: #fafafa;
30132999
}
30143000

3015-
.issue-keyword,
3016-
.commit-body .issue-keyword:hover {
3017-
border-bottom: 1px dotted var(--color-text-light-2);
3001+
.issue-keyword {
3002+
border-bottom: 1px dotted var(--color-text-light-3) !important;
30183003
}
30193004

30203005
.issue-keyword:hover {
3021-
border-bottom: none;
3006+
border-bottom: none !important;
30223007
}
30233008

30243009
.file-header {

web_src/less/helpers.less

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
.ac { align-items: center !important; }
77
.tc { text-align: center !important; }
88
.tl { text-align: left !important; }
9+
.tdn { text-decoration: none !important; }
910
.jc { justify-content: center !important; }
1011
.js { justify-content: flex-start !important; }
1112
.je { justify-content: flex-end !important; }

0 commit comments

Comments
 (0)