Skip to content

Commit 673286d

Browse files
authored
Refactor clone-panel styles (#29861)
1. The borders were doubled on the "empty" page, fix it. 2. Remove unnecessary CSS classes like "clone", "compact", etc 3. Use CSS class "clone-panel" instead of ID "clone-panel" 4. Use `tw-flex-1` instead of `gt-f1` 5. Remove unnecessary ID "more-btn"
1 parent a228656 commit 673286d

File tree

7 files changed

+18
-32
lines changed

7 files changed

+18
-32
lines changed

templates/repo/clone_buttons.tmpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<!-- there is always at least one button (by context/repo.go) -->
22
{{if $.CloneButtonShowHTTPS}}
3-
<button class="ui small compact clone button" id="repo-clone-https" data-link="{{$.CloneButtonOriginLink.HTTPS}}">
3+
<button class="ui small button" id="repo-clone-https" data-link="{{$.CloneButtonOriginLink.HTTPS}}">
44
HTTPS
55
</button>
66
{{end}}
77
{{if $.CloneButtonShowSSH}}
8-
<button class="ui small compact clone button" id="repo-clone-ssh" data-link="{{$.CloneButtonOriginLink.SSH}}">
8+
<button class="ui small button" id="repo-clone-ssh" data-link="{{$.CloneButtonOriginLink.SSH}}">
99
SSH
1010
</button>
1111
{{end}}
1212
<input id="repo-clone-url" size="20" class="js-clone-url" value="{{$.CloneButtonOriginLink.HTTPS}}" readonly>
13-
<button class="ui basic small compact icon button" id="clipboard-btn" data-tooltip-content="{{ctx.Locale.Tr "copy_url"}}" data-clipboard-target="#repo-clone-url" aria-label="{{ctx.Locale.Tr "copy_url"}}">
13+
<button class="ui small icon button" id="clipboard-btn" data-tooltip-content="{{ctx.Locale.Tr "copy_url"}}" data-clipboard-target="#repo-clone-url" aria-label="{{ctx.Locale.Tr "copy_url"}}">
1414
{{svg "octicon-copy" 14}}
1515
</button>

templates/repo/empty.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
</a>
3838
{{end}}
3939
{{end}}
40-
<div class="ui action small input gt-df gt-f1">
40+
<div class="clone-panel ui action small input tw-flex-1">
4141
{{template "repo/clone_buttons" .}}
4242
</div>
4343
</div>

templates/repo/home.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,9 @@
124124
<div class="gt-df gt-ac">
125125
<!-- Only show clone panel in repository home page -->
126126
{{if eq $n 0}}
127-
<div class="ui action tiny input" id="clone-panel">
127+
<div class="clone-panel ui action tiny input">
128128
{{template "repo/clone_buttons" .}}
129-
<button id="more-btn" class="ui basic small compact jump dropdown icon button" data-tooltip-content="{{ctx.Locale.Tr "repo.more_operations"}}">
129+
<button class="ui small jump dropdown icon button" data-tooltip-content="{{ctx.Locale.Tr "repo.more_operations"}}">
130130
{{svg "octicon-kebab-horizontal"}}
131131
<div class="menu">
132132
{{if not $.DisableDownloadSourceArchives}}

templates/repo/wiki/revision.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
</div>
1616
</div>
1717
<div class="ui eight wide column text right">
18-
<div class="ui action small input" id="clone-panel">
18+
<div class="clone-panel ui action small input">
1919
{{template "repo/clone_buttons" .}}
2020
{{template "repo/clone_script" .}}
2121
</div>

templates/repo/wiki/view.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
</div>
2929
</div>
3030
</div>
31-
<div class="ui action small input gt-df gt-ac" id="clone-panel">
31+
<div class="clone-panel ui action small input">
3232
{{template "repo/clone_buttons" .}}
3333
{{template "repo/clone_script" .}}
3434
</div>

web_src/css/repo.css

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -143,41 +143,31 @@
143143
margin-bottom: 12px;
144144
}
145145

146-
.repository #clone-panel #repo-clone-url {
146+
.repository .clone-panel #repo-clone-url {
147147
width: 320px;
148148
border-radius: 0;
149149
}
150150

151-
@media (min-width: 768px) and (max-width: 991.98px) {
152-
.repository #clone-panel #repo-clone-url {
151+
@media (max-width: 991.98px) {
152+
.repository .clone-panel #repo-clone-url {
153153
width: 200px;
154154
}
155155
}
156156

157-
@media (max-width: 767.98px) {
158-
.repository #clone-panel #repo-clone-url {
159-
width: 200px;
160-
}
161-
}
162-
163-
.repository #clone-panel #repo-clone-https,
164-
.repository #clone-panel #repo-clone-ssh {
165-
border-right: none;
157+
.repository .ui.action.input.clone-panel > button + button,
158+
.repository .ui.action.input.clone-panel > button + input {
159+
margin-left: -1px; /* make the borders overlap to avoid double borders */
166160
}
167161

168-
.repository #clone-panel #more-btn {
169-
border-left: none;
170-
}
171-
172-
.repository #clone-panel button:first-of-type {
162+
.repository .clone-panel > button:first-of-type {
173163
border-radius: var(--border-radius) 0 0 var(--border-radius) !important;
174164
}
175165

176-
.repository #clone-panel button:last-of-type {
166+
.repository .clone-panel > button:last-of-type {
177167
border-radius: 0 var(--border-radius) var(--border-radius) 0 !important;
178168
}
179169

180-
.repository #clone-panel .dropdown .menu {
170+
.repository .clone-panel .dropdown .menu {
181171
right: 0 !important;
182172
left: auto !important;
183173
}
@@ -1759,10 +1749,6 @@
17591749
font-weight: var(--font-weight-normal);
17601750
}
17611751

1762-
.repository.quickstart .guide .clone.button:first-child {
1763-
border-radius: var(--border-radius) 0 0 var(--border-radius);
1764-
}
1765-
17661752
.repository.quickstart .guide #repo-clone-url {
17671753
border-radius: 0;
17681754
padding: 5px 10px;

web_src/css/repo/wiki.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
}
5959

6060
@media (max-width: 767.98px) {
61-
.repository.wiki #clone-panel #repo-clone-url {
61+
.repository.wiki .clone-panel #repo-clone-url {
6262
width: 160px;
6363
}
6464
.repository.wiki .wiki-content-main.with-sidebar,

0 commit comments

Comments
 (0)