Files
archicratie-edition/src/components/GlossaryPortalPanel.astro
Archicratia a9f2a5bbd4
All checks were successful
SMOKE / smoke (push) Successful in 5s
CI / build-and-anchors (push) Successful in 54s
CI / build-and-anchors (pull_request) Successful in 43s
feat(glossaire): harmonize portal pages and sticky reading ux
2026-03-26 12:58:17 +01:00

96 lines
1.9 KiB
Plaintext

---
export interface Props {
id?: string;
title: string;
count?: string;
intro?: string;
surface?: boolean;
className?: string;
}
const {
id,
title,
count,
intro,
surface = false,
className,
} = Astro.props;
---
<div
class:list={[
"glossary-portal-panel",
surface && "glossary-portal-panel--surface",
className,
]}
>
<div class="glossary-portal-panel__head">
<h3 id={id}>{title}</h3>
{count && <span class="glossary-portal-panel__count">{count}</span>}
</div>
{intro && <p class="glossary-portal-panel__intro">{intro}</p>}
<slot />
</div>
<style>
.glossary-portal-panel{
display: grid;
gap: 12px;
}
.glossary-portal-panel--surface{
padding: 18px 18px 16px;
border: 1px solid var(--glossary-border, rgba(127,127,127,0.18));
border-radius: 18px;
background:
linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01)),
var(--glossary-bg-soft, rgba(127,127,127,0.035));
}
.glossary-portal-panel__head{
display: flex;
align-items: baseline;
justify-content: space-between;
gap: 12px;
flex-wrap: wrap;
}
.glossary-portal-panel__head h3{
margin: 0;
font-size: 15px;
line-height: 1.3;
scroll-margin-top: calc(var(--sticky-offset-px, 96px) + 36px);
}
.glossary-portal-panel__count{
display: inline-flex;
align-items: center;
min-height: 24px;
padding: 0 10px;
border: 1px solid rgba(127,127,127,0.22);
border-radius: 999px;
font-size: 12px;
line-height: 1.2;
opacity: .78;
white-space: nowrap;
}
.glossary-portal-panel__intro{
max-width: 78ch;
margin: 0;
font-size: 14px;
line-height: 1.5;
opacity: .9;
}
@media (prefers-color-scheme: dark){
.glossary-portal-panel--surface{
background:
linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01)),
rgba(255,255,255,0.04);
}
}
</style>