Skip to content

Commit d5060f9

Browse files
authored
Merge pull request #453 from rjgoldsborough/long-version-breaks-columns-451
breaking long words in the crates list
2 parents 165650f + 396148a commit d5060f9

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

app/styles/home.scss

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,12 @@
111111
@include justify-content(space-between);
112112
@include align-items(center);
113113

114+
span {
115+
overflow: hidden;
116+
text-overflow: ellipsis;
117+
white-space: nowrap;
118+
}
119+
114120
img { vertical-align: middle; }
115121
}
116122
li a:hover { background-color: darken($main-bg-dark, 5%); }
@@ -123,4 +129,10 @@
123129
}
124130
}
125131

126-
#home-crates > div { @include flex(1); }
132+
#home-crates > div {
133+
@include flex(1);
134+
135+
// flexbox trick to help truncate text and prevent overflow
136+
// https://css-tricks.com/flexbox-truncated-text/
137+
min-width: 0;
138+
}

app/templates/components/crate-list.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{{#each crates as |crate|}}
33
<li>
44
{{#link-to 'crate' crate class='name'}}
5-
{{ crate.name }} ({{ crate.max_version }})
5+
<span>{{ crate.name }} ({{ crate.max_version }})</span>
66
<img class="right-arrow" src="/assets/right-arrow.png"/>
77
{{/link-to}}
88
</li>

0 commit comments

Comments
 (0)