]> source.dussan.org Git - gitea.git/commitdiff
Replace more `gt-` with `tw-`, update frontend docs (#29595)
authorsilverwind <me@silverwind.io>
Tue, 5 Mar 2024 05:29:32 +0000 (06:29 +0100)
committerGitHub <noreply@github.com>
Tue, 5 Mar 2024 05:29:32 +0000 (05:29 +0000)
Tested a few things, all working fine. Not sure if the chinese machine
translation is good.

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
25 files changed:
docs/content/contributing/guidelines-frontend.en-us.md
docs/content/contributing/guidelines-frontend.zh-cn.md
templates/admin/emails/list.tmpl
templates/admin/packages/list.tmpl
templates/admin/user/list.tmpl
templates/base/head_navbar.tmpl
templates/base/paginate.tmpl
templates/repo/commit_page.tmpl
templates/repo/diff/box.tmpl
templates/repo/diff/options_dropdown.tmpl
templates/repo/diff/section_split.tmpl
templates/repo/diff/section_unified.tmpl
templates/repo/diff/whitespace_dropdown.tmpl
templates/repo/issue/card.tmpl
templates/repo/issue/labels/labels_selector_field.tmpl
templates/repo/issue/new_form.tmpl
templates/repo/issue/view_content/sidebar.tmpl
templates/repo/settings/branches.tmpl
templates/status/500.tmpl
web_src/css/helpers.css
web_src/js/features/repo-diff.js
web_src/js/features/repo-issue.js
web_src/js/features/repo-legacy.js
web_src/js/features/user-auth.js
web_src/js/markup/mermaid.js

index a33a38a6f92b49446f0cb1fc98f30281a7e7eeed..2c0aaaed4a36bbe9035cc69d8bbaa8b53589e6b1 100644 (file)
@@ -47,7 +47,7 @@ We recommend [Google HTML/CSS Style Guide](https://google.github.io/styleguide/h
 9. Avoid unnecessary `!important` in CSS, add comments to explain why it's necessary if it can't be avoided.
 10. Avoid mixing different events in one event listener, prefer to use individual event listeners for every event.
 11. Custom event names are recommended to use `ce-` prefix.
-12. Gitea's tailwind-style CSS classes use `gt-` prefix (`gt-relative`), while Gitea's own private framework-level CSS classes use `g-` prefix (`g-modal-confirm`).
+12. Prefer using Tailwind CSS which is available via `tw-` prefix, e.g. `tw-relative`. Gitea's helper CSS classes use `gt-` prefix (`gt-df`), while Gitea's own private framework-level CSS classes use `g-` prefix (`g-modal-confirm`).
 13. Avoid inline scripts & styles as much as possible, it's recommended to put JS code into JS files and use CSS classes. If inline scripts & styles are unavoidable, explain the reason why it can't be avoided.
 
 ### Accessibility / ARIA
index 43f72b48083a071648b6c5dbac6384cee5acbed5..ace0d97f497c477512de5e5645df629efe2af228 100644 (file)
@@ -47,7 +47,7 @@ HTML 页面由[Go HTML Template](https://pkg.go.dev/html/template)渲染。
 9. 避免在 CSS 中使用不必要的`!important`,如果无法避免,添加注释解释为什么需要它。
 10. 避免在一个事件监听器中混合不同的事件,优先为每个事件使用独立的事件监听器。
 11. 推荐使用自定义事件名称前缀`ce-`。
-12. Gitea 的 tailwind-style CSS 类使用`gt-`前缀(`gt-relative`),而 Gitea 自身的私有框架级 CSS 类使用`g-`前缀(`g-modal-confirm`)。
+12. 建议使用 Tailwind CSS,它可以通过 `tw-` 前缀获得,例如 `tw-relative`. Gitea 自身的助手类 CSS 使用 `gt-` 前缀(`gt-df`),Gitea 自身的私有框架级 CSS 类使用 `g-` 前缀(`g-modal-confirm`)。
 13. 尽量避免内联脚本和样式,建议将JS代码放入JS文件中并使用CSS类。如果内联脚本和样式不可避免,请解释无法避免的原因。
 
 ### 可访问性 / ARIA
index bcd80368e663cd6551dbfc694e2078e59d995302..29fbb5f03975980af7014f66ddec1a4ad6808335 100644 (file)
@@ -47,8 +47,8 @@
                                        {{range .Emails}}
                                                <tr>
                                                        <td><a href="{{AppSubUrl}}/{{.Name | PathEscape}}">{{.Name}}</a></td>
-                                                       <td class="gt-ellipsis gt-max-width-12rem">{{.FullName}}</td>
-                                                       <td class="gt-ellipsis gt-max-width-12rem">{{.Email}}</td>
+                                                       <td class="gt-ellipsis tw-max-w-48">{{.FullName}}</td>
+                                                       <td class="gt-ellipsis tw-max-w-48">{{.Email}}</td>
                                                        <td>{{if .IsPrimary}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</td>
                                                        <td>
                                                                {{if .CanChange}}
index 1f86803d55defc834539b1910aa9e24ee4c39541..aef48154242bc528c38e9908f4ffcab5409f8401 100644 (file)
@@ -62,8 +62,8 @@
                                                                {{end}}
                                                        </td>
                                                        <td>{{.Package.Type.Name}}</td>
-                                                       <td class="gt-ellipsis gt-max-width-12rem">{{.Package.Name}}</td>
-                                                       <td class="gt-ellipsis gt-max-width-12rem"><a href="{{.VersionWebLink}}">{{.Version.Version}}</a></td>
+                                                       <td class="gt-ellipsis tw-max-w-48">{{.Package.Name}}</td>
+                                                       <td class="gt-ellipsis tw-max-w-48"><a href="{{.VersionWebLink}}">{{.Version.Version}}</a></td>
                                                        <td><a href="{{.Creator.HomeLink}}">{{.Creator.Name}}</a></td>
                                                        <td>
                                                        {{if .Repository}}
index 8fdc80fc7049459650717dadce6d3de209049342..e9ce17ac9078b16cd9d20aa90c513d7b74a71a60 100644 (file)
@@ -96,7 +96,7 @@
                                                                        <span class="ui mini label">{{ctx.Locale.Tr "admin.users.remote"}}</span>
                                                                {{end}}
                                                        </td>
-                                                       <td class="gt-ellipsis gt-max-width-12rem">{{.Email}}</td>
+                                                       <td class="gt-ellipsis tw-max-w-48">{{.Email}}</td>
                                                        <td>{{if .IsActive}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</td>
                                                        <td>{{if .IsRestricted}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</td>
                                                        <td>{{if index $.UsersTwoFaStatus .ID}}{{svg "octicon-check"}}{{else}}{{svg "octicon-x"}}{{end}}</td>
index 51eeea405a4d7bd5a60b4919341c20e3accaaa8a..4f48dc82c327069299de6bf88f4d65e508650cfb 100644 (file)
@@ -14,7 +14,7 @@
                <div class="ui secondary menu item navbar-mobile-right">
                        {{if .IsSigned}}
                        <a id="mobile-notifications-icon" class="item tw-w-auto gt-p-3" href="{{AppSubUrl}}/notifications" data-tooltip-content="{{ctx.Locale.Tr "notifications"}}" aria-label="{{ctx.Locale.Tr "notifications"}}">
-                               <div class="gt-relative">
+                               <div class="tw-relative">
                                        {{svg "octicon-bell"}}
                                        <span class="notification_count{{if not $notificationUnreadCount}} gt-hidden{{end}}">{{$notificationUnreadCount}}</span>
                                </div>
@@ -76,7 +76,7 @@
                {{else if .IsSigned}}
                        {{if EnableTimetracking}}
                        <a class="active-stopwatch-trigger item gt-mx-0{{if not .ActiveStopwatch}} gt-hidden{{end}}" href="{{.ActiveStopwatch.IssueLink}}" title="{{ctx.Locale.Tr "active_stopwatch"}}">
-                               <div class="gt-relative">
+                               <div class="tw-relative">
                                        {{svg "octicon-stopwatch"}}
                                        <span class="header-stopwatch-dot"></span>
                                </div>
                        {{end}}
 
                        <a class="item not-mobile gt-mx-0" href="{{AppSubUrl}}/notifications" data-tooltip-content="{{ctx.Locale.Tr "notifications"}}" aria-label="{{ctx.Locale.Tr "notifications"}}">
-                               <div class="gt-relative">
+                               <div class="tw-relative">
                                        {{svg "octicon-bell"}}
                                        <span class="notification_count{{if not $notificationUnreadCount}} gt-hidden{{end}}">{{$notificationUnreadCount}}</span>
                                </div>
index ef7d0b341bcfdfd36d53b3706521433bc3a5f297..8c2adc1f94cf553444927902a505884b3ffdac06 100644 (file)
@@ -17,7 +17,7 @@
                                        {{if eq .Num -1}}
                                                <a class="disabled item">...</a>
                                        {{else}}
-                                               <a class="{{if .IsCurrent}}active {{end}}item gt-content-center" {{if not .IsCurrent}}href="{{$paginationLink}}?page={{.Num}}{{if $paginationParams}}&{{$paginationParams}}{{end}}"{{end}}>{{.Num}}</a>
+                                               <a class="{{if .IsCurrent}}active {{end}}item tw-content-center" {{if not .IsCurrent}}href="{{$paginationLink}}?page={{.Num}}{{if $paginationParams}}&{{$paginationParams}}{{end}}"{{end}}>{{.Num}}</a>
                                        {{end}}
                                {{end}}
                                <a class="{{if not .HasNext}}disabled{{end}} item navigation" {{if .HasNext}}href="{{$paginationLink}}?page={{.Next}}{{if $paginationParams}}&{{$paginationParams}}{{end}}"{{end}}>
index 1d900cdefbbfda1300ed11eb88feda98c1b3261a..80af73ce486e73fa026f4e78968b277f7e26b1ab 100644 (file)
@@ -17,7 +17,7 @@
                                {{$class = (print $class " isWarning")}}
                        {{end}}
                {{end}}
-               <div class="ui top attached header clearing segment gt-relative commit-header {{$class}}">
+               <div class="ui top attached header clearing segment tw-relative commit-header {{$class}}">
                        <div class="gt-df gt-mb-4 gt-fw">
                                <h3 class="gt-mb-0 gt-f1"><span class="commit-summary" title="{{.Commit.Summary}}">{{RenderCommitMessage $.Context .Commit.Message ($.Repository.ComposeMetas ctx)}}</span>{{template "repo/commit_statuses" dict "Status" .CommitStatus "Statuses" .CommitStatuses}}</h3>
                                {{if not $.PageIsWiki}}
index 1cb3aaaa212d767d2c21f90f2e5cb67a7b014a3f..39df6faea50dc9ff441ff0c369d6f3ebbb76e550 100644 (file)
                                        <div class="diff-file-box diff-box file-content {{TabSizeClass $.Editorconfig $file.Name}} gt-mt-0" id="diff-{{$file.NameHash}}" data-old-filename="{{$file.OldName}}" data-new-filename="{{$file.Name}}" {{if or ($file.ShouldBeHidden) (not $isExpandable)}}data-folded="true"{{end}}>
                                                <h4 class="diff-file-header sticky-2nd-row ui top attached normal header gt-df gt-ac gt-sb gt-fw">
                                                        <div class="diff-file-name gt-df gt-ac gt-gap-2 gt-fw">
-                                                               <button class="fold-file btn interact-bg gt-p-2{{if not $isExpandable}} gt-invisible{{end}}">
+                                                               <button class="fold-file btn interact-bg gt-p-2{{if not $isExpandable}} tw-invisible{{end}}">
                                                                        {{if $file.ShouldBeHidden}}
                                                                                {{svg "octicon-chevron-right" 18}}
                                                                        {{else}}
index b7c46dd846b05c20074d4b107155ee87b8d03265..09b7b80e41f903ca1b66db0f38814e88570e3ed9 100644 (file)
                {{if .Issue.Index}}
                        {{if .ShowOutdatedComments}}
                                <a class="item" href="?style={{if $.IsSplitStyle}}split{{else}}unified{{end}}&whitespace={{$.WhitespaceBehavior}}&show-outdated=false">
-                                       <label class="gt-pointer-events-none">
+                                       <label class="tw-pointer-events-none">
                                                {{ctx.Locale.Tr "repo.issues.review.option.hide_outdated_comments"}}
                                        </label>
                                </a>
                        {{else}}
                                <a class="item" href="?style={{if $.IsSplitStyle}}split{{else}}unified{{end}}&whitespace={{$.WhitespaceBehavior}}&show-outdated=true">
-                                       <label class="gt-pointer-events-none">
+                                       <label class="tw-pointer-events-none">
                                                {{ctx.Locale.Tr "repo.issues.review.option.show_outdated_comments"}}
                                        </label>
                                </a>
index 672193565b52935e5f7db9d0401c20eb8cafc4e0..0999d36f200874764f4065e591241ea1765be2c7 100644 (file)
@@ -47,7 +47,7 @@
                                        <td class="lines-type-marker lines-type-marker-old del-code"><span class="gt-mono" data-type-marker="{{$line.GetLineTypeMarker}}"></span></td>
                                        <td class="lines-code lines-code-old del-code">{{/*
                                                */}}{{if and $.root.SignedUserID $.root.PageIsPullFiles}}{{/*
-                                                       */}}<button type="button" aria-label="{{ctx.Locale.Tr "repo.diff.comment.add_line_comment"}}" class="ui primary button add-code-comment add-code-comment-left{{if (not $line.CanComment)}} gt-invisible{{end}}" data-side="left" data-idx="{{$line.LeftIdx}}">{{/*
+                                                       */}}<button type="button" aria-label="{{ctx.Locale.Tr "repo.diff.comment.add_line_comment"}}" class="ui primary button add-code-comment add-code-comment-left{{if (not $line.CanComment)}} tw-invisible{{end}}" data-side="left" data-idx="{{$line.LeftIdx}}">{{/*
                                                                */}}{{svg "octicon-plus"}}{{/*
                                                        */}}</button>{{/*
                                                */}}{{end}}{{/*
@@ -62,7 +62,7 @@
                                        <td class="lines-type-marker lines-type-marker-new add-code">{{if $match.RightIdx}}<span class="gt-mono" data-type-marker="{{$match.GetLineTypeMarker}}"></span>{{end}}</td>
                                        <td class="lines-code lines-code-new add-code">{{/*
                                                */}}{{if and $.root.SignedUserID $.root.PageIsPullFiles}}{{/*
-                                                       */}}<button type="button" aria-label="{{ctx.Locale.Tr "repo.diff.comment.add_line_comment"}}" class="ui primary button add-code-comment add-code-comment-right{{if (not $match.CanComment)}} gt-invisible{{end}}" data-side="right" data-idx="{{$match.RightIdx}}">{{/*
+                                                       */}}<button type="button" aria-label="{{ctx.Locale.Tr "repo.diff.comment.add_line_comment"}}" class="ui primary button add-code-comment add-code-comment-right{{if (not $match.CanComment)}} tw-invisible{{end}}" data-side="right" data-idx="{{$match.RightIdx}}">{{/*
                                                                */}}{{svg "octicon-plus"}}{{/*
                                                        */}}</button>{{/*
                                                */}}{{end}}{{/*
@@ -79,7 +79,7 @@
                                        <td class="lines-type-marker lines-type-marker-old">{{if $line.LeftIdx}}<span class="gt-mono" data-type-marker="{{$line.GetLineTypeMarker}}"></span>{{end}}</td>
                                        <td class="lines-code lines-code-old">{{/*
                                                */}}{{if and $.root.SignedUserID $.root.PageIsPullFiles (not (eq .GetType 2))}}{{/*
-                                                       */}}<button type="button" aria-label="{{ctx.Locale.Tr "repo.diff.comment.add_line_comment"}}" class="ui primary button add-code-comment add-code-comment-left{{if (not $line.CanComment)}} gt-invisible{{end}}" data-side="left" data-idx="{{$line.LeftIdx}}">{{/*
+                                                       */}}<button type="button" aria-label="{{ctx.Locale.Tr "repo.diff.comment.add_line_comment"}}" class="ui primary button add-code-comment add-code-comment-left{{if (not $line.CanComment)}} tw-invisible{{end}}" data-side="left" data-idx="{{$line.LeftIdx}}">{{/*
                                                                */}}{{svg "octicon-plus"}}{{/*
                                                        */}}</button>{{/*
                                                */}}{{end}}{{/*
@@ -94,7 +94,7 @@
                                        <td class="lines-type-marker lines-type-marker-new">{{if $line.RightIdx}}<span class="gt-mono" data-type-marker="{{$line.GetLineTypeMarker}}"></span>{{end}}</td>
                                        <td class="lines-code lines-code-new">{{/*
                                                */}}{{if and $.root.SignedUserID $.root.PageIsPullFiles (not (eq .GetType 3))}}{{/*
-                                                       */}}<button type="button" aria-label="{{ctx.Locale.Tr "repo.diff.comment.add_line_comment"}}" class="ui primary button add-code-comment add-code-comment-right{{if (not $line.CanComment)}} gt-invisible{{end}}" data-side="right" data-idx="{{$line.RightIdx}}">{{/*
+                                                       */}}<button type="button" aria-label="{{ctx.Locale.Tr "repo.diff.comment.add_line_comment"}}" class="ui primary button add-code-comment add-code-comment-right{{if (not $line.CanComment)}} tw-invisible{{end}}" data-side="right" data-idx="{{$line.RightIdx}}">{{/*
                                                                */}}{{svg "octicon-plus"}}{{/*
                                                        */}}</button>{{/*
                                                */}}{{end}}{{/*
index 2c271d0866190723a13f4eca6042fdd34f173b40..2fc116a991f57288597b77da6b5eaef22b66b60f 100644 (file)
@@ -52,7 +52,7 @@
                        {{else}}
                                <td class="chroma lines-code{{if (not $line.RightIdx)}} lines-code-old{{end}}">{{/*
                                        */}}{{if and $.root.SignedUserID $.root.PageIsPullFiles}}{{/*
-                                               */}}<button type="button" aria-label="{{ctx.Locale.Tr "repo.diff.comment.add_line_comment"}}" class="ui primary button add-code-comment add-code-comment-{{if $line.RightIdx}}right{{else}}left{{end}}{{if (not $line.CanComment)}} gt-invisible{{end}}" data-side="{{if $line.RightIdx}}right{{else}}left{{end}}" data-idx="{{if $line.RightIdx}}{{$line.RightIdx}}{{else}}{{$line.LeftIdx}}{{end}}">{{/*
+                                               */}}<button type="button" aria-label="{{ctx.Locale.Tr "repo.diff.comment.add_line_comment"}}" class="ui primary button add-code-comment add-code-comment-{{if $line.RightIdx}}right{{else}}left{{end}}{{if (not $line.CanComment)}} tw-invisible{{end}}" data-side="{{if $line.RightIdx}}right{{else}}left{{end}}" data-idx="{{if $line.RightIdx}}{{$line.RightIdx}}{{else}}{{$line.LeftIdx}}{{end}}">{{/*
                                                        */}}{{svg "octicon-plus"}}{{/*
                                                */}}</button>{{/*
                                        */}}{{end}}{{/*
index 7bf2ac9aec79220e6de11117b44e136ed1c8c7c8..cfabf836d61207e4363b2633bb92c11b377a0a4a 100644 (file)
@@ -2,26 +2,26 @@
        {{svg "gitea-whitespace"}}
        <div class="menu">
                <a class="item" href="?style={{if .IsSplitStyle}}split{{else}}unified{{end}}&whitespace=show-all&show-outdated={{$.ShowOutdatedComments}}">
-                       <label class="gt-pointer-events-none">
-                               <input class="gt-mr-3 gt-pointer-events-none" type="radio"{{if eq .WhitespaceBehavior "show-all"}} checked{{end}}>
+                       <label class="tw-pointer-events-none">
+                               <input class="gt-mr-3 tw-pointer-events-none" type="radio"{{if eq .WhitespaceBehavior "show-all"}} checked{{end}}>
                                {{ctx.Locale.Tr "repo.diff.whitespace_show_everything"}}
                        </label>
                </a>
                <a class="item" href="?style={{if .IsSplitStyle}}split{{else}}unified{{end}}&whitespace=ignore-all&show-outdated={{$.ShowOutdatedComments}}">
-                       <label class="gt-pointer-events-none">
-                               <input class="gt-mr-3 gt-pointer-events-none" type="radio"{{if eq .WhitespaceBehavior "ignore-all"}} checked{{end}}>
+                       <label class="tw-pointer-events-none">
+                               <input class="gt-mr-3 tw-pointer-events-none" type="radio"{{if eq .WhitespaceBehavior "ignore-all"}} checked{{end}}>
                                {{ctx.Locale.Tr "repo.diff.whitespace_ignore_all_whitespace"}}
                        </label>
                </a>
                <a class="item" href="?style={{if .IsSplitStyle}}split{{else}}unified{{end}}&whitespace=ignore-change&show-outdated={{$.ShowOutdatedComments}}">
-                       <label class="gt-pointer-events-none">
-                               <input class="gt-mr-3 gt-pointer-events-none" type="radio"{{if eq .WhitespaceBehavior "ignore-change"}} checked{{end}}>
+                       <label class="tw-pointer-events-none">
+                               <input class="gt-mr-3 tw-pointer-events-none" type="radio"{{if eq .WhitespaceBehavior "ignore-change"}} checked{{end}}>
                                {{ctx.Locale.Tr "repo.diff.whitespace_ignore_amount_changes"}}
                        </label>
                </a>
                <a class="item" href="?style={{if .IsSplitStyle}}split{{else}}unified{{end}}&whitespace=ignore-eol&show-outdated={{$.ShowOutdatedComments}}">
-                       <label class="gt-pointer-events-none">
-                               <input class="gt-mr-3 gt-pointer-events-none" type="radio"{{if eq .WhitespaceBehavior "ignore-eol"}} checked{{end}}>
+                       <label class="tw-pointer-events-none">
+                               <input class="gt-mr-3 tw-pointer-events-none" type="radio"{{if eq .WhitespaceBehavior "ignore-eol"}} checked{{end}}>
                                {{ctx.Locale.Tr "repo.diff.whitespace_ignore_at_eol"}}
                        </label>
                </a>
index 5e524079c8cf7f9000761ac17898003e4da0c4e9..ff635c736a5b2978b37b2a9fe7f1cdd27902adfb 100644 (file)
@@ -7,7 +7,7 @@
                </div>
        {{end}}
        <div class="content gt-p-0 tw-w-full">
-               <div class="gt-df gt-items-start">
+               <div class="gt-df tw-items-start">
                        <div class="issue-card-icon">
                                {{template "shared/issueicon" .}}
                        </div>
index d24dac46eb3f57bac2c22ebe1abf03e06df0f5d5..e42a1de8952dc005831e01bb62c932a803b3d2ca 100644 (file)
@@ -21,7 +21,7 @@
                                        <div class="divider"></div>
                                {{end}}
                                {{$previousExclusiveScope = $exclusiveScope}}
-                               <a class="{{if .IsChecked}}checked{{end}} item" href="#" data-id="{{.ID}}" {{if .IsArchived}}data-is-archived{{end}} data-id-selector="#label_{{.ID}}" data-scope="{{$exclusiveScope}}"><span class="octicon-check {{if not .IsChecked}}gt-invisible{{end}}">{{if $exclusiveScope}}{{svg "octicon-dot-fill"}}{{else}}{{svg "octicon-check"}}{{end}}</span>&nbsp;&nbsp;{{RenderLabel $.Context .}}
+                               <a class="{{if .IsChecked}}checked{{end}} item" href="#" data-id="{{.ID}}" {{if .IsArchived}}data-is-archived{{end}} data-id-selector="#label_{{.ID}}" data-scope="{{$exclusiveScope}}"><span class="octicon-check {{if not .IsChecked}}tw-invisible{{end}}">{{if $exclusiveScope}}{{svg "octicon-dot-fill"}}{{else}}{{svg "octicon-check"}}{{end}}</span>&nbsp;&nbsp;{{RenderLabel $.Context .}}
                                        {{if .Description}}<br><small class="desc">{{.Description | RenderEmoji $.Context}}</small>{{end}}
                                        <p class="archived-label-hint">{{template "repo/issue/labels/label_archived" .}}</p>
                                </a>
@@ -34,7 +34,7 @@
                                        <div class="divider"></div>
                                {{end}}
                                {{$previousExclusiveScope = $exclusiveScope}}
-                               <a class="{{if .IsChecked}}checked{{end}} item" href="#" data-id="{{.ID}}" {{if .IsArchived}}data-is-archived{{end}} data-id-selector="#label_{{.ID}}" data-scope="{{$exclusiveScope}}"><span class="octicon-check {{if not .IsChecked}}gt-invisible{{end}}">{{if $exclusiveScope}}{{svg "octicon-dot-fill"}}{{else}}{{svg "octicon-check"}}{{end}}</span>&nbsp;&nbsp;{{RenderLabel $.Context .}}
+                               <a class="{{if .IsChecked}}checked{{end}} item" href="#" data-id="{{.ID}}" {{if .IsArchived}}data-is-archived{{end}} data-id-selector="#label_{{.ID}}" data-scope="{{$exclusiveScope}}"><span class="octicon-check {{if not .IsChecked}}tw-invisible{{end}}">{{if $exclusiveScope}}{{svg "octicon-dot-fill"}}{{else}}{{svg "octicon-check"}}{{end}}</span>&nbsp;&nbsp;{{RenderLabel $.Context .}}
                                        {{if .Description}}<br><small class="desc">{{.Description | RenderEmoji $.Context}}</small>{{end}}
                                        <p class="archived-label-hint">{{template "repo/issue/labels/label_archived" .}}</p>
                                </a>
index e67314bfd5c0a5bb5732ada13fbafecd0da9d2a6..b2b9e308f5fc496384a3dd4650ba4dc2d6878f00 100644 (file)
                                        <div class="no-select item">{{ctx.Locale.Tr "repo.issues.new.clear_assignees"}}</div>
                                        {{range .Assignees}}
                                                <a class="item muted" href="#" data-id="{{.ID}}" data-id-selector="#assignee_{{.ID}}">
-                                                       <span class="octicon-check gt-invisible">{{svg "octicon-check"}}</span>
+                                                       <span class="octicon-check tw-invisible">{{svg "octicon-check"}}</span>
                                                        <span class="text">
                                                                {{ctx.AvatarUtils.Avatar . 28 "gt-mr-3"}}{{template "repo/search_name" .}}
                                                        </span>
index f5b6751d6d1e4d96b55c754540a235465bf9140a..329a39dd69e064cee29f16995e180f1cb2edbed7 100644 (file)
@@ -20,7 +20,7 @@
                                        {{range .Reviewers}}
                                                {{if .User}}
                                                        <a class="{{if not .CanChange}}ui{{end}} item {{if .Checked}}checked{{end}} {{if not .CanChange}}ban-change{{end}}" href="#" data-id="{{.ItemID}}" data-id-selector="#review_request_{{.ItemID}}" {{if not .CanChange}} data-tooltip-content="{{ctx.Locale.Tr "repo.issues.remove_request_review_block"}}"{{end}}>
-                                                               <span class="octicon-check {{if not .Checked}}gt-invisible{{end}}">{{svg "octicon-check"}}</span>
+                                                               <span class="octicon-check {{if not .Checked}}tw-invisible{{end}}">{{svg "octicon-check"}}</span>
                                                                <span class="text">
                                                                        {{ctx.AvatarUtils.Avatar .User 28 "gt-mr-3"}}{{template "repo/search_name" .User}}
                                                                </span>
@@ -35,7 +35,7 @@
                                        {{range .TeamReviewers}}
                                                {{if .Team}}
                                                        <a class="{{if not .CanChange}}ui{{end}} item {{if .Checked}}checked{{end}} {{if not .CanChange}}ban-change{{end}}" href="#" data-id="{{.ItemID}}" data-id-selector="#review_request_team_{{.Team.ID}}" {{if not .CanChange}} data-tooltip-content="{{ctx.Locale.Tr "repo.issues.remove_request_review_block"}}"{{end}}>
-                                                               <span class="octicon-check {{if not .Checked}}gt-invisible{{end}}">{{svg "octicon-check" 16}}</span>
+                                                               <span class="octicon-check {{if not .Checked}}tw-invisible{{end}}">{{svg "octicon-check" 16}}</span>
                                                                <span class="text">
                                                                        {{svg "octicon-people" 16 "gt-ml-4 gt-mr-2"}}{{$.Issue.Repo.OwnerName}}/{{.Team.Name}}
                                                                </span>
                                                        {{$checked = true}}
                                                {{end}}
                                        {{end}}
-                                       <span class="octicon-check {{if not $checked}}gt-invisible{{end}}">{{svg "octicon-check"}}</span>
+                                       <span class="octicon-check {{if not $checked}}tw-invisible{{end}}">{{svg "octicon-check"}}</span>
                                        <span class="text">
                                                {{ctx.AvatarUtils.Avatar . 20 "gt-mr-3"}}{{template "repo/search_name" .}}
                                        </span>
index f8896b504e3a6988e413cef56051fe818de51753..78421ec009ea31c1fdea6fcf896e10d671dd6711 100644 (file)
@@ -16,7 +16,7 @@
                                        {{.CsrfTokenHtml}}
                                        <input type="hidden" name="action" value="default_branch">
                                        {{if not .Repository.IsEmpty}}
-                                               <div class="ui dropdown selection gt-f1 gt-mr-3 gt-max-width-24rem">
+                                               <div class="ui dropdown selection gt-f1 gt-mr-3 tw-max-w-96">
                                                        {{svg "octicon-triangle-down" 14 "dropdown icon"}}
                                                        <input type="hidden" name="branch" value="{{.Repository.DefaultBranch}}">
                                                        <div class="default text">{{.Repository.DefaultBranch}}</div>
index 03d0183280c2178fd1b7220d94ffcf4074f5e725..a821fe55da36082fa2720b1ee2a01662b0b26afc 100644 (file)
@@ -38,7 +38,7 @@
                        <div class="ui container gt-my-5">
                                {{if .ErrorMsg}}
                                        <p>{{ctx.Locale.Tr "error.occurred"}}:</p>
-                                       <pre class="tw-whitespace-pre-wrap gt-break-all">{{.ErrorMsg}}</pre>
+                                       <pre class="tw-whitespace-pre-wrap tw-break-all">{{.ErrorMsg}}</pre>
                                {{end}}
                                <div class="center gt-mt-5">
                                        {{if or .SignedUser.IsAdmin .ShowFooterVersion}}<p>{{ctx.Locale.Tr "admin.config.app_ver"}}: {{AppVer}}</p>{{end}}
index 71f3a619b921b77711266766b20a46c6f894fe9c..dad0f9b127b18255fb580915e83c55a2545d4c60 100644 (file)
@@ -46,16 +46,7 @@ Gitea's private styles use `g-` prefix.
   text-overflow: ellipsis;
 }
 
-.gt-max-width-12rem { max-width: 12rem !important; }
-.gt-max-width-24rem { max-width: 24rem !important; }
-
 /* below class names match Tailwind CSS */
-.gt-break-all { word-break: break-all !important; }
-.gt-content-center { align-content: center !important; }
-.gt-invisible { visibility: hidden !important; }
-.gt-items-start { align-items: flex-start !important; }
-.gt-pointer-events-none { pointer-events: none !important; }
-.gt-relative { position: relative !important; }
 .gt-object-contain { object-fit: contain !important; }
 .gt-no-underline { text-decoration-line: none !important; }
 .gt-normal-case { text-transform: none !important; }
index 5c73bf4bbc08f8b9d2d406778206ff824b462f47..77691e15e6488bc154a500f593e94e33f2f5a90c 100644 (file)
@@ -69,9 +69,9 @@ function initRepoDiffConversationForm() {
 
       $form.closest('.conversation-holder').replaceWith($newConversationHolder);
       if ($form.closest('tr').data('line-type') === 'same') {
-        $(`[data-path="${path}"] .add-code-comment[data-idx="${idx}"]`).addClass('gt-invisible');
+        $(`[data-path="${path}"] .add-code-comment[data-idx="${idx}"]`).addClass('tw-invisible');
       } else {
-        $(`[data-path="${path}"] .add-code-comment[data-side="${side}"][data-idx="${idx}"]`).addClass('gt-invisible');
+        $(`[data-path="${path}"] .add-code-comment[data-side="${side}"][data-idx="${idx}"]`).addClass('tw-invisible');
       }
       $newConversationHolder.find('.dropdown').dropdown();
       initCompReactionSelector($newConversationHolder);
index 10faeb135d13cacdc1eb69aa4b997e2bc23f38a2..6fb13b0ddae288df8ff1c251f2348561282c1e64 100644 (file)
@@ -180,9 +180,9 @@ export function initRepoIssueCommentDelete() {
           const idx = $conversationHolder.data('idx');
           const lineType = $conversationHolder.closest('tr').data('line-type');
           if (lineType === 'same') {
-            $(`[data-path="${path}"] .add-code-comment[data-idx="${idx}"]`).removeClass('gt-invisible');
+            $(`[data-path="${path}"] .add-code-comment[data-idx="${idx}"]`).removeClass('tw-invisible');
           } else {
-            $(`[data-path="${path}"] .add-code-comment[data-side="${side}"][data-idx="${idx}"]`).removeClass('gt-invisible');
+            $(`[data-path="${path}"] .add-code-comment[data-side="${side}"][data-idx="${idx}"]`).removeClass('tw-invisible');
           }
           $conversationHolder.remove();
         }
index 10ad83679733d2b0c7a793fb7aa181ab87b74792..8fcc78c177c6cba519b13f86cd063c23371fe614 100644 (file)
@@ -150,7 +150,7 @@ export function initRepoCommentForm() {
 
         if ($(this).hasClass('checked')) {
           $(this).removeClass('checked');
-          $(this).find('.octicon-check').addClass('gt-invisible');
+          $(this).find('.octicon-check').addClass('tw-invisible');
           if (hasUpdateAction) {
             if (!($(this).data('id') in items)) {
               items[$(this).data('id')] = {
@@ -164,7 +164,7 @@ export function initRepoCommentForm() {
           }
         } else {
           $(this).addClass('checked');
-          $(this).find('.octicon-check').removeClass('gt-invisible');
+          $(this).find('.octicon-check').removeClass('tw-invisible');
           if (hasUpdateAction) {
             if (!($(this).data('id') in items)) {
               items[$(this).data('id')] = {
@@ -218,7 +218,7 @@ export function initRepoCommentForm() {
 
       $(this).parent().find('.item').each(function () {
         $(this).removeClass('checked');
-        $(this).find('.octicon-check').addClass('gt-invisible');
+        $(this).find('.octicon-check').addClass('tw-invisible');
       });
 
       if (selector === 'select-reviewers-modify' || selector === 'select-assignees-modify') {
index 60d186e69979889d765f161938c5df3dd8420fc0..a871ac471c2ecd1b533cb1945ede0cb7cbcf81fc 100644 (file)
@@ -9,13 +9,13 @@ export function initUserAuthOauth2() {
 
   for (const link of outer.querySelectorAll('.oauth-login-link')) {
     link.addEventListener('click', () => {
-      inner.classList.add('gt-invisible');
+      inner.classList.add('tw-invisible');
       outer.classList.add('is-loading');
       setTimeout(() => {
         // recover previous content to let user try again
         // usually redirection will be performed before this action
         outer.classList.remove('is-loading');
-        inner.classList.remove('gt-invisible');
+        inner.classList.remove('tw-invisible');
       }, 5000);
     });
   }
index 84d88a94c3ddb99dccdf671f7ddc5b5e5ee34547..82e9909fec540ec42318c2d19e47b882e5b3f2a7 100644 (file)
@@ -45,7 +45,7 @@ export async function renderMermaid() {
       const {svg} = await mermaid.render('mermaid', source);
 
       const iframe = document.createElement('iframe');
-      iframe.classList.add('markup-render', 'gt-invisible');
+      iframe.classList.add('markup-render', 'tw-invisible');
       iframe.srcdoc = `<html><head><style>${iframeCss}</style></head><body>${svg}</body></html>`;
 
       const mermaidBlock = document.createElement('div');
@@ -62,7 +62,7 @@ export async function renderMermaid() {
         iframe.style.height = `${iframe.contentWindow.document.body.clientHeight}px`;
         setTimeout(() => { // avoid flash of iframe background
           mermaidBlock.classList.remove('is-loading');
-          iframe.classList.remove('gt-invisible');
+          iframe.classList.remove('tw-invisible');
         }, 0);
       });