Skip to content

Commit 41bbd1b

Browse files
authored
refactor: Update SearchResultsWork layout and enhance styling for book notes (#11670)
* Replace footer with a styled div for better presentation of book notes * Add new CSS class for list book notes to improve layout and readability * Define line-height for short snippets to ensure consistent typography
2 parents 52d0c06 + d5447ec commit 41bbd1b

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

openlibrary/macros/SearchResultsWork.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ <h3 itemprop="name" class="booktitle">
229229
</div>
230230

231231
$if footer:
232-
<hr />
233-
$:footer
232+
<div class="list-books__note">
233+
$:sanitize(format(footer))
234+
</div>
234235
</li>

static/css/legacy.less

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1348,7 +1348,6 @@ ul.list-books {
13481348
.sri__main {
13491349
display: flex;
13501350
flex-direction: column;
1351-
height: 100%;
13521351
}
13531352

13541353
.bookcover {
@@ -1380,6 +1379,22 @@ ul.list-books {
13801379
}
13811380
}
13821381

1382+
.list-books__note {
1383+
overflow: hidden;
1384+
padding-top: 8px;
1385+
margin-top: 4px;
1386+
border-top: @border-divider;
1387+
line-height: @line-height-blurb;
1388+
display: -webkit-box;
1389+
-webkit-line-clamp: 6;
1390+
line-clamp: 6;
1391+
-webkit-box-orient: vertical;
1392+
}
1393+
1394+
.list-books__note p {
1395+
margin-top: 0;
1396+
}
1397+
13831398
div.pop {
13841399
// openlibrary/templates/covers/add.html
13851400
&Alert {

static/css/less/line-heights.less

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Design approach to Line Heights:
2929

3030
@line-height-body: @line-height-normal; // paragraphs, default text
3131
@line-height-meta: @line-height-snug; // bylines, counts, timestamps, secondary text (search cards)
32+
@line-height-blurb: @line-height-snug; // short snippet, often in narrow containers (list item notes in grid)
3233

3334
@line-height-list: @line-height-snug; // multi-line lists of links/subjects (subject pages)
3435
@line-height-table: @line-height-snug; // edition detail grids / data tables

0 commit comments

Comments
 (0)