Skip to content

Commit 012b804

Browse files
wxiaoguangsilverwindGiteaBot
authored
Clarify "text-align" CSS helpers, fix clone button padding (#25763) (#25764)
Backport #25763 Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: Giteabot <teabot@gitea.io>
1 parent 372b622 commit 012b804

10 files changed

+16
-15
lines changed

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-4
Original file line numberDiff line numberDiff line change
@@ -8,9 +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; }
1411
.gt-jc { justify-content: center !important; }
1512
.gt-js { justify-content: flex-start !important; }
1613
.gt-je { justify-content: flex-end !important; }
@@ -21,7 +18,6 @@ Gitea's private styles use `g-` prefix.
2118
.gt-vm { vertical-align: middle !important; }
2219
.gt-w-100 { width: 100% !important; }
2320
.gt-h-100 { height: 100% !important; }
24-
.gt-br-0 { border-radius: 0 !important; }
2521

2622
.gt-mono {
2723
font-family: var(--fonts-monospace) !important;
@@ -88,6 +84,10 @@ Gitea's private styles use `g-` prefix.
8884
.gt-float-right { float: right !important; }
8985
.gt-clear-both { clear: both !important; }
9086

87+
.gt-text-center { text-align: center !important; }
88+
.gt-text-left { text-align: left !important; }
89+
.gt-text-right { text-align: right !important; }
90+
9191
.gt-font-light { font-weight: var(--font-weight-light) !important; }
9292
.gt-font-normal { font-weight: var(--font-weight-normal) !important; }
9393
.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
@@ -194,6 +194,7 @@
194194

195195
.repository #clone-panel #repo-clone-url {
196196
width: 320px;
197+
border-radius: 0;
197198
}
198199

199200
@media (min-width: 768px) and (max-width: 991.98px) {
@@ -2662,7 +2663,7 @@
26622663
height: 30px;
26632664
}
26642665

2665-
.repo-button-row .button.dropdown {
2666+
.repo-button-row .button.dropdown:not(.icon) {
26662667
padding-right: 22px !important; /* normal buttons have !important paddings, so we need to override it for dropdown (Add File) icons */
26672668
}
26682669

web_src/js/features/common-global.js

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

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

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

0 commit comments

Comments
 (0)