Skip to content

Commit 99f201a

Browse files
committed
replace download table with grid for more flexibility
1 parent b2990ba commit 99f201a

5 files changed

Lines changed: 42 additions & 68 deletions

File tree

_config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ libs: {
1818
url: 'https://cdn.jsdelivr.net/npm/less@4.2.0/dist/less.min.js',
1919
sri: 'sha384-SlYTcCEsC10TwMfcpGjqd+bWfA2QdB0CInBtPX6erDT3NnEkhX2X3gJ83UyHtXs3'
2020
},
21-
css: '/styles/styles.min.css?v=2026021500',
21+
css: '/styles/styles.min.css?v=2026030800',
2222
bootstrap: {
2323
css: {
2424
url: 'https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css',

_includes/footer.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878

7979
document.querySelectorAll('a.copy-popover-link').forEach((sumbtn) => {
8080
var popover = new bootstrap.Popover(sumbtn, {
81-
content: sumbtn.closest('td').querySelector('.copy-popover-target').innerHTML,
81+
content: sumbtn.closest('div').querySelector('.copy-popover-target').innerHTML,
8282
html: true,
8383
customClass: 'copy-popover'
8484
});

download/index.html

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -18,31 +18,27 @@ <h2 id="{{ id }}">{{ params.title }} <a class="anchor" href="#{{ id }}" aria-lab
1818
<p class="text-body-secondary mb-1">{{ params.description }}</p>
1919
{% endif %}
2020

21-
<table class="table table-striped download-table">
22-
<thead>
23-
<tr>
24-
<th class="package" scope="col">Package</th>
25-
<td class="link"></td>
26-
<th class="size text-nowrap" scope="col">Size</th>
27-
<th class="checksum" scope="col"><span class="d-none d-lg-inline">SHA-256 checksum</span></th>
28-
</tr>
29-
</thead>
30-
<tbody>
21+
<div class="download-grid grid-striped" role="table">
22+
<div class="item-header fw-bold"role="row">
23+
<div class="col-package" role="columnheader">Package</div>
24+
<div class="col-link" role="columnheader"></div>
25+
<div class="col-size" role="columnheader">Size</div>
26+
<div class="col-checksum" role="columnheader"><span class="d-none d-lg-inline">SHA-256 checksum</span></div>
27+
</div>
3128
{% for package in params.packages %}
32-
<tr>
33-
<th class="package fw-normal" scope="row">{{ package.version }} - {{ package.package }}{% if package.package == "Dependent" %}<sup><a href="#fn1" class="text-body-secondary">1</a></sup>{% endif %}</th>
34-
<td class="link text-center text-lg-start"><a href="{{ package.url }}" title="Download now!" class="btn rc-icon btn-rc-download btn-sm"><span>Download</span></a></td>
35-
<td class="size text-nowrap">{{ package.size }}</td>
36-
<td class="checksum font-monospace text-nowrap text-center text-lg-start pe-3">
29+
<div class="item-content" role="row">
30+
<div class="col-package" role="rowheader">{{ package.version }} - {{ package.package }}{% if package.package == "Dependent" %}<sup><a href="#fn1" class="text-body-secondary">1</a></sup>{% endif %}</div>
31+
<div class="col-link" role="cell"><a href="{{ package.url }}" title="Download now!" class="btn rc-icon btn-rc-download btn-sm"><span>Download</span></a></div>
32+
<div class="col-size" role="cell">{{ package.size }}</div>
33+
<div class="col-checksum" role="cell">
3734
<span class="d-none d-lg-inline copy-popover-target">
38-
<span class="copy-target d-block d-lg-inline text-nowrap overflow-auto py-3 py-lg-0">{{ package.checksum }}</span><span class="py-3 py-lg-0"><a class="copy-link" href="#" aria-label="Copy text"></a></span>
35+
<span class="copy-target d-block d-md-inline-block overflow-hidden text-nowrap text-truncate py-3 py-lg-0">{{ package.checksum }}</span><span class="py-3 py-lg-0 ps-1"><a class="copy-link align-top" href="#" aria-label="Copy text"></a></span>
3936
</span>
4037
<a class="d-inline d-lg-none copy-popover-link checksum" href="#" aria-label="SHA-256 checksum" onclick="return false;" data-bs-title="SHA-256 checksum" data-bs-placement="left"></a>
41-
</td>
42-
</tr>
38+
</div>
39+
</div>
4340
{% endfor %}
44-
</tbody>
45-
</table>
41+
</div>
4642
{% endfor %}
4743

4844
<p id="fn1" class="text-body-secondary">1. Dependent packages only contain sources which are licensed under the GPL but they require some third-party

styles/styles.less

Lines changed: 23 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@
33
@nav-offset: 6rem;
44
@thumbnail-width: 140px;
55

6+
@max-width-xxl: 1399px;
67
@max-width-md: 991px;
78
@max-width-sm: 767px;
89
@max-width-xs: 575px;
910

11+
@min-width-lg: 992px;
12+
1013
@color-primary: #37beff;
1114
@color-background-alt: rgba(0, 0, 0, 0.05);
1215
@color-header-background: #212529;
@@ -52,10 +55,6 @@ html[data-bs-theme="dark"] {
5255
--bs-navbar-toggler-padding-x: 0;
5356
}
5457

55-
.table {
56-
--bs-table-striped-bg: var(--rc-color-background-alt);
57-
}
58-
5958
.bg-quote,
6059
.bg-badge {
6160
background-color: var(--rc-color-background-alt) !important;
@@ -449,58 +448,37 @@ div.color-modes > ul.dropdown-menu {
449448
}
450449
}
451450

452-
table.download-table {
453-
th.package {
454-
width: 30%;
455-
}
451+
div.download-grid {
452+
display: grid;
453+
grid-template-columns: 30% 12% 10% 48%;
456454

457-
td.link,
458-
td.size {
459-
width: 12%;
460-
}
455+
div.item-header,
456+
div.item-content {
457+
display: contents;
461458

462-
td.checksum {
463-
font-size: 0.9em;
459+
> div {
460+
padding: .5rem;
461+
border-bottom: var(--bs-border-width) solid var(--bs-border-color);
462+
}
464463
}
465464

466-
tbody th,
467-
tbody td {
468-
vertical-align: middle;
465+
&.grid-striped > div:nth-of-type(even) > div {
466+
background-color: var(--rc-color-background-alt);
469467
}
470468

471-
@media (max-width: @max-width-md) {
472-
th.package {
473-
width: 40%;
474-
}
475-
476-
td.link {
477-
width: 35%;
478-
}
469+
@media (min-width: @min-width-lg) and (max-width: @max-width-xxl) {
470+
grid-template-columns: 30% 15% 10% 43%;
479471

480-
td.size {
481-
width: 20%;
472+
div.col-checksum span.copy-target {
473+
max-width: 90%;
482474
}
475+
}
483476

484-
td.checksum {
485-
width: 5%;
486-
}
477+
@media (max-width: @max-width-md) {
478+
grid-template-columns: 50% 25% 15% 10%;
487479
}
488480

489481
@media (max-width: @max-width-xs) {
490-
th.package {
491-
width: 55%;
492-
}
493-
494-
td.link {
495-
width: 20%;
496-
}
497-
498-
td.size {
499-
width: 20%;
500-
}
501-
502-
td.checksum {
503-
width: 5%;
504-
}
482+
grid-template-columns: 57% 13% 21% 9%;
505483
}
506484
}

styles/styles.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)