From 2141bc3298932ddb1652ba2de48c7570e467c665 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Sun, 17 Mar 2024 20:40:42 +0800 Subject: [PATCH] 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" (cherry picked from commit 673286d8c8a00bf7240a93187d767fb5a5e32a31) --- templates/repo/clone_buttons.tmpl | 6 +++--- templates/repo/empty.tmpl | 2 +- templates/repo/home.tmpl | 4 ++-- templates/repo/wiki/revision.tmpl | 2 +- templates/repo/wiki/view.tmpl | 2 +- web_src/css/repo.css | 32 +++++++++---------------------- web_src/css/repo/wiki.css | 2 +- 7 files changed, 18 insertions(+), 32 deletions(-) diff --git a/templates/repo/clone_buttons.tmpl b/templates/repo/clone_buttons.tmpl index a664c4bda8..89daba9dc9 100644 --- a/templates/repo/clone_buttons.tmpl +++ b/templates/repo/clone_buttons.tmpl @@ -1,15 +1,15 @@ {{if $.CloneButtonShowHTTPS}} - {{end}} {{if $.CloneButtonShowSSH}} - {{end}} - diff --git a/templates/repo/empty.tmpl b/templates/repo/empty.tmpl index a858a728e9..d3665a9f8b 100644 --- a/templates/repo/empty.tmpl +++ b/templates/repo/empty.tmpl @@ -37,7 +37,7 @@ {{end}} {{end}} -
+
{{template "repo/clone_buttons" .}}
diff --git a/templates/repo/home.tmpl b/templates/repo/home.tmpl index 6b4b227628..2c037fd3d9 100644 --- a/templates/repo/home.tmpl +++ b/templates/repo/home.tmpl @@ -132,9 +132,9 @@
{{if eq $n 0}} -
+
{{template "repo/clone_buttons" .}} -
-
+
{{template "repo/clone_buttons" .}} {{template "repo/clone_script" .}}
diff --git a/templates/repo/wiki/view.tmpl b/templates/repo/wiki/view.tmpl index 541b1e9b42..ba94adeab7 100644 --- a/templates/repo/wiki/view.tmpl +++ b/templates/repo/wiki/view.tmpl @@ -28,7 +28,7 @@
-
+
{{template "repo/clone_buttons" .}} {{template "repo/clone_script" .}}
diff --git a/web_src/css/repo.css b/web_src/css/repo.css index 0eba77dbfe..128748621e 100644 --- a/web_src/css/repo.css +++ b/web_src/css/repo.css @@ -143,41 +143,31 @@ margin-bottom: 12px; } -.repository #clone-panel #repo-clone-url { +.repository .clone-panel #repo-clone-url { width: 320px; border-radius: 0; } -@media (min-width: 768px) and (max-width: 991.98px) { - .repository #clone-panel #repo-clone-url { +@media (max-width: 991.98px) { + .repository .clone-panel #repo-clone-url { width: 200px; } } -@media (max-width: 767.98px) { - .repository #clone-panel #repo-clone-url { - width: 200px; - } +.repository .ui.action.input.clone-panel > button + button, +.repository .ui.action.input.clone-panel > button + input { + margin-left: -1px; /* make the borders overlap to avoid double borders */ } -.repository #clone-panel #repo-clone-https, -.repository #clone-panel #repo-clone-ssh { - border-right: none; -} - -.repository #clone-panel #more-btn { - border-left: none; -} - -.repository #clone-panel button:first-of-type { +.repository .clone-panel > button:first-of-type { border-radius: var(--border-radius) 0 0 var(--border-radius) !important; } -.repository #clone-panel button:last-of-type { +.repository .clone-panel > button:last-of-type { border-radius: 0 var(--border-radius) var(--border-radius) 0 !important; } -.repository #clone-panel .dropdown .menu { +.repository .clone-panel .dropdown .menu { right: 0 !important; left: auto !important; } @@ -1758,10 +1748,6 @@ font-weight: var(--font-weight-normal); } -.repository.quickstart .guide .clone.button:first-child { - border-radius: var(--border-radius) 0 0 var(--border-radius); -} - .repository.quickstart .guide #repo-clone-url { border-radius: 0; padding: 5px 10px; diff --git a/web_src/css/repo/wiki.css b/web_src/css/repo/wiki.css index 1302e9cb5c..bb6f364557 100644 --- a/web_src/css/repo/wiki.css +++ b/web_src/css/repo/wiki.css @@ -58,7 +58,7 @@ } @media (max-width: 767.98px) { - .repository.wiki #clone-panel #repo-clone-url { + .repository.wiki .clone-panel #repo-clone-url { width: 160px; } .repository.wiki .wiki-content-main.with-sidebar,