Skip to content

Commit 5115ffa

Browse files
authored
Remove fomantic ".link" selector and styles (#23888)
It's difficult to play with Fomantic's ".link" selector&styles, and it doesn't bring any real benefit. Instead, it sometimes introduces regressions (because of the `:not` selector, really difficult to fine-tune). Regression: <details> ![image](https://user-images.githubusercontent.com/2114189/229421849-b48fbcf6-2ae2-4264-b06b-2a06c12e1a4b.png) </details> After this PR, there is no ".link" in code anymore. We do not need to play the overwriting and `:not()` game anymore. ![image](https://user-images.githubusercontent.com/2114189/229422058-476aa5e2-53db-402d-b507-a6063824f835.png) ![image](https://user-images.githubusercontent.com/2114189/229422435-34fde1bc-b2ec-48ec-8c4a-6d8c2610b249.png) ![image](https://user-images.githubusercontent.com/2114189/229422014-cb38c8c7-828f-4a49-a761-95ea824d46a7.png) ![image](https://user-images.githubusercontent.com/2114189/229422031-10f6b4a5-af76-40ee-8fa1-692112a9274f.png)
1 parent e351a26 commit 5115ffa

File tree

5 files changed

+11
-57
lines changed

5 files changed

+11
-57
lines changed

templates/repo/forks.tmpl

+6-12
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,12 @@
55
<h2 class="ui dividing header">
66
{{.locale.Tr "repo.forks"}}
77
</h2>
8-
<div class="ui list">
9-
{{range .Forks}}
10-
<div class="item">
11-
{{avatar $.Context .Owner}}
12-
<div class="link">
13-
<a href="{{.Owner.HomeLink}}">{{.Owner.Name}}</a>
14-
/
15-
<a href="{{.Link}}">{{.Name}}</a>
16-
</div>
17-
</div>
18-
{{end}}
19-
</div>
8+
{{range .Forks}}
9+
<div class="gt-df gt-ac gt-py-3">
10+
<span class="gt-mr-2">{{avatar $.Context .Owner}}</span>
11+
<a href="{{.Owner.HomeLink}}">{{.Owner.Name}}</a> / <a href="{{.Link}}">{{.Name}}</a>
12+
</div>
13+
{{end}}
2014
</div>
2115

2216
{{template "base/paginate" .}}

templates/repo/sub_menu.tmpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{{if and (not .HideRepoInfo) (not .IsBlame)}}
22
<div class="ui segments repository-summary{{if and (.Permission.CanRead $.UnitTypeCode) (not .IsEmptyRepo) .LanguageStats}} repository-summary-language-stats{{end}} gt-mt-2 gt-mb-0">
33
<div class="ui segment sub-menu repository-menu">
4-
<div class="ui two horizontal center link list">
4+
<div class="ui two horizontal center list">
55
{{if and (.Permission.CanRead $.UnitTypeCode) (not .IsEmptyRepo)}}
66
<div class="item{{if .PageIsCommits}} active{{end}}">
77
<a href="{{.RepoLink}}/commits/{{.BranchNameSubURL}}">{{svg "octicon-history"}} <b>{{LocaleNumber .CommitsCount}}</b> {{.locale.TrN .CommitsCount "repo.commit" "repo.commits"}}</a>
@@ -22,7 +22,7 @@
2222
</div>
2323
{{if and (.Permission.CanRead $.UnitTypeCode) (not .IsEmptyRepo) .LanguageStats}}
2424
<div class="ui segment sub-menu language-stats-details gt-hidden">
25-
<div class="ui horizontal center link list">
25+
<div class="ui horizontal center list">
2626
{{range .LanguageStats}}
2727
<div class="item gt-df gt-ac gt-jc">
2828
<i class="color-icon gt-mr-3" style="background-color: {{.Color}}"></i>

templates/user/dashboard/navbar.tmpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div class="dashboard-navbar">
22
<div class="ui secondary stackable menu">
33
<div class="item">
4-
<div class="ui floating dropdown link jump">
4+
<div class="ui floating dropdown jump">
55
<span class="text truncated-item-container">
66
{{avatar $.Context .ContextUser}}
77
<span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span>
@@ -45,7 +45,7 @@
4545
</div>
4646
{{if .ContextUser.IsOrganization}}
4747
<div class="item">
48-
<div class="ui floating dropdown link jump">
48+
<div class="ui floating dropdown jump">
4949
<span class="text">
5050
{{svg "octicon-people" 18}}
5151
{{if .Team}}

web_src/css/base.css

+1-22
Original file line numberDiff line numberDiff line change
@@ -807,9 +807,7 @@ a.label,
807807
color: var(--color-text-dark);
808808
}
809809

810-
.ui.link.menu .item:hover,
811810
.ui.menu .dropdown.item:hover,
812-
.ui.menu .link.item:hover,
813811
.ui.menu a.item:hover {
814812
color: var(--color-text);
815813
background: var(--color-hover);
@@ -823,8 +821,6 @@ a.label,
823821
background: var(--color-active);
824822
}
825823

826-
.ui.link.menu .item:active,
827-
.ui.menu .link.item:active,
828824
.ui.menu a.item:active {
829825
color: var(--color-text);
830826
background: none;
@@ -912,7 +908,6 @@ a.label,
912908
}
913909

914910
.ui.secondary.menu .dropdown.item:hover,
915-
.ui.secondary.menu .link.item:hover,
916911
.ui.secondary.menu a.item:hover {
917912
color: var(--color-text);
918913
background: var(--color-hover);
@@ -1073,9 +1068,7 @@ a.label,
10731068
}
10741069

10751070
.ui.cards a.card:hover,
1076-
.ui.link.cards .card:not(.icon):hover,
1077-
a.ui.card:hover,
1078-
.ui.link.card:hover {
1071+
a.ui.card:hover {
10791072
border: 1px solid var(--color-secondary);
10801073
background: var(--color-card);
10811074
}
@@ -1199,19 +1192,6 @@ a.ui.card:hover,
11991192
border-color: var(--color-secondary);
12001193
}
12011194

1202-
.ui.link.list .item,
1203-
.ui.link.list a.item,
1204-
.ui.link.list .item a:not(.ui) {
1205-
color: var(--color-text);
1206-
}
1207-
1208-
.ui.link.list.list a.item:hover,
1209-
.ui.link.list.list .item a:not(.ui):hover,
1210-
.ui.link.list.list a.item:active,
1211-
.ui.link.list.list .item a:not(.ui):active {
1212-
color: var(--color-text-dark);
1213-
}
1214-
12151195
.ui.error.message .header,
12161196
.ui.warning.message .header {
12171197
color: inherit;
@@ -2780,7 +2760,6 @@ table th[data-sortt-desc] .svg {
27802760
.ui.secondary.pointing.menu .active.item,
27812761
.ui.secondary.pointing.menu .active.item:hover,
27822762
.ui.secondary.pointing.menu .dropdown.item:hover,
2783-
.ui.secondary.pointing.menu .link.item:hover,
27842763
.ui.secondary.pointing.menu a.item:hover {
27852764
color: var(--color-text-dark);
27862765
}

web_src/css/repository.css

-19
Original file line numberDiff line numberDiff line change
@@ -2075,25 +2075,6 @@
20752075
width: 450px !important;
20762076
}
20772077

2078-
.repository.forks .list {
2079-
margin-top: 0;
2080-
}
2081-
2082-
.repository.forks .list .item {
2083-
padding-top: 10px;
2084-
padding-bottom: 10px;
2085-
border-bottom: 1px solid var(--color-secondary);
2086-
}
2087-
2088-
.repository.forks .list .item .ui.avatar {
2089-
float: left;
2090-
margin-right: 5px;
2091-
}
2092-
2093-
.repository.forks .list .item .link {
2094-
padding-top: 5px;
2095-
}
2096-
20972078
.repository.packages .empty {
20982079
padding-top: 70px;
20992080
padding-bottom: 100px;

0 commit comments

Comments
 (0)