Skip to content

Commit e045b95

Browse files
committed
Add borderRadius config to tailwind and migrate a few classes
1 parent 3f1e489 commit e045b95

File tree

13 files changed

+25
-29
lines changed

13 files changed

+25
-29
lines changed

tailwind.config.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,17 @@ 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+
'circle': 'var(--border-radius-circle)', // 50%
68+
'full': '9999px',
69+
},
5870
},
5971
};

templates/devtest/gitea-ui.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<link rel="stylesheet" href="{{AssetUrlPrefix}}/css/devtest.css?v={{AssetVersion}}">
33
<div class="page-content devtest ui container">
44
<div>
5-
<h1>Button</h1>
5+
<h1 class="tw-rounded-circle">Button</h1>
66
<div>
77
Style:
88
<label><input type="checkbox" name="button-style-compact" value="compact">compact</label>

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/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}}

web_src/css/helpers.css

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,6 @@ Gitea's private styles use `g-` prefix.
5252
.gt-font-semibold { font-weight: var(--font-weight-semibold) !important; }
5353
.gt-font-bold { font-weight: var(--font-weight-bold) !important; }
5454

55-
.gt-rounded { border-radius: var(--border-radius) !important; }
56-
.gt-rounded-top { border-radius: var(--border-radius) var(--border-radius) 0 0 !important; }
57-
.gt-rounded-bottom { border-radius: 0 0 var(--border-radius) var(--border-radius) !important; }
58-
.gt-rounded-left { border-radius: var(--border-radius) 0 0 var(--border-radius) !important; }
59-
.gt-rounded-right { border-radius: 0 var(--border-radius) var(--border-radius) 0 !important; }
60-
6155
.gt-border-secondary { border: 1px solid var(--color-secondary) !important; }
6256
.gt-border-secondary-top { border-top: 1px solid var(--color-secondary) !important; }
6357
.gt-border-secondary-bottom { border-bottom: 1px solid var(--color-secondary) !important; }
@@ -121,14 +115,6 @@ Gitea's private styles use `g-` prefix.
121115
.gt-my-4 { margin-top: 1rem !important; margin-bottom: 1rem !important; }
122116
.gt-my-5 { margin-top: 2rem !important; margin-bottom: 2rem !important; }
123117

124-
.gt-m-auto { margin: auto !important; }
125-
.gt-mx-auto { margin-left: auto !important; margin-right: auto !important; }
126-
.gt-my-auto { margin-top: auto !important; margin-bottom: auto !important; }
127-
.gt-mt-auto { margin-top: auto !important; }
128-
.gt-mr-auto { margin-right: auto !important; }
129-
.gt-mb-auto { margin-bottom: auto !important; }
130-
.gt-ml-auto { margin-left: auto !important; }
131-
132118
.gt-p-0 { padding: 0 !important; }
133119
.gt-p-1 { padding: .125rem !important; }
134120
.gt-p-2 { padding: .25rem !important; }
@@ -199,8 +185,6 @@ Gitea's private styles use `g-` prefix.
199185
.gt-gap-y-4 { row-gap: 1rem !important; }
200186
.gt-gap-y-5 { row-gap: 2rem !important; }
201187

202-
.gt-shrink-0 { flex-shrink: 0 !important; }
203-
204188
.gt-font-12 { font-size: 12px !important }
205189
.gt-font-13 { font-size: 13px !important }
206190
.gt-font-14 { font-size: 14px !important }

web_src/js/components/DashboardRepoList.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ export default sfc; // activate the IDE's Vue plugin
409409
</div>
410410
</overflow-menu>
411411
</div>
412-
<div v-if="repos.length" class="ui attached table segment gt-rounded-bottom">
412+
<div v-if="repos.length" class="ui attached table segment tw-rounded-b">
413413
<ul class="repo-owner-name-list">
414414
<li class="gt-df gt-ac gt-py-3" v-for="repo, index in repos" :class="{'active': index === activeIndex}" :key="repo.id">
415415
<a class="repo-list-link muted" :href="repo.link">
@@ -466,7 +466,7 @@ export default sfc; // activate the IDE's Vue plugin
466466
<svg-icon name="octicon-plus"/>
467467
</a>
468468
</h4>
469-
<div v-if="organizations.length" class="ui attached table segment gt-rounded-bottom">
469+
<div v-if="organizations.length" class="ui attached table segment tw-rounded-b">
470470
<ul class="repo-owner-name-list">
471471
<li class="gt-df gt-ac gt-py-3" v-for="org in organizations" :key="org.name">
472472
<a class="repo-list-link muted" :href="subUrl + '/' + encodeURIComponent(org.name)">

web_src/js/components/RepoCodeFrequency.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ export default {
148148
{{ isLoading ? locale.loadingTitle : errorText ? locale.loadingTitleFailed: `Code frequency over the history of ${repoLink.slice(1)}` }}
149149
</div>
150150
<div class="gt-df ui segment main-graph">
151-
<div v-if="isLoading || errorText !== ''" class="gt-tc gt-m-auto">
151+
<div v-if="isLoading || errorText !== ''" class="gt-tc tw-m-auto">
152152
<div v-if="isLoading">
153153
<SvgIcon name="octicon-sync" class="gt-mr-3 job-status-rotate"/>
154154
{{ locale.loadingInfo }}

web_src/js/components/RepoContributors.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ export default {
353353
</div>
354354
</div>
355355
<div class="gt-df ui segment main-graph">
356-
<div v-if="isLoading || errorText !== ''" class="gt-tc gt-m-auto">
356+
<div v-if="isLoading || errorText !== ''" class="gt-tc tw-m-auto">
357357
<div v-if="isLoading">
358358
<SvgIcon name="octicon-sync" class="gt-mr-3 job-status-rotate"/>
359359
{{ locale.loadingInfo }}

web_src/js/components/RepoRecentCommits.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export default {
125125
{{ isLoading ? locale.loadingTitle : errorText ? locale.loadingTitleFailed: "Number of commits in the past year" }}
126126
</div>
127127
<div class="gt-df ui segment main-graph">
128-
<div v-if="isLoading || errorText !== ''" class="gt-tc gt-m-auto">
128+
<div v-if="isLoading || errorText !== ''" class="gt-tc tw-m-auto">
129129
<div v-if="isLoading">
130130
<SvgIcon name="octicon-sync" class="gt-mr-3 job-status-rotate"/>
131131
{{ locale.loadingInfo }}

web_src/js/features/repo-diff-commit.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function addLink(parent, href, text, tooltip) {
3939
link.href = href;
4040
link.textContent = text;
4141
if (tooltip) {
42-
link.classList.add('gt-border-secondary', 'gt-rounded');
42+
link.classList.add('gt-border-secondary', 'tw-rounded');
4343
link.setAttribute('data-tooltip-content', tooltip);
4444
}
4545
parent.append(link);

0 commit comments

Comments
 (0)