Skip to content

Commit 9a8f5ed

Browse files
committed
fix: inscription page layout and spacing issues
1 parent 98b86cd commit 9a8f5ed

2 files changed

Lines changed: 45 additions & 9 deletions

File tree

frontend/src/lib/components/InscriptionMaterialDetail.svelte

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616
{#if material?.ref}
1717
<a class="badge strong" href={material.ref}>
1818
{material.type}
19-
{#if material.subtype && material.subtype.length }
19+
{#if material.subtype && material.subtype.length}
2020
> {material.subtype.join(', ')}
2121
{/if}
2222
</a>
2323
{:else}
2424
{material.type}
25-
{#if material.subtype && material.subtype.length }
25+
{#if material.subtype && material.subtype.length}
2626
> {material.subtype.join(', ')}
2727
{/if}
2828
{/if}
@@ -79,4 +79,8 @@
7979
overflow: visible;
8080
text-overflow: clip;
8181
}
82+
83+
dt + dd {
84+
margin-top: var(--size-2);
85+
}
8286
</style>

frontend/src/routes/inscription/[slug]/+page.svelte

Lines changed: 39 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@
3131
*/
3232
function nullIfDivEmpty(div) {
3333
// Example
34-
// {id: 'commentary', html: '<h2>commentary</h2> <p> </p> '} => null
34+
// {id: 'commentary', html: '<h2>commentary</h2> <p> </p> '} => null
3535
let ret = null;
3636
if (div && div.html) {
3737
let html = div.html.trim();
3838
// removes heading from start
3939
html = html.replace(/^<(h[1-6])>.*?<\/\1>/, '');
4040
// removes empty <p>
4141
html = html.replace(/<p(\s[^>]*)?>\s*(?:&nbsp;|\s)*<\/p>/gi, '');
42-
html = html.trim()
42+
html = html.trim();
4343
if (html.length) {
4444
ret = div;
4545
}
@@ -49,11 +49,7 @@
4949
5050
const attribution = $derived(html?.editions?.[0]?.html);
5151
const editions = $derived(html?.divs?.find((div) => div.id === 'editions'));
52-
const apparatus = $derived(
53-
nullIfDivEmpty(
54-
html?.divs?.find((div) => div.id === 'apparatus')
55-
)
56-
);
52+
const apparatus = $derived(nullIfDivEmpty(html?.divs?.find((div) => div.id === 'apparatus')));
5753
const translations = $derived(html?.divs?.filter((div) => div.id === 'translation') || []);
5854
5955
/**
@@ -609,6 +605,42 @@ ${changeDate ? `Last revised: ${changeDate}.` : ''}
609605
padding-block: var(--size-2);
610606
}
611607
608+
/* ZL: consistent spacing between section headings and their content */
609+
#text-type h2 {
610+
margin-bottom: var(--size-3);
611+
}
612+
613+
#commentary :global(h2) {
614+
padding-bottom: var(--size-3);
615+
}
616+
617+
#physical-description h3 {
618+
margin-top: var(--size-6);
619+
margin-bottom: var(--size-2);
620+
}
621+
622+
/* ZL: improve spacing and hierarchy in Physical description */
623+
#physical-description dl {
624+
display: flex;
625+
flex-direction: column;
626+
gap: 0;
627+
margin-block: var(--size-2) var(--size-6);
628+
}
629+
630+
#physical-description dt {
631+
font-weight: bold;
632+
margin-top: var(--size-4);
633+
}
634+
635+
#physical-description dt:first-child {
636+
margin-top: 0;
637+
}
638+
639+
#physical-description dd {
640+
margin-inline-start: 0;
641+
margin-top: var(--size-1);
642+
}
643+
612644
#content > section {
613645
border-bottom: var(--border-size-1) solid var(--border-color);
614646
padding-bottom: var(--size-8);

0 commit comments

Comments
 (0)