Skip to content

Commit cc00fd5

Browse files
wxiaoguangGiteaBot
andauthored
Clarify "text-align" CSS helpers, fix clone button padding (#25763)
Changes: * Rename gt-tl/gt-tc/gt-tr to gt-text-left/gt-text-center/gt-text-right * The gt-ab and gt-br-0 are removed because they are not needed anymore * Fix the clone dropdown button padding by ":not(.icon)" Before: <details> ![image](https://github.com/go-gitea/gitea/assets/2114189/eb030633-622c-4ca7-8e88-ce010d9f51a6) </details> After: <details> ![image](https://github.com/go-gitea/gitea/assets/2114189/64c09403-bf21-439c-88f1-780b34ccab6b) </details> Fixes #25758 Co-authored-by: Giteabot <teabot@gitea.io>
1 parent 62f3c0f commit cc00fd5

11 files changed

+17
-17
lines changed

templates/projects/list.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{{if .CanWriteProjects}}
2-
<div class="gt-tr">
2+
<div class="gt-text-right">
33
<a class="ui small green button" href="{{$.Link}}/new">{{.locale.Tr "repo.projects.new"}}</a>
44
</div>
55
<div class="divider"></div>

templates/repo/clone_buttons.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
SSH
1010
</button>
1111
{{end}}
12-
<input id="repo-clone-url" size="20" class="js-clone-url gt-br-0" value="{{$.CloneButtonOriginLink.HTTPS}}" readonly>
12+
<input id="repo-clone-url" size="20" class="js-clone-url" value="{{$.CloneButtonOriginLink.HTTPS}}" readonly>
1313
<button class="ui basic small compact icon button" id="clipboard-btn" data-tooltip-content="{{.locale.Tr "copy_url"}}" data-clipboard-target="#repo-clone-url" aria-label="{{.locale.Tr "copy_url"}}">
1414
{{svg "octicon-copy" 14}}
1515
</button>

templates/repo/commit_page.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@
189189
</div>
190190
</div>
191191
{{if .Commit.Signature}}
192-
<div class="ui bottom attached message gt-tl gt-df gt-ac gt-sb commit-header-row gt-fw {{$class}}">
192+
<div class="ui bottom attached message gt-text-left gt-df gt-ac gt-sb commit-header-row gt-fw {{$class}}">
193193
<div class="gt-df gt-ac">
194194
{{if .Verification.Verified}}
195195
{{if ne .Verification.SigningUser.ID 0}}

templates/repo/header.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
<div class="header">
122122
{{$.locale.Tr "repo.already_forked" .Name}}
123123
</div>
124-
<div class="content gt-tl">
124+
<div class="content gt-text-left">
125125
<div class="ui list">
126126
{{range $.UserAndOrgForks}}
127127
<div class="ui item gt-py-3">

templates/repo/migrate/migrate.tmpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
{{svg (printf "gitea-%s" .Name) 184}}
1717
{{end}}
1818
<div class="content">
19-
<div class="header gt-tc">
19+
<div class="header gt-text-center">
2020
{{.Title}}
2121
</div>
22-
<div class="description gt-tc">
22+
<div class="description gt-text-center">
2323
{{(printf "repo.migrate.%s.description" .Name) | $.locale.Tr}}
2424
</div>
2525
</div>

templates/repo/unicode_escape_prompt.tmpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{{if .EscapeStatus}}
22
{{if .EscapeStatus.HasInvisible}}
3-
<div class="ui error message unicode-escape-prompt gt-tl">
3+
<div class="ui error message unicode-escape-prompt gt-text-left">
44
<button class="close icon hide-panel button" data-panel-closest=".message">{{svg "octicon-x" 16 "close inside"}}</button>
55
<div class="header">
66
{{$.root.locale.Tr "repo.invisible_runes_header"}}
@@ -11,7 +11,7 @@
1111
{{end}}
1212
</div>
1313
{{else if .EscapeStatus.HasAmbiguous}}
14-
<div class="ui warning message unicode-escape-prompt gt-tl">
14+
<div class="ui warning message unicode-escape-prompt gt-text-left">
1515
<button class="close icon hide-panel button" data-panel-closest=".message">{{svg "octicon-x" 16 "close inside"}}</button>
1616
<div class="header">
1717
{{$.root.locale.Tr "repo.ambiguous_runes_header"}}

templates/user/auth/captcha.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<div id="captcha" data-captcha-type="m-captcha" class="m-captcha" data-sitekey="{{.McaptchaSitekey}}" data-instance-url="{{.McaptchaURL}}"></div>
2323
</div>
2424
{{else if eq .CaptchaType "cfturnstile"}}
25-
<div class="inline field captcha-field gt-tc">
25+
<div class="inline field captcha-field gt-text-center">
2626
<div id="captcha" data-captcha-type="cf-turnstile" data-sitekey="{{.CfTurnstileSitekey}}"></div>
2727
</div>
2828
{{end}}{{end}}

web_src/css/helpers.css

+4-5
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ Gitea's private styles use `g-` prefix.
88
.gt-dif { display: inline-flex !important; }
99
.gt-dib { display: inline-block !important; }
1010
.gt-ac { align-items: center !important; }
11-
.gt-ab { align-items: baseline !important; }
12-
.gt-tc { text-align: center !important; }
13-
.gt-tl { text-align: left !important; }
14-
.gt-tr { text-align: right !important; } /* TODO: rename these to "gt-text-right", etc. there are only a few */
1511
.gt-jc { justify-content: center !important; }
1612
.gt-js { justify-content: flex-start !important; }
1713
.gt-je { justify-content: flex-end !important; }
@@ -22,7 +18,6 @@ Gitea's private styles use `g-` prefix.
2218
.gt-vm { vertical-align: middle !important; }
2319
.gt-w-100 { width: 100% !important; }
2420
.gt-h-100 { height: 100% !important; }
25-
.gt-br-0 { border-radius: 0 !important; }
2621

2722
.gt-mono {
2823
font-family: var(--fonts-monospace) !important;
@@ -90,6 +85,10 @@ Gitea's private styles use `g-` prefix.
9085
.gt-float-right { float: right !important; }
9186
.gt-clear-both { clear: both !important; }
9287

88+
.gt-text-center { text-align: center !important; }
89+
.gt-text-left { text-align: left !important; }
90+
.gt-text-right { text-align: right !important; }
91+
9392
.gt-font-light { font-weight: var(--font-weight-light) !important; }
9493
.gt-font-normal { font-weight: var(--font-weight-normal) !important; }
9594
.gt-font-medium { font-weight: var(--font-weight-medium) !important; }

web_src/css/repo.css

+2-1
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@
190190

191191
.repository #clone-panel #repo-clone-url {
192192
width: 320px;
193+
border-radius: 0;
193194
}
194195

195196
@media (min-width: 768px) and (max-width: 991.98px) {
@@ -2655,7 +2656,7 @@
26552656
height: 30px;
26562657
}
26572658

2658-
.repo-button-row .button.dropdown {
2659+
.repo-button-row .button.dropdown:not(.icon) {
26592660
padding-right: 22px !important; /* normal buttons have !important paddings, so we need to override it for dropdown (Add File) icons */
26602661
}
26612662

web_src/js/features/common-global.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ export function initGlobalDropzone() {
237237
// Create a "Copy Link" element, to conveniently copy the image
238238
// or file link as Markdown to the clipboard
239239
const copyLinkElement = document.createElement('div');
240-
copyLinkElement.className = 'gt-tc';
240+
copyLinkElement.className = 'gt-text-center';
241241
// The a element has a hardcoded cursor: pointer because the default is overridden by .dropzone
242242
copyLinkElement.innerHTML = `<a href="#" style="cursor: pointer;">${svg('octicon-copy', 14, 'copy link')} Copy link</a>`;
243243
copyLinkElement.addEventListener('click', (e) => {

web_src/js/features/repo-issue-content.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function showContentHistoryDetail(issueBaseUrl, commentId, historyId, itemTitleH
2424
</div>
2525
</div>
2626
</div>
27-
<div class="comment-diff-data gt-tl gt-p-3 is-loading"></div>
27+
<div class="comment-diff-data gt-text-left gt-p-3 is-loading"></div>
2828
</div>`);
2929
$dialog.appendTo($('body'));
3030
$dialog.find('.dialog-header-options').dropdown({

0 commit comments

Comments
 (0)