Skip to content

Commit 68ec9b4

Browse files
authored
Migrate margin and padding helpers to tailwind (#30043)
This will conclude the refactor of 1:1 class replacements to tailwind, except `gt-hidden`. Commands ran: ```bash perl -p -i -e 's#gt-(p|m)([lrtbxy])?-0#tw-$1$2-0#g' {web_src/js,templates,routers,services}/**/* perl -p -i -e 's#gt-(p|m)([lrtbxy])?-1#tw-$1$2-0.5#g' {web_src/js,templates,routers,services}/**/* perl -p -i -e 's#gt-(p|m)([lrtbxy])?-2#tw-$1$2-1#g' {web_src/js,templates,routers,services}/**/* perl -p -i -e 's#gt-(p|m)([lrtbxy])?-3#tw-$1$2-2#g' {web_src/js,templates,routers,services}/**/* perl -p -i -e 's#gt-(p|m)([lrtbxy])?-4#tw-$1$2-4#g' {web_src/js,templates,routers,services}/**/* perl -p -i -e 's#gt-(p|m)([lrtbxy])?-5#tw-$1$2-8#g' {web_src/js,templates,routers,services}/**/* ```
1 parent 4734d43 commit 68ec9b4

File tree

178 files changed

+605
-703
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

178 files changed

+605
-703
lines changed

routers/web/repo/blame.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ func renderBlame(ctx *context.Context, blameParts []*git.BlamePart, commitNames
280280
if commit.User != nil {
281281
avatar = string(avatarUtils.Avatar(commit.User, 18))
282282
} else {
283-
avatar = string(avatarUtils.AvatarByEmail(commit.Author.Email, commit.Author.Name, 18, "gt-mr-3"))
283+
avatar = string(avatarUtils.AvatarByEmail(commit.Author.Email, commit.Author.Name, 18, "tw-mr-2"))
284284
}
285285

286286
br.Avatar = gotemplate.HTML(avatar)

routers/web/repo/issue_content_history.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ func GetContentHistoryList(ctx *context.Context) {
7070
}
7171

7272
src := html.EscapeString(item.UserAvatarLink)
73-
class := avatars.DefaultAvatarClass + " gt-mr-3"
73+
class := avatars.DefaultAvatarClass + " tw-mr-2"
7474
name := html.EscapeString(username)
7575
avatarHTML := string(templates.AvatarHTML(src, 28, class, username))
7676
timeSinceText := string(timeutil.TimeSinceUnix(item.EditedUnix, ctx.Locale))

routers/web/repo/view.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -919,9 +919,9 @@ func prepareOpenWithEditorApps(ctx *context.Context) {
919919
schema, _, _ := strings.Cut(app.OpenURL, ":")
920920
var iconHTML template.HTML
921921
if schema == "vscode" || schema == "vscodium" || schema == "jetbrains" {
922-
iconHTML = svg.RenderHTML(fmt.Sprintf("gitea-%s", schema), 16, "gt-mr-3")
922+
iconHTML = svg.RenderHTML(fmt.Sprintf("gitea-%s", schema), 16, "tw-mr-2")
923923
} else {
924-
iconHTML = svg.RenderHTML("gitea-git", 16, "gt-mr-3") // TODO: it could support user's customized icon in the future
924+
iconHTML = svg.RenderHTML("gitea-git", 16, "tw-mr-2") // TODO: it could support user's customized icon in the future
925925
}
926926
tmplApps = append(tmplApps, map[string]any{
927927
"DisplayName": app.DisplayName,

services/auth/source/oauth2/providers.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ func (p *AuthSourceProvider) DisplayName() string {
5959

6060
func (p *AuthSourceProvider) IconHTML(size int) template.HTML {
6161
if p.iconURL != "" {
62-
img := fmt.Sprintf(`<img class="tw-object-contain gt-mr-3" width="%d" height="%d" src="%s" alt="%s">`,
62+
img := fmt.Sprintf(`<img class="tw-object-contain tw-mr-2" width="%d" height="%d" src="%s" alt="%s">`,
6363
size,
6464
size,
6565
html.EscapeString(p.iconURL), html.EscapeString(p.DisplayName()),

services/auth/source/oauth2/providers_base.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ func (b *BaseProvider) IconHTML(size int) template.HTML {
3535
case "github":
3636
svgName = "octicon-mark-github"
3737
}
38-
svgHTML := svg.RenderHTML(svgName, size, "gt-mr-3")
38+
svgHTML := svg.RenderHTML(svgName, size, "tw-mr-2")
3939
if svgHTML == "" {
4040
log.Error("No SVG icon for oauth2 provider %q", b.name)
41-
svgHTML = svg.RenderHTML("gitea-openid", size, "gt-mr-3")
41+
svgHTML = svg.RenderHTML("gitea-openid", size, "tw-mr-2")
4242
}
4343
return svgHTML
4444
}

services/auth/source/oauth2/providers_openid.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func (o *OpenIDProvider) DisplayName() string {
2929

3030
// IconHTML returns icon HTML for this provider
3131
func (o *OpenIDProvider) IconHTML(size int) template.HTML {
32-
return svg.RenderHTML("gitea-openid", size, "gt-mr-3")
32+
return svg.RenderHTML("gitea-openid", size, "tw-mr-2")
3333
}
3434

3535
// CreateGothProvider creates a GothProvider from this Provider

templates/admin/config.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@
229229
<dt>{{ctx.Locale.Tr "admin.config.mailer_user"}}</dt>
230230
<dd>{{if .Mailer.User}}{{.Mailer.User}}{{else}}(empty){{end}}</dd>
231231
<div class="divider"></div>
232-
<dt class="gt-py-2">{{ctx.Locale.Tr "admin.config.send_test_mail"}}</dt>
232+
<dt class="tw-py-1">{{ctx.Locale.Tr "admin.config.send_test_mail"}}</dt>
233233
<dd>
234234
<form class="ui form ignore-dirty" action="{{AppSubUrl}}/admin/config/test_mail" method="post">
235235
{{.CsrfTokenHtml}}
@@ -332,7 +332,7 @@
332332
{{range $loggerName, $loggerDetail := .Loggers}}
333333
<dt>{{ctx.Locale.Tr "admin.config.logger_name_fmt" $loggerName}}</dt>
334334
{{if $loggerDetail.IsEnabled}}
335-
<dd><pre class="gt-m-0">{{$loggerDetail.EventWriters | JsonUtils.EncodeToString | JsonUtils.PrettyIndent}}</pre></dd>
335+
<dd><pre class="tw-m-0">{{$loggerDetail.EventWriters | JsonUtils.EncodeToString | JsonUtils.PrettyIndent}}</pre></dd>
336336
{{else}}
337337
<dd>{{ctx.Locale.Tr "admin.config.disabled_logger"}}</dd>
338338
{{end}}

templates/admin/config_settings.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<div class="field">
2929
<details>
3030
<summary>{{ctx.Locale.Tr "admin.config.open_with_editor_app_help"}}</summary>
31-
<pre class="gt-px-4">{{.DefaultOpenWithEditorAppsString}}</pre>
31+
<pre class="tw-px-4">{{.DefaultOpenWithEditorAppsString}}</pre>
3232
</details>
3333
</div>
3434
<div class="field">

templates/admin/cron.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
</h4>
66
<div class="ui attached table segment">
77
<form method="post" action="{{AppSubUrl}}/admin">
8-
<table class="ui very basic striped table unstackable gt-mb-0">
8+
<table class="ui very basic striped table unstackable tw-mb-0">
99
<thead>
1010
<tr>
1111
<th></th>

templates/admin/dashboard.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<div class="ui attached table segment">
1212
<form method="post" action="{{AppSubUrl}}/admin">
1313
{{.CsrfTokenHtml}}
14-
<table class="ui very basic table gt-mt-0 gt-px-4">
14+
<table class="ui very basic table tw-mt-0 tw-px-4">
1515
<tbody>
1616
<tr>
1717
<td>{{ctx.Locale.Tr "admin.dashboard.delete_inactive_accounts"}}</td>

0 commit comments

Comments
 (0)