Skip to content

Commit 2be724c

Browse files
GiteaBotsilverwind
andauthored
Fix project name wrapping, remove horizontal margin on header (#30631) (#30654)
Backport #30631 by @silverwind Enable wrapping of unbroken lines: <img width="1308" alt="Screenshot 2024-04-22 at 00 31 33" src="https://github.com/go-gitea/gitea/assets/115237/1a28ade1-d708-4260-96a3-cf508b6dcb79"> Remove extra margin added by nested `.ui.container` on certain viewports: Before: <img width="1305" alt="Screenshot 2024-04-22 at 00 40 23" src="https://github.com/go-gitea/gitea/assets/115237/d3d8c0d1-380c-4867-b95c-4d53d70d4a93"> After: <img width="1310" alt="Screenshot 2024-04-22 at 00 40 33" src="https://github.com/go-gitea/gitea/assets/115237/2ba7b9f2-db2f-4bcc-8cce-5c415625ddea"> --------- Co-authored-by: silverwind <me@silverwind.io>
1 parent 5c12e79 commit 2be724c

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

templates/projects/list.tmpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@
4141
<div class="milestone-list">
4242
{{range .Projects}}
4343
<li class="milestone-card">
44-
<h3 class="flex-text-block tw-m-0">
44+
<h3 class="flex-text-block tw-m-0 tw-gap-3">
4545
{{svg .IconName 16}}
46-
<a class="muted" href="{{.Link ctx}}">{{.Title}}</a>
46+
<a class="muted tw-break-anywhere" href="{{.Link ctx}}">{{.Title}}</a>
4747
</h3>
4848
<div class="milestone-toolbar">
4949
<div class="group">

templates/projects/view.tmpl

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{{$canWriteProject := and .CanWriteProjects (or (not .Repository) (not .Repository.IsArchived))}}
22

3-
<div class="ui container">
4-
<div class="tw-flex tw-justify-between tw-items-center tw-mb-4">
5-
<h2 class="tw-mb-0">{{.Project.Title}}</h2>
3+
<div class="ui container tw-max-w-full">
4+
<div class="tw-flex tw-justify-between tw-items-center tw-mb-4 tw-gap-3">
5+
<h2 class="tw-mb-0 tw-flex-1 tw-break-anywhere">{{.Project.Title}}</h2>
66
{{if $canWriteProject}}
77
<div class="ui compact mini menu">
88
<a class="item" href="{{.Link}}/edit?redirect=project">

web_src/css/helpers.css

+3
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ only use:
5252
*/
5353
.tw-hidden.tw-hidden { display: none !important; }
5454

55+
/* proposed class from https://github.com/tailwindlabs/tailwindcss/pull/12128 */
56+
.tw-break-anywhere { overflow-wrap: anywhere !important; }
57+
5558
@media (max-width: 767.98px) {
5659
/* double selector so it wins over .tw-flex (old .gt-df) etc */
5760
.not-mobile.not-mobile {

0 commit comments

Comments
 (0)