File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ import { getSiteUrl } from ' ../lib/site-url.mjs' ;
3+
4+ const llmsFullUrl = ` ${getSiteUrl ()}/llms-full.txt ` ;
5+ ---
6+
7+ <div class =" ai-banner" >
8+ <span >🤖 AI-optimized docs: <a href ={ llmsFullUrl } >llms-full.txt</a ></span >
9+ </div >
10+
11+ <style >
12+ .ai-banner {
13+ width: 100vw;
14+ margin-left: calc(-50vw + 50%);
15+ height: var(--ai-banner-height, 2.75rem);
16+ background: #334155;
17+ color: rgb(148, 163, 184);
18+ padding: 0.5rem 1rem;
19+ font-size: 0.875rem;
20+ border-bottom: 1px solid rgba(140, 140, 255, 0.15);
21+ display: flex;
22+ align-items: center;
23+ justify-content: center;
24+ box-sizing: border-box;
25+ font-family: system-ui, sans-serif;
26+ }
27+
28+ .ai-banner span {
29+ white-space: nowrap;
30+ overflow: hidden;
31+ text-overflow: ellipsis;
32+ max-width: 100%;
33+ }
34+ .ai-banner a {
35+ color: #8C8CFF;
36+ text-decoration: none;
37+ font-weight: 600;
38+ }
39+ .ai-banner a:hover {
40+ text-decoration: underline;
41+ }
42+
43+ @media (min-width: 50rem) {
44+ .ai-banner {
45+ padding-left: 2.5rem;
46+ padding-right: 2.5rem;
47+ }
48+ }
49+
50+ @media (min-width: 72rem) {
51+ .ai-banner {
52+ padding-left: 3rem;
53+ padding-right: 3rem;
54+ }
55+ }
56+ </style >
Original file line number Diff line number Diff line change @@ -7,13 +7,15 @@ import Search from 'virtual:starlight/components/Search';
77import SiteTitle from ' virtual:starlight/components/SiteTitle' ;
88import SocialIcons from ' virtual:starlight/components/SocialIcons' ;
99import ThemeSelect from ' virtual:starlight/components/ThemeSelect' ;
10+ import Banner from ' ./Banner.astro' ;
1011/**
1112 * Render the `Search` component if Pagefind is enabled or the default search component has been overridden.
1213 */
1314const shouldRenderSearch =
1415 config .pagefind || config .components .Search !== ' @astrojs/starlight/components/Search.astro' ;
1516---
1617
18+ <Banner />
1719<div class =" header sl-flex" >
1820 <div class =" title-wrapper sl-flex" >
1921 <SiteTitle {... Astro .props } />
Original file line number Diff line number Diff line change 1313 COLOR PALETTE - Light Mode
1414 ============================================ */
1515: root {
16- --sl-nav-height : 3.5rem ;
16+ --ai-banner-height : 2.75rem ;
17+ --sl-nav-height : 6.25rem ; /* Base nav height (~3.5rem) + banner height (2.75rem) */
1718
1819 /* Full-width content - override Starlight's default 45rem/67.5rem */
1920 --sl-content-width : 100% ;
@@ -210,7 +211,7 @@ header.header {
210211
211212header .header .header .sl-flex {
212213 padding : 0 1.5rem ;
213- height : var (--sl-nav-height );
214+ height : calc ( var (--sl-nav-height ) - var ( --ai-banner-height ) );
214215 width : 100% ;
215216}
216217
You can’t perform that action at this time.
0 commit comments