Skip to content
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

Rework button coloring, add focus and active colors #24507

Merged
merged 11 commits into from
May 29, 2023
4 changes: 2 additions & 2 deletions templates/repo/clone_buttons.tmpl
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<!-- there is always at least one button (by context/repo.go) -->
{{if $.CloneButtonShowHTTPS}}
<button class="ui basic small compact clone button gt-no-transition" id="repo-clone-https" data-link="{{$.CloneButtonOriginLink.HTTPS}}">
<button class="ui small compact clone button gt-no-transition" id="repo-clone-https" data-link="{{$.CloneButtonOriginLink.HTTPS}}">
HTTPS
</button>
{{end}}
{{if $.CloneButtonShowSSH}}
<button class="ui basic small compact clone button gt-no-transition" id="repo-clone-ssh" data-link="{{$.CloneButtonOriginLink.SSH}}">
<button class="ui small compact clone button gt-no-transition" id="repo-clone-ssh" data-link="{{$.CloneButtonOriginLink.SSH}}">
SSH
</button>
{{end}}
Expand Down
8 changes: 6 additions & 2 deletions templates/repo/clone_script.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@

if (httpsBtn) {
httpsBtn.textContent = window.origin.split(':')[0].toUpperCase();
httpsBtn.classList[!isSSH ? 'add' : 'remove']('primary');
httpsBtn.classList.toggle('primary', !isSSH);
httpsBtn.classList.toggle('basic', isSSH);
}
if (sshBtn) {
sshBtn.classList.toggle('primary', isSSH);
sshBtn.classList.toggle('basic', !isSSH);
}
if (sshBtn) sshBtn.classList[isSSH ? 'add' : 'remove']('primary');

const btn = isSSH ? sshBtn : httpsBtn;
if (!btn) return;
Expand Down
Loading