Skip to content

Commit 34a0684

Browse files
authored
Improve CSS helper naming (#28769)
* `gt-w-100` => `gt-w-full` to match tailwind * clarify `gt-hidden` priority
1 parent 7d62615 commit 34a0684

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

templates/admin/self_check.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
{{if .DatabaseCheckInconsistentCollationColumns}}
2121
<div class="ui red message">
2222
{{ctx.Locale.Tr "admin.self_check.database_inconsistent_collation_columns" .DatabaseCheckResult.DatabaseCollation}}
23-
<ul class="gt-w-100">
23+
<ul class="gt-w-full">
2424
{{range .DatabaseCheckInconsistentCollationColumns}}
2525
<li>{{.}}</li>
2626
{{end}}

templates/devtest/fomantic-modal.tmpl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<div id="test-modal-form-1" class="ui mini modal">
66
<div class="header">Form dialog (layout 1)</div>
77
<form class="content" method="post">
8-
<div class="ui input gt-w-100"><input name="user_input"></div>
8+
<div class="ui input gt-w-full"><input name="user_input"></div>
99
{{template "base/modal_actions_confirm" (dict "ModalButtonTypes" "confirm")}}
1010
</form>
1111
</div>
@@ -14,7 +14,7 @@
1414
<div class="header">Form dialog (layout 2)</div>
1515
<form method="post">
1616
<div class="content">
17-
<div class="ui input gt-w-100"><input name="user_input"></div>
17+
<div class="ui input gt-w-full"><input name="user_input"></div>
1818
{{template "base/modal_actions_confirm" (dict "ModalButtonTypes" "confirm")}}
1919
</div>
2020
</form>
@@ -24,7 +24,7 @@
2424
<div class="header">Form dialog (layout 3)</div>
2525
<form method="post">
2626
<div class="content">
27-
<div class="ui input gt-w-100"><input name="user_input"></div>
27+
<div class="ui input gt-w-full"><input name="user_input"></div>
2828
</div>
2929
{{template "base/modal_actions_confirm" (dict "ModalButtonTypes" "confirm")}}
3030
</form>
@@ -33,7 +33,7 @@
3333
<div id="test-modal-form-4" class="ui mini modal">
3434
<div class="header">Form dialog (layout 4)</div>
3535
<div class="content">
36-
<div class="ui input gt-w-100"><input name="user_input"></div>
36+
<div class="ui input gt-w-full"><input name="user_input"></div>
3737
</div>
3838
<form method="post">
3939
{{template "base/modal_actions_confirm" (dict "ModalButtonTypes" "confirm")}}

templates/repo/diff/box.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@
203203
{{if $showFileViewToggle}}
204204
{{/* for image or CSV, it can have a horizontal scroll bar, there won't be review comment context menu (position absolute) which would be clipped by "overflow" */}}
205205
<div id="diff-rendered-{{$file.NameHash}}" class="file-body file-code {{if $.IsSplitStyle}}code-diff-split{{else}}code-diff-unified{{end}} gt-overflow-x-scroll">
206-
<table class="chroma gt-w-100">
206+
<table class="chroma gt-w-full">
207207
{{if $isImage}}
208208
{{template "repo/diff/image_diff" dict "file" . "root" $ "blobBase" $blobBase "blobHead" $blobHead "sniffedTypeBase" $sniffedTypeBase "sniffedTypeHead" $sniffedTypeHead}}
209209
{{else}}

templates/repo/issue/card.tmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
{{end}}
77
</div>
88
{{end}}
9-
<div class="content gt-p-0 gt-w-100">
9+
<div class="content gt-p-0 gt-w-full">
1010
<div class="gt-df gt-items-start">
1111
<div class="issue-card-icon">
1212
{{template "shared/issueicon" .}}

web_src/css/helpers.css

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ Gitea's private styles use `g-` prefix.
1212
.gt-f1 { flex: 1 !important; }
1313
.gt-fw { flex-wrap: wrap !important; }
1414
.gt-vm { vertical-align: middle !important; }
15-
.gt-w-100 { width: 100% !important; }
16-
.gt-h-100 { height: 100% !important; }
1715

1816
.gt-mono {
1917
font-family: var(--fonts-monospace) !important;
@@ -69,15 +67,17 @@ Gitea's private styles use `g-` prefix.
6967
.gt-self-start { align-self: flex-start !important; }
7068
.gt-self-end { align-self: flex-end !important; }
7169
.gt-no-underline { text-decoration-line: none !important; }
72-
.gt-w-auto { width: auto !important; }
7370
.gt-normal-case { text-transform: none !important; }
7471
.gt-italic { font-style: italic !important; }
7572
.gt-overflow-x-auto { overflow-x: auto !important; }
7673
.gt-overflow-x-scroll { overflow-x: scroll !important; }
7774
.gt-overflow-y-hidden { overflow-y: hidden !important; }
7875

79-
.gt-w-screen { width: 100vw !important; }
8076
.gt-h-screen { height: 100vh !important; }
77+
.gt-h-full { height: 100% !important; }
78+
.gt-w-auto { width: auto !important; }
79+
.gt-w-screen { width: 100vw !important; }
80+
.gt-w-full { width: 100% !important; }
8181

8282
.gt-float-left { float: left !important; }
8383
.gt-float-right { float: right !important; }
@@ -268,7 +268,7 @@ Gitea's private styles use `g-` prefix.
268268
.gt-font-18 { font-size: 18px !important }
269269

270270
/*
271-
gt-hidden must be placed after all other "display: xxx !important" classes to win the chance
271+
gt-hidden must win all other "display: xxx !important" classes to get the chance to "hide" an element.
272272
do not use:
273273
* "[hidden]" attribute: it's too weak, can not be applied to an element with "display: flex"
274274
* ".hidden" class: it has been polluted by Fomantic UI in many cases
@@ -278,4 +278,4 @@ only use:
278278
* this ".gt-hidden" class
279279
* showElem/hideElem/toggleElem functions in "utils/dom.js"
280280
*/
281-
.gt-hidden { display: none !important; }
281+
.gt-hidden.gt-hidden { display: none !important; }

0 commit comments

Comments
 (0)