Skip to content

Commit 34290a0

Browse files
Migrate border and margin classes to Tailwind (#29828)
Used all existing css vars, other migrations are 1:1. --------- Co-authored-by: wxiaoguang <[email protected]>
1 parent b251e60 commit 34290a0

File tree

17 files changed

+43
-48
lines changed

17 files changed

+43
-48
lines changed

tailwind.config.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,16 @@ export default {
5555
current: 'currentcolor',
5656
transparent: 'transparent',
5757
},
58+
borderRadius: {
59+
'none': '0',
60+
'sm': '2px',
61+
'DEFAULT': 'var(--border-radius)', // 4px
62+
'md': 'var(--border-radius-medium)', // 6px
63+
'lg': '8px',
64+
'xl': '12px',
65+
'2xl': '16px',
66+
'3xl': '24px',
67+
'full': 'var(--border-radius-circle)', // 50%
68+
},
5869
},
5970
};

templates/devtest/flex-list.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@
104104
</div>
105105

106106
<h1>If parent provides the padding/margin space:</h1>
107-
<div class="gt-border-secondary gt-py-4">
107+
<div class="tw-border tw-border-secondary gt-py-4">
108108
<div class="flex-list flex-space-fitted">
109109
<div class="flex-item">item 1 (no padding top)</div>
110110
<div class="flex-item">item 2 (no padding bottom)</div>

templates/devtest/gitea-ui.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@
9595

9696
<div>
9797
<h1>Loading</h1>
98-
<div class="is-loading small-loading-icon gt-border-secondary gt-py-2"><span>loading ...</span></div>
99-
<div class="is-loading gt-border-secondary gt-py-4">
98+
<div class="is-loading small-loading-icon tw-border tw-border-secondary gt-py-2"><span>loading ...</span></div>
99+
<div class="is-loading tw-border tw-border-secondary gt-py-4">
100100
<p>loading ...</p>
101101
<p>loading ...</p>
102102
<p>loading ...</p>

templates/org/header.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
{{if .Org.Visibility.IsLimited}}<span class="ui large basic horizontal label">{{ctx.Locale.Tr "org.settings.visibility.limited_shortname"}}</span>{{end}}
88
{{if .Org.Visibility.IsPrivate}}<span class="ui large basic horizontal label">{{ctx.Locale.Tr "org.settings.visibility.private_shortname"}}</span>{{end}}
99
</span>
10-
<span class="gt-df gt-ac gt-gap-2 gt-ml-auto gt-font-16 tw-whitespace-nowrap">
10+
<span class="gt-df gt-ac gt-gap-2 tw-ml-auto gt-font-16 tw-whitespace-nowrap">
1111
{{if .EnableFeed}}
1212
<a class="ui basic label button gt-mr-0" href="{{.Org.HomeLink}}.rss" data-tooltip-content="{{ctx.Locale.Tr "rss_feed"}}">
1313
{{svg "octicon-rss" 24}}

templates/repo/issue/filter_list.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
{{end}}
4444
{{end}}
4545
{{RenderLabel $.Context ctx.Locale .}}
46-
<p class="gt-ml-auto">{{template "repo/issue/labels/label_archived" .}}</p>
46+
<p class="tw-ml-auto">{{template "repo/issue/labels/label_archived" .}}</p>
4747
</a>
4848
{{end}}
4949
</div>
@@ -108,7 +108,7 @@
108108
</div>
109109
{{range .OpenProjects}}
110110
<a class="{{if $.ProjectID}}{{if eq $.ProjectID .ID}}active selected{{end}}{{end}} item gt-df" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&project={{.ID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">
111-
{{svg .IconName 18 "gt-mr-3 gt-shrink-0"}}<span class="gt-ellipsis">{{.Title}}</span>
111+
{{svg .IconName 18 "gt-mr-3 tw-shrink-0"}}<span class="gt-ellipsis">{{.Title}}</span>
112112
</a>
113113
{{end}}
114114
{{end}}

templates/repo/issue/labels/label_list.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
</div>
4545
<div class="label-operation gt-df">
4646
{{template "repo/issue/labels/label_archived" .}}
47-
<div class="gt-df gt-ml-auto">
47+
<div class="gt-df tw-ml-auto">
4848
{{if and (not $.PageIsOrgSettingsLabels) (not $.Repository.IsArchived) (or $.CanWriteIssues $.CanWritePulls)}}
4949
<a class="edit-label-button" href="#" data-id="{{.ID}}" data-title="{{.Name}}" {{if .Exclusive}}data-exclusive{{end}} {{if gt .ArchivedUnix 0}}data-is-archived{{end}} data-num-issues="{{.NumIssues}}" data-description="{{.Description}}" data-color={{.Color}}>{{svg "octicon-pencil"}} {{ctx.Locale.Tr "repo.issues.label_edit"}}</a>
5050
<a class="delete-button" href="#" data-url="{{$.Link}}/delete" data-id="{{.ID}}">{{svg "octicon-trash"}} {{ctx.Locale.Tr "repo.issues.label_delete"}}</a>

templates/repo/pulls/tab_menu.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
{{ctx.Locale.Tr "repo.pulls.tab_files"}}
1616
<span class="ui small label">{{if .NumFiles}}{{.NumFiles}}{{else}}-{{end}}</span>
1717
</a>
18-
<span class="item gt-ml-auto gt-pr-0 gt-font-bold gt-df gt-ac gt-gap-3">
18+
<span class="item tw-ml-auto gt-pr-0 gt-font-bold gt-df gt-ac gt-gap-3">
1919
<span><span class="text green">{{if .Diff.TotalAddition}}+{{.Diff.TotalAddition}}{{end}}</span> <span class="text red">{{if .Diff.TotalDeletion}}-{{.Diff.TotalDeletion}}{{end}}</span></span>
2020
<span class="diff-stats-bar">
2121
<div class="diff-stats-add-bar" style="width: {{Eval 100 "*" .Diff.TotalAddition "/" "(" .Diff.TotalAddition "+" .Diff.TotalDeletion "+" 0.0 ")"}}%"></div>

templates/repo/settings/options.tmpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,12 @@
116116
<th></th>
117117
</tr>
118118
</thead>
119-
{{end}}
120119
{{if $modifyBrokenPullMirror}}
121120
{{/* even if a repo is a pull mirror (IsMirror=true), the PullMirror might still be nil if the mirror migration is broken */}}
122121
<tbody>
123122
<tr>
124123
<td colspan="4">
125-
<div class="text red gt-py-4 gt-border-secondary-bottom">{{ctx.Locale.Tr "repo.settings.mirror_settings.direction.pull"}}: {{ctx.Locale.Tr "error.occurred"}}</div>
124+
<div class="text red gt-py-4">{{ctx.Locale.Tr "repo.settings.mirror_settings.direction.pull"}}: {{ctx.Locale.Tr "error.occurred"}}</div>
126125
</td>
127126
</tr>
128127
</tbody>
@@ -201,8 +200,9 @@
201200
</td>
202201
</tr>
203202
</tbody>
203+
{{end}}{{/* end if: $modifyBrokenPullMirror / $isWorkingPullMirror */}}
204204
</table>
205-
{{end}}{{/* end if: IsMirror */}}
205+
{{end}}{{/* end if .Repository.IsMirror */}}
206206

207207
<table class="ui table">
208208
<thead>

templates/status/500.tmpl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
</head>
1717
<body>
1818
<div class="full height">
19-
<nav class="ui secondary menu gt-border-secondary-bottom">
19+
<nav class="ui secondary menu">
2020
<div class="ui container gt-df">
2121
<div class="item gt-f1">
2222
<a href="{{AppSubUrl}}/" aria-label="{{ctx.Locale.Tr "home"}}">
@@ -28,6 +28,7 @@
2828
</div>
2929
</div>
3030
</nav>
31+
<div class="divider gt-my-0"></div>
3132
<div role="main" class="page-content status-page-500">
3233
<div class="ui container" >
3334
<style> .ui.message.flash-message { text-align: left; } </style>

templates/user/dashboard/navbar.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878

7979
{{if .ContextUser.IsOrganization}}
8080
<div class="right menu">
81-
<a class="{{if .PageIsNews}}active {{end}}item gt-ml-auto" href="{{.ContextUser.DashboardLink}}{{if .Team}}/{{PathEscape .Team.Name}}{{end}}">
81+
<a class="{{if .PageIsNews}}active {{end}}item tw-ml-auto" href="{{.ContextUser.DashboardLink}}{{if .Team}}/{{PathEscape .Team.Name}}{{end}}">
8282
{{svg "octicon-rss"}}&nbsp;{{ctx.Locale.Tr "activities"}}
8383
</a>
8484
{{if not .UnitIssuesGlobalDisabled}}

0 commit comments

Comments
 (0)