aboutsummaryrefslogtreecommitdiff
path: root/website/src/components/SiteTitle.astro
blob: 3e5af0a3d21036755aacd60ac99520ff1dba020a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
---
import { docsRoute } from '../docs-path';

const { siteTitle, siteTitleHref, locale } = Astro.locals.starlightRoute;
const route = docsRoute(Astro.url.pathname);
const localePrefix = locale ? `/${locale}` : '';
const targetSegment = route.target === 'stable' ? '' : `/${route.target}`;
const docsHref = `${localePrefix}/docs${targetSegment}/`;
---

<div class="title-row sl-flex">
  <a href={siteTitleHref} class="site-title sl-flex">
    <span class="docs-brand-logo" aria-hidden="true"></span>
    <span translate="no">{siteTitle}</span>
  </a>
  <nav class="title-nav" aria-label="Primary">
    <a href={docsHref}>Docs</a>
    <a href="/plugins/">Plugins</a>
    <a href="/blog/">Blog</a>
  </nav>
</div>

<style>
  @layer starlight.core {
    .title-row {
      align-items: center;
      gap: 1rem;
      min-width: 0;
    }

    .site-title {
      align-items: center;
      gap: 0.55rem;
      font-family: var(--sl-font-mono);
      font-size: var(--sl-text-h4);
      font-weight: 700;
      letter-spacing: -0.04em;
      color: var(--sl-color-white);
      text-decoration: none;
      white-space: nowrap;
      min-width: 0;
      transition: color 120ms ease;
    }

    .docs-brand-logo {
      position: relative;
      display: inline-block;
      width: 32px;
      height: 32px;
      flex: 0 0 auto;
      border: 1px solid var(--sl-color-hairline);
      border-radius: 4px;
      background: var(--sl-color-bg-nav);
    }

    .docs-brand-logo::before {
      content: "";
      position: absolute;
      inset: 2px;
      background: var(--sl-color-white);
      -webkit-mask: url("/assets/agent-icons/herdr-mask.svg") center / contain no-repeat;
      mask: url("/assets/agent-icons/herdr-mask.svg") center / contain no-repeat;
    }

    span:not(.docs-brand-logo) {
      overflow: hidden;
    }

    .title-nav {
      display: flex;
      align-items: baseline;
      gap: 0.75rem;
      font-size: var(--sl-text-sm);
      font-weight: 600;
      line-height: 1;
    }

    .title-nav a {
      color: var(--sl-color-white);
      text-decoration: none;
      transition: color 120ms ease;
    }

    .site-title:hover,
    .title-nav a:hover {
      color: var(--sl-color-accent-high);
    }

    @media (max-width: 35rem) {
      .title-nav {
        display: none;
      }
    }
  }
</style>