Skip to content

Commit a6cac22

Browse files
committed
Migrate font-weight helpers to tailwind (go-gitea#30027)
Commands ran: ```sh perl -p -i -e 's#gt-font-light#tw-font-light#g' web_src/js/**/* templates/**/* perl -p -i -e 's#gt-font-normal#tw-font-normal#g' web_src/js/**/* templates/**/* perl -p -i -e 's#gt-font-medium#tw-font-medium#g' web_src/js/**/* templates/**/* perl -p -i -e 's#gt-font-semibold#tw-font-semibold#g' web_src/js/**/* templates/**/* perl -p -i -e 's#gt-font-bold#tw-font-bold#g' web_src/js/**/* templates/**/* ```
1 parent 898b90b commit a6cac22

File tree

12 files changed

+18
-17
lines changed

12 files changed

+18
-17
lines changed

tailwind.config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,12 @@ export default {
6666
'3xl': '24px',
6767
'full': 'var(--border-radius-circle)', // 50%
6868
},
69+
fontWeight: {
70+
light: 'var(--font-weight-light)',
71+
normal: 'var(--font-weight-normal)',
72+
medium: 'var(--font-weight-medium)',
73+
semibold: 'var(--font-weight-semibold)',
74+
bold: 'var(--font-weight-bold)',
75+
},
6976
},
7077
};

templates/repo/diff/box.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
{{svg "octicon-chevron-down" 18}}
120120
{{end}}
121121
</button>
122-
<div class="gt-font-semibold tw-flex tw-items-center gt-mono">
122+
<div class="tw-font-semibold tw-flex tw-items-center gt-mono">
123123
{{if $file.IsBin}}
124124
<span class="gt-ml-1 gt-mr-3">
125125
{{ctx.Locale.Tr "repo.diff.bin"}}

templates/repo/diff/comments.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<div class="ui top attached header comment-header tw-flex tw-items-center tw-justify-between">
1212
<div class="comment-header-left tw-flex tw-items-center">
1313
{{if .OriginalAuthor}}
14-
<span class="text black gt-font-semibold gt-mr-2">
14+
<span class="text black tw-font-semibold gt-mr-2">
1515
{{svg (MigrationIcon $.root.Repository.GetOriginalURLHostname)}}
1616
{{.OriginalAuthor}}
1717
</span>

templates/repo/header.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</div>
99
<div class="flex-item-main">
1010
<div class="flex-item-title gt-font-18">
11-
<a class="muted gt-font-normal" href="{{.Owner.HomeLink}}">{{.Owner.Name}}</a>/<a class="muted" href="{{$.RepoLink}}">{{.Name}}</a>
11+
<a class="muted tw-font-normal" href="{{.Owner.HomeLink}}">{{.Owner.Name}}</a>/<a class="muted" href="{{$.RepoLink}}">{{.Name}}</a>
1212
</div>
1313
</div>
1414
<div class="flex-item-trailing">

templates/repo/issue/view_content.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<div class="ui top attached header comment-header tw-flex tw-items-center tw-justify-between" role="heading" aria-level="3">
2424
<div class="comment-header-left tw-flex tw-items-center">
2525
{{if .Issue.OriginalAuthor}}
26-
<span class="text black gt-font-semibold">
26+
<span class="text black tw-font-semibold">
2727
{{svg (MigrationIcon .Repository.GetOriginalURLHostname)}}
2828
{{.Issue.OriginalAuthor}}
2929
</span>

templates/repo/issue/view_content/comments.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<div class="ui top attached header comment-header tw-flex tw-items-center tw-justify-between" role="heading" aria-level="3">
2929
<div class="comment-header-left tw-flex tw-items-center">
3030
{{if .OriginalAuthor}}
31-
<span class="text black gt-font-semibold gt-mr-2">
31+
<span class="text black tw-font-semibold gt-mr-2">
3232
{{svg (MigrationIcon $.Repository.GetOriginalURLHostname)}}
3333
{{.OriginalAuthor}}
3434
</span>
@@ -411,7 +411,7 @@
411411
{{end}}
412412
<span class="text grey muted-links">
413413
{{if .OriginalAuthor}}
414-
<span class="text black gt-font-semibold">
414+
<span class="text black tw-font-semibold">
415415
{{svg (MigrationIcon $.Repository.GetOriginalURLHostname)}}
416416
{{.OriginalAuthor}}
417417
</span>

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 tw-ml-auto gt-pr-0 gt-font-bold tw-flex tw-items-center gt-gap-3">
18+
<span class="item tw-ml-auto gt-pr-0 tw-font-bold tw-flex tw-items-center 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/sub_menu.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
{{range .LanguageStats}}
2626
<div class="item">
2727
<i class="color-icon" style="background-color: {{.Color}}"></i>
28-
<span class="gt-font-semibold">
28+
<span class="tw-font-semibold">
2929
{{if eq .Language "other"}}
3030
{{ctx.Locale.Tr "repo.language_other"}}
3131
{{else}}

templates/shared/user/authorlink.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<a class="author text black gt-font-semibold muted"{{if gt .ID 0}} href="{{.HomeLink}}"{{end}}>{{.GetDisplayName}}</a>{{if .IsBot}}<span class="ui basic label gt-p-2">bot</span>{{end}}
1+
<a class="author text black tw-font-semibold muted"{{if gt .ID 0}} href="{{.HomeLink}}"{{end}}>{{.GetDisplayName}}</a>{{if .IsBot}}<span class="ui basic label gt-p-2">bot</span>{{end}}

templates/user/settings/account.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@
136136
<div class="ui red message">
137137
<p class="text left">{{svg "octicon-alert"}} {{ctx.Locale.Tr "settings.delete_prompt"}}</p>
138138
{{if .UserDeleteWithComments}}
139-
<p class="text left gt-font-semibold">{{ctx.Locale.Tr "settings.delete_with_all_comments" .UserDeleteWithCommentsMaxTime}}</p>
139+
<p class="text left tw-font-semibold">{{ctx.Locale.Tr "settings.delete_with_all_comments" .UserDeleteWithCommentsMaxTime}}</p>
140140
{{end}}
141141
</div>
142142
<form class="ui form ignore-dirty" id="delete-form" action="{{AppSubUrl}}/user/settings/account/delete" method="post">

web_src/css/helpers.css

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,6 @@ Gitea's private styles use `g-` prefix.
3636
text-overflow: ellipsis;
3737
}
3838

39-
.gt-font-light { font-weight: var(--font-weight-light) !important; }
40-
.gt-font-normal { font-weight: var(--font-weight-normal) !important; }
41-
.gt-font-medium { font-weight: var(--font-weight-medium) !important; }
42-
.gt-font-semibold { font-weight: var(--font-weight-semibold) !important; }
43-
.gt-font-bold { font-weight: var(--font-weight-bold) !important; }
44-
4539
.interact-fg { color: inherit !important; }
4640
.interact-fg:hover { color: var(--color-primary) !important; }
4741
.interact-fg:active { color: var(--color-primary-active) !important; }

web_src/js/components/DiffFileList.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export default {
3838
<template>
3939
<ol class="diff-stats gt-m-0" ref="root" v-if="store.fileListIsVisible">
4040
<li v-for="file in store.files" :key="file.NameHash">
41-
<div class="gt-font-semibold tw-flex tw-items-center pull-right">
41+
<div class="tw-font-semibold tw-flex tw-items-center pull-right">
4242
<span v-if="file.IsBin" class="gt-ml-1 gt-mr-3">{{ store.binaryFileMessage }}</span>
4343
{{ file.IsBin ? '' : file.Addition + file.Deletion }}
4444
<span v-if="!file.IsBin" class="diff-stats-bar gt-mx-3" :data-tooltip-content="store.statisticsMessage.replace('%d', (file.Addition + file.Deletion)).replace('%d', file.Addition).replace('%d', file.Deletion)">

0 commit comments

Comments
 (0)