Skip to content

Commit bfd25d5

Browse files
authored
Enabling word wrapping for tags in all layouts (#8274)
* Removed dividers between items in ul for package details in search results. Word wrap for details in search results. * Word wrap for tags everywhere. * Blue "more tags" link. * "More tags" instead of chevron.
1 parent 4ed47e7 commit bfd25d5

4 files changed

Lines changed: 30 additions & 44 deletions

File tree

src/Bootstrap/dist/css/bootstrap-theme.css

Lines changed: 5 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Bootstrap/less/theme/base.less

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//== Theme Variables
22
@panel-footer-color: @navbar-inverse-color;
33
@default-margin-bottom: 24px;
4+
@package-list-line-height: 20px;
45

56
//== Theme Definition
67
html, body {
@@ -321,12 +322,11 @@ img.reserved-indicator-icon {
321322
.package-list {
322323
margin-top: 8px;
323324
margin-bottom: 8px;
324-
margin-left: -5px;
325325
padding-left: 0;
326-
line-height: 20px;
326+
line-height: @package-list-line-height;
327327
color: @gray-light;
328328

329-
a {
329+
a:not(.more-tags) {
330330
color: @gray-light;
331331
}
332332

@@ -338,14 +338,10 @@ img.reserved-indicator-icon {
338338
@media (min-width: @screen-sm-min) {
339339
li {
340340
display: inline-block;
341-
}
342-
343-
li + li {
344-
margin-left: @padding-small-horizontal;
345-
padding-left: @padding-small-horizontal;
346-
border-left-style: solid;
347-
border-width: 1px;
348-
border-color: @gray-lighter;
341+
line-height: @package-list-line-height;
342+
max-height: (@package-list-line-height * 5 + 1px);
343+
overflow-y: hidden;
344+
padding-right: @padding-small-horizontal;
349345
}
350346
}
351347
}

src/Bootstrap/less/theme/common-list-packages.less

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,19 +51,6 @@
5151
color: @text-color;
5252
line-height: 20px;
5353
}
54-
55-
56-
.package-list {
57-
@media (min-width: @screen-sm-min) {
58-
white-space: nowrap;
59-
overflow: hidden;
60-
text-overflow: ellipsis;
61-
62-
li {
63-
display: inline;
64-
}
65-
}
66-
}
6754
}
6855
}
6956

src/NuGetGallery/Views/Shared/_ListPackage.cshtml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,27 @@
9696
<li class="package-tags">
9797
<span class="icon-text">
9898
<i class="ms-Icon ms-Icon--Tag" aria-hidden="true"></i>
99-
@foreach (var tag in Model.Tags)
99+
@{
100+
const int firstN = 10;
101+
var tags = Model.Tags.Take(firstN + 1).ToList();
102+
string lastTag = null;
103+
if (tags.Count > firstN)
104+
{
105+
lastTag = tags[firstN - 1];
106+
tags.RemoveRange(firstN - 1, 2);
107+
}
108+
}
109+
@foreach (var tag in tags)
100110
{
101111
<a href="@Url.Search("Tags:\"" + tag + "\"")" title="Search for @tag">@tag</a>
102112
}
113+
@if (lastTag != null)
114+
{
115+
<span class="text-nowrap">
116+
<a href="@Url.Search("Tags:\"" + lastTag + "\"")" title="Search for @lastTag">@lastTag</a>
117+
<a href="@Url.Package(Model.Id, Model.UseVersion ? Model.Version : null)" title="View more tags" class="more-tags">More tags</a>
118+
</span>
119+
}
103120
</span>
104121
</li>
105122
}

0 commit comments

Comments
 (0)