Skip to content

Commit

Permalink
Add borderRadius config to tailwind and migrate a few classes
Browse files Browse the repository at this point in the history
  • Loading branch information
silverwind committed Mar 15, 2024
1 parent 3f1e489 commit e754687
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 28 deletions.
12 changes: 12 additions & 0 deletions tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,17 @@ export default {
current: 'currentcolor',
transparent: 'transparent',
},
borderRadius: {
'none': '0',
'sm': '2px',
'DEFAULT': 'var(--border-radius)', // 4px
'md': 'var(--border-radius-medium)', // 6px
'lg': '8px',
'xl': '12px',
'2xl': '16px',
'3xl': '24px',
'circle': 'var(--border-radius-circle)', // 50%
'full': '9999px',
},
},
};
2 changes: 1 addition & 1 deletion templates/org/header.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{{if .Org.Visibility.IsLimited}}<span class="ui large basic horizontal label">{{ctx.Locale.Tr "org.settings.visibility.limited_shortname"}}</span>{{end}}
{{if .Org.Visibility.IsPrivate}}<span class="ui large basic horizontal label">{{ctx.Locale.Tr "org.settings.visibility.private_shortname"}}</span>{{end}}
</span>
<span class="gt-df gt-ac gt-gap-2 gt-ml-auto gt-font-16 tw-whitespace-nowrap">
<span class="gt-df gt-ac gt-gap-2 tw-ml-auto gt-font-16 tw-whitespace-nowrap">
{{if .EnableFeed}}
<a class="ui basic label button gt-mr-0" href="{{.Org.HomeLink}}.rss" data-tooltip-content="{{ctx.Locale.Tr "rss_feed"}}">
{{svg "octicon-rss" 24}}
Expand Down
4 changes: 2 additions & 2 deletions templates/repo/issue/filter_list.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
{{end}}
{{end}}
{{RenderLabel $.Context ctx.Locale .}}
<p class="gt-ml-auto">{{template "repo/issue/labels/label_archived" .}}</p>
<p class="tw-ml-auto">{{template "repo/issue/labels/label_archived" .}}</p>
</a>
{{end}}
</div>
Expand Down Expand Up @@ -108,7 +108,7 @@
</div>
{{range .OpenProjects}}
<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}}">
{{svg .IconName 18 "gt-mr-3 gt-shrink-0"}}<span class="gt-ellipsis">{{.Title}}</span>
{{svg .IconName 18 "gt-mr-3 tw-shrink-0"}}<span class="gt-ellipsis">{{.Title}}</span>
</a>
{{end}}
{{end}}
Expand Down
2 changes: 1 addition & 1 deletion templates/repo/issue/labels/label_list.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
</div>
<div class="label-operation gt-df">
{{template "repo/issue/labels/label_archived" .}}
<div class="gt-df gt-ml-auto">
<div class="gt-df tw-ml-auto">
{{if and (not $.PageIsOrgSettingsLabels) (not $.Repository.IsArchived) (or $.CanWriteIssues $.CanWritePulls)}}
<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>
<a class="delete-button" href="#" data-url="{{$.Link}}/delete" data-id="{{.ID}}">{{svg "octicon-trash"}} {{ctx.Locale.Tr "repo.issues.label_delete"}}</a>
Expand Down
2 changes: 1 addition & 1 deletion templates/repo/pulls/tab_menu.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
{{ctx.Locale.Tr "repo.pulls.tab_files"}}
<span class="ui small label">{{if .NumFiles}}{{.NumFiles}}{{else}}-{{end}}</span>
</a>
<span class="item gt-ml-auto gt-pr-0 gt-font-bold gt-df gt-ac gt-gap-3">
<span class="item tw-ml-auto gt-pr-0 gt-font-bold gt-df gt-ac gt-gap-3">
<span><span class="text green">{{if .Diff.TotalAddition}}+{{.Diff.TotalAddition}}{{end}}</span> <span class="text red">{{if .Diff.TotalDeletion}}-{{.Diff.TotalDeletion}}{{end}}</span></span>
<span class="diff-stats-bar">
<div class="diff-stats-add-bar" style="width: {{Eval 100 "*" .Diff.TotalAddition "/" "(" .Diff.TotalAddition "+" .Diff.TotalDeletion "+" 0.0 ")"}}%"></div>
Expand Down
2 changes: 1 addition & 1 deletion templates/user/dashboard/navbar.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@

{{if .ContextUser.IsOrganization}}
<div class="right menu">
<a class="{{if .PageIsNews}}active {{end}}item gt-ml-auto" href="{{.ContextUser.DashboardLink}}{{if .Team}}/{{PathEscape .Team.Name}}{{end}}">
<a class="{{if .PageIsNews}}active {{end}}item tw-ml-auto" href="{{.ContextUser.DashboardLink}}{{if .Team}}/{{PathEscape .Team.Name}}{{end}}">
{{svg "octicon-rss"}}&nbsp;{{ctx.Locale.Tr "activities"}}
</a>
{{if not .UnitIssuesGlobalDisabled}}
Expand Down
16 changes: 0 additions & 16 deletions web_src/css/helpers.css
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,6 @@ Gitea's private styles use `g-` prefix.
.gt-font-semibold { font-weight: var(--font-weight-semibold) !important; }
.gt-font-bold { font-weight: var(--font-weight-bold) !important; }

.gt-rounded { border-radius: var(--border-radius) !important; }
.gt-rounded-top { border-radius: var(--border-radius) var(--border-radius) 0 0 !important; }
.gt-rounded-bottom { border-radius: 0 0 var(--border-radius) var(--border-radius) !important; }
.gt-rounded-left { border-radius: var(--border-radius) 0 0 var(--border-radius) !important; }
.gt-rounded-right { border-radius: 0 var(--border-radius) var(--border-radius) 0 !important; }

.gt-border-secondary { border: 1px solid var(--color-secondary) !important; }
.gt-border-secondary-top { border-top: 1px solid var(--color-secondary) !important; }
.gt-border-secondary-bottom { border-bottom: 1px solid var(--color-secondary) !important; }
Expand Down Expand Up @@ -121,14 +115,6 @@ Gitea's private styles use `g-` prefix.
.gt-my-4 { margin-top: 1rem !important; margin-bottom: 1rem !important; }
.gt-my-5 { margin-top: 2rem !important; margin-bottom: 2rem !important; }

.gt-m-auto { margin: auto !important; }
.gt-mx-auto { margin-left: auto !important; margin-right: auto !important; }
.gt-my-auto { margin-top: auto !important; margin-bottom: auto !important; }
.gt-mt-auto { margin-top: auto !important; }
.gt-mr-auto { margin-right: auto !important; }
.gt-mb-auto { margin-bottom: auto !important; }
.gt-ml-auto { margin-left: auto !important; }

.gt-p-0 { padding: 0 !important; }
.gt-p-1 { padding: .125rem !important; }
.gt-p-2 { padding: .25rem !important; }
Expand Down Expand Up @@ -199,8 +185,6 @@ Gitea's private styles use `g-` prefix.
.gt-gap-y-4 { row-gap: 1rem !important; }
.gt-gap-y-5 { row-gap: 2rem !important; }

.gt-shrink-0 { flex-shrink: 0 !important; }

.gt-font-12 { font-size: 12px !important }
.gt-font-13 { font-size: 13px !important }
.gt-font-14 { font-size: 14px !important }
Expand Down
4 changes: 2 additions & 2 deletions web_src/js/components/DashboardRepoList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ export default sfc; // activate the IDE's Vue plugin
</div>
</overflow-menu>
</div>
<div v-if="repos.length" class="ui attached table segment gt-rounded-bottom">
<div v-if="repos.length" class="ui attached table segment tw-rounded-b">
<ul class="repo-owner-name-list">
<li class="gt-df gt-ac gt-py-3" v-for="repo, index in repos" :class="{'active': index === activeIndex}" :key="repo.id">
<a class="repo-list-link muted" :href="repo.link">
Expand Down Expand Up @@ -466,7 +466,7 @@ export default sfc; // activate the IDE's Vue plugin
<svg-icon name="octicon-plus"/>
</a>
</h4>
<div v-if="organizations.length" class="ui attached table segment gt-rounded-bottom">
<div v-if="organizations.length" class="ui attached table segment tw-rounded-b">
<ul class="repo-owner-name-list">
<li class="gt-df gt-ac gt-py-3" v-for="org in organizations" :key="org.name">
<a class="repo-list-link muted" :href="subUrl + '/' + encodeURIComponent(org.name)">
Expand Down
2 changes: 1 addition & 1 deletion web_src/js/components/RepoCodeFrequency.vue
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export default {
{{ isLoading ? locale.loadingTitle : errorText ? locale.loadingTitleFailed: `Code frequency over the history of ${repoLink.slice(1)}` }}
</div>
<div class="gt-df ui segment main-graph">
<div v-if="isLoading || errorText !== ''" class="gt-tc gt-m-auto">
<div v-if="isLoading || errorText !== ''" class="gt-tc tw-m-auto">
<div v-if="isLoading">
<SvgIcon name="octicon-sync" class="gt-mr-3 job-status-rotate"/>
{{ locale.loadingInfo }}
Expand Down
2 changes: 1 addition & 1 deletion web_src/js/components/RepoContributors.vue
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ export default {
</div>
</div>
<div class="gt-df ui segment main-graph">
<div v-if="isLoading || errorText !== ''" class="gt-tc gt-m-auto">
<div v-if="isLoading || errorText !== ''" class="gt-tc tw-m-auto">
<div v-if="isLoading">
<SvgIcon name="octicon-sync" class="gt-mr-3 job-status-rotate"/>
{{ locale.loadingInfo }}
Expand Down
2 changes: 1 addition & 1 deletion web_src/js/components/RepoRecentCommits.vue
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export default {
{{ isLoading ? locale.loadingTitle : errorText ? locale.loadingTitleFailed: "Number of commits in the past year" }}
</div>
<div class="gt-df ui segment main-graph">
<div v-if="isLoading || errorText !== ''" class="gt-tc gt-m-auto">
<div v-if="isLoading || errorText !== ''" class="gt-tc tw-m-auto">
<div v-if="isLoading">
<SvgIcon name="octicon-sync" class="gt-mr-3 job-status-rotate"/>
{{ locale.loadingInfo }}
Expand Down
2 changes: 1 addition & 1 deletion web_src/js/features/repo-diff-commit.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function addLink(parent, href, text, tooltip) {
link.href = href;
link.textContent = text;
if (tooltip) {
link.classList.add('gt-border-secondary', 'gt-rounded');
link.classList.add('gt-border-secondary', 'tw-rounded');
link.setAttribute('data-tooltip-content', tooltip);
}
parent.append(link);
Expand Down

0 comments on commit e754687

Please sign in to comment.