Skip to content

Commit 78a807f

Browse files
committed
no wordwrap for bookmark widget link text
1 parent 514fe38 commit 78a807f

File tree

3 files changed

+31
-5
lines changed

3 files changed

+31
-5
lines changed

app/static/css/bookmark_bar.css

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
}
4040

4141
#bookmarkBar li:hover > a {
42-
42+
4343
background-color: #525252;
4444
}
4545

@@ -55,6 +55,15 @@
5555
vertical-align: text-bottom;
5656
}
5757

58+
#bookmarkBar .bookmark-name {
59+
display: inline-block;
60+
max-width: 10rem; /* reasonable cap so long names don't blow out the bar */
61+
white-space: nowrap; /* prevent wrapping */
62+
overflow: hidden; /* hide overflow */
63+
text-overflow: ellipsis; /* show ellipsis when truncated */
64+
vertical-align: middle;
65+
}
66+
5867
#bookmarkBar ul ul {
5968
display: none;
6069
position: absolute;
@@ -77,4 +86,4 @@
7786
#bookmarkBar li:hover > ul {
7887
display: block;
7988
background-color: #2c2c2c;
80-
}
89+
}

app/static/css/links.css

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,20 @@ a:hover, a:focus {
1515
.box-header-link, .box-header-link:visited, .header a:visited {
1616
color: #D3D3D3;
1717
}
18+
19+
/* Prevent bookmark link text from wrapping and show ellipsis when too long */
20+
.bookmarks-link {
21+
display: inline-block; /* allow width control while remaining inline */
22+
max-width: 12rem; /* adjust as needed for your layout */
23+
min-width: 0; /* allows shrinking inside flex containers */
24+
white-space: nowrap;
25+
overflow: hidden;
26+
text-overflow: ellipsis;
27+
vertical-align: middle;
28+
word-break: normal;
29+
overflow-wrap: normal;
30+
}
31+
32+
.bookmarks-link:visited {
33+
color: #98c379; /* keep same color for visited when using the class */
34+
}

app/templates/bookmark_bar.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<li>
55
{% if bookmark.contents %}
66
<a href="#">
7-
<i class="fa fa-folder"></i> {{ bookmark.name }}
7+
<i class="fa fa-folder"></i> <span class="bookmark-name">{{ bookmark.name }}</span>
88
</a>
99
{% with bookmarks = bookmark.contents %}
1010
{% include('bookmark_bar.html') %}
@@ -17,10 +17,10 @@
1717
{% else %}
1818
<i class="fa fa-link"></i>
1919
{% endif %}
20-
{{ bookmark.name }}
20+
<span class="bookmark-name">{{ bookmark.name }}</span>
2121
</a>
2222
{% endif %}
2323
</li>
2424
{% endfor %}
2525
</ul>
26-
{% endif %}
26+
{% endif %}

0 commit comments

Comments
 (0)