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

Tweak repo buttons on mobile and labeled button border-radius #30503

Merged
merged 5 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions templates/repo/header.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -91,28 +91,28 @@
>
{{svg "octicon-repo-forked"}}<span class="text not-mobile">{{ctx.Locale.Tr "repo.fork"}}</span>
</a>
<div class="ui small modal" id="fork-repo-modal">
<div class="header">
{{ctx.Locale.Tr "repo.already_forked" .Name}}
</div>
<div class="content tw-text-left">
<div class="ui list">
{{range $.UserAndOrgForks}}
<div class="ui item tw-py-2">
<a href="{{.Link}}">{{svg "octicon-repo-forked" 16 "tw-mr-2"}}{{.FullName}}</a>
</div>
{{end}}
</div>
{{if $.CanSignedUserFork}}
<div class="divider"></div>
<a href="{{$.RepoLink}}/fork">{{ctx.Locale.Tr "repo.fork_to_different_account"}}</a>
{{end}}
</div>
</div>
<a class="ui basic label" href="{{.Link}}/forks">
{{CountFmt .NumForks}}
</a>
</div>
<div class="ui small modal" id="fork-repo-modal">
<div class="header">
{{ctx.Locale.Tr "repo.already_forked" .Name}}
</div>
<div class="content tw-text-left">
<div class="ui list">
{{range $.UserAndOrgForks}}
<div class="ui item tw-py-2">
<a href="{{.Link}}">{{svg "octicon-repo-forked" 16 "tw-mr-2"}}{{.FullName}}</a>
</div>
{{end}}
</div>
{{if $.CanSignedUserFork}}
<div class="divider"></div>
<a href="{{$.RepoLink}}/fork">{{ctx.Locale.Tr "repo.fork_to_different_account"}}</a>
{{end}}
</div>
</div>
{{end}}
</div>
{{end}}
Expand Down
2 changes: 1 addition & 1 deletion templates/repo/star_unstar.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{{if $.IsStaringRepo}}{{$buttonText = ctx.Locale.Tr "repo.unstar"}}{{end}}
<button type="submit" class="ui compact small basic button"{{if not $.IsSigned}} disabled{{end}} aria-label="{{$buttonText}}">
{{if $.IsStaringRepo}}{{svg "octicon-star-fill"}}{{else}}{{svg "octicon-star"}}{{end}}
<span class="not-mobile" aria-hidden="true">{{$buttonText}}</span>
<span aria-hidden="true">{{$buttonText}}</span>
</button>
<a hx-boost="false" class="ui basic label" href="{{$.RepoLink}}/stars">
{{CountFmt .Repository.NumStars}}
Expand Down
2 changes: 1 addition & 1 deletion templates/repo/watch_unwatch.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{{if $.IsWatchingRepo}}{{$buttonText = ctx.Locale.Tr "repo.unwatch"}}{{end}}
<button type="submit" class="ui compact small basic button"{{if not $.IsSigned}} disabled{{end}} aria-label="{{$buttonText}}">
{{svg "octicon-eye"}}
<span class="not-mobile" aria-hidden="true">{{$buttonText}}</span>
<span aria-hidden="true">{{$buttonText}}</span>
</button>
<a hx-boost="false" class="ui basic label" href="{{.RepoLink}}/watchers">
{{CountFmt .Repository.NumWatches}}
Expand Down
10 changes: 10 additions & 0 deletions web_src/css/modules/button.css
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,23 @@
}
.ui.labeled.button > .button {
margin: 0;
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
.ui.labeled.button > .label {
display: flex;
align-items: center;
margin: 0 0 0 -1px !important;
font-size: 1em;
border-color: var(--color-light-border);
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
.ui.labeled.button > .label:hover {
background: var(--color-hover);
}
.ui.labeled.button > .button:hover + .label {
border-left-color: var(--color-secondary-dark-2);
}

.ui.button > .icon:not(.button) {
Expand Down
2 changes: 1 addition & 1 deletion web_src/css/modules/label.css
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ a.ui.label:hover {
a.ui.basic.label:hover {
text-decoration: none;
color: var(--color-text);
border-color: var(--color-light-border);
border-color: var(--color-secondary-dark-2);
background: var(--color-hover);
}

Expand Down
14 changes: 9 additions & 5 deletions web_src/css/repo/header.css
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@
gap: 0.25em;
}

.repo-buttons .ui.labeled.button > .label:hover {
color: var(--color-primary-light-2);
background: var(--color-light);
}

.repo-buttons button[disabled] ~ .label {
opacity: var(--opacity-disabled);
color: var(--color-text-dark);
Expand All @@ -67,3 +62,12 @@
.repo-buttons .ui.labeled.button.disabled > .button {
pointer-events: none !important;
}

@media (max-width: 767.98px) {
.repo-buttons .ui.button,
.repo-buttons .ui.label {
padding-left: 8px;
padding-right: 8px;
margin: 0;
}
}