Skip to content

Commit c4fcc7a

Browse files
committed
Allow package name and version to wrap on mobile
Add text-sm-nowrap utility so these columns stay on one line from sm+ but can break on xs where they're the only visible columns.
1 parent 758094b commit c4fcc7a

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

internal/packages/templates.templ

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ templ PackageList(data packagesData) {
5959
<tr>
6060
<th class="d-none d-lg-table-cell text-nowrap">Repositorium</th>
6161
<th class="d-none d-xl-table-cell text-nowrap">Architektur</th>
62-
<th>Name</th>
63-
<th class="text-nowrap">Version</th>
64-
<th class="d-none d-sm-table-cell w-50">Beschreibung</th>
62+
<th class="text-sm-nowrap">Name</th>
63+
<th class="text-sm-nowrap">Version</th>
64+
<th class="d-none d-sm-table-cell">Beschreibung</th>
6565
<th class="d-none d-lg-table-cell text-nowrap">Datum</th>
6666
<th class="d-none d-xl-table-cell text-nowrap">Beliebtheit</th>
6767
</tr>
@@ -75,12 +75,12 @@ templ PackageList(data packagesData) {
7575
</a>
7676
</td>
7777
<td class="d-none d-xl-table-cell text-nowrap">{ pkg.Architecture }</td>
78-
<td class="text-break">
78+
<td class="text-sm-nowrap text-break">
7979
<a href={ templ.SafeURL(fmt.Sprintf("/packages/%s/%s/%s", pkg.Repository, pkg.Architecture, pkg.Name)) }>
8080
{ pkg.Name }
8181
</a>
8282
</td>
83-
<td class="text-nowrap">{ pkg.Version }</td>
83+
<td class="text-sm-nowrap text-break">{ pkg.Version }</td>
8484
<td class="d-none d-sm-table-cell text-break">{ pkg.Description }</td>
8585
<td class="d-none d-lg-table-cell text-nowrap">{ layout.FormatDate(pkg.BuildDate) }</td>
8686
<td class="d-none d-xl-table-cell text-nowrap">

src/_overrides.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
table-layout: fixed;
1414
}
1515

16+
@include media-breakpoint-up(sm) {
17+
.text-sm-nowrap {
18+
white-space: nowrap !important;
19+
}
20+
}
21+
1622
.package-popularity .bi {
1723
width: 1em;
1824
height: 1em;

0 commit comments

Comments
 (0)