@f5-sales-demo/docs-theme 4.11.4 → 4.11.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,47 +1,23 @@
1
1
  ---
2
2
  import Default from '@astrojs/starlight/components/Footer.astro';
3
- import Icon from './Icon.astro';
4
3
  ---
5
4
 
6
5
  <Default {...Astro.props}><slot /></Default>
7
6
 
8
- {process.env.DOCS_PROFILE !== 'canonical-provider' && <div class="social-links">
9
- <a href="https://www.facebook.com/f5incorporated" target="_blank" rel="noopener noreferrer" aria-label="Facebook">
10
- <Icon name="hashicorp-flight:facebook-color" size="1.5rem" />
11
- </a>
12
- <a href="https://x.com/F5" target="_blank" rel="noopener noreferrer" aria-label="X">
13
- <Icon name="hashicorp-flight:twitter-x" size="1.5rem" />
14
- </a>
15
- <a href="https://www.linkedin.com/company/f5/" target="_blank" rel="noopener noreferrer" aria-label="LinkedIn">
16
- <Icon name="hashicorp-flight:linkedin-color" size="1.5rem" />
17
- </a>
18
- <a href="https://www.instagram.com/f5.global/" target="_blank" rel="noopener noreferrer" aria-label="Instagram">
19
- <Icon name="hashicorp-flight:instagram-color" size="1.5rem" />
20
- </a>
21
- <a href="https://www.youtube.com/user/f5networksinc" target="_blank" rel="noopener noreferrer" aria-label="YouTube">
22
- <Icon name="hashicorp-flight:youtube-color" size="1.5rem" />
23
- </a>
24
- </div>}
7
+ {process.env.DOCS_PROFILE !== 'canonical-provider' && <nav class="project-links" aria-label="Project information">
8
+ <a href="https://f5-sales-demo.github.io/en/ecosystem/">Ecosystem directory</a>
9
+ <a href="https://github.com/f5-sales-demo">Project sources</a>
10
+ <a href="https://docs.cloud.f5.com/">Official F5 documentation</a>
11
+ </nav>}
25
12
 
26
13
  <style>
27
- .social-links {
14
+ .project-links {
28
15
  display: flex;
29
- justify-content: flex-end;
30
- align-items: center;
31
- gap: 1.25rem;
32
- padding: 1rem 0 0.5rem;
33
- }
34
-
35
- .social-links a {
36
- display: inline-flex;
37
- transition: opacity 0.2s ease;
38
- }
39
-
40
- .social-links a:hover {
41
- opacity: 0.7;
42
- }
43
-
44
- .social-links :global(svg) {
45
- display: block;
16
+ flex-wrap: wrap;
17
+ gap: 0.5rem 1.5rem;
18
+ border-top: 1px solid var(--sl-color-gray-5);
19
+ margin-top: 2rem;
20
+ padding-block: 1rem;
46
21
  }
22
+ .project-links a { padding-block: 0.5rem; }
47
23
  </style>
@@ -0,0 +1,10 @@
1
+ ---
2
+ import { pageTitle } from '../src/utils/page-title';
3
+
4
+ const route = Astro.locals.starlightRoute;
5
+ const head = route.head.map((entry) => entry.tag === 'title'
6
+ ? { ...entry, content: pageTitle(route.entry.data.title, route.siteTitle, entry.content || '') }
7
+ : entry);
8
+ ---
9
+
10
+ {head.map(({ tag: Tag, attrs, content }) => <Tag {...attrs} set:html={content} />)}
@@ -18,7 +18,7 @@ if (attributes.href && localeSlug) {
18
18
 
19
19
  <div class:list={['sl-link-card', { 'has-icon': !!icon }]}>
20
20
  {icon && (
21
- <span class="card-icon">
21
+ <span class="card-icon" aria-hidden="true">
22
22
  <Icon name={icon} />
23
23
  </span>
24
24
  )}
@@ -28,13 +28,13 @@ if (attributes.href && localeSlug) {
28
28
  </a>
29
29
  {description && <span class="description" set:html={description} />}
30
30
  </span>
31
- <Icon name="right-arrow" size="1.333em" class="icon rtl:flip" />
31
+ <span aria-hidden="true"><Icon name="right-arrow" size="1.333em" class="icon rtl:flip" /></span>
32
32
  </div>
33
33
 
34
34
  <style>
35
35
  .sl-link-card {
36
36
  display: grid;
37
- grid-template-columns: 1fr auto;
37
+ grid-template-columns: minmax(0, 1fr) auto;
38
38
  gap: 0.5rem;
39
39
  border: 1px solid var(--sl-color-gray-5);
40
40
  border-radius: 0.5rem;
@@ -46,7 +46,7 @@ if (attributes.href && localeSlug) {
46
46
  }
47
47
 
48
48
  .sl-link-card.has-icon {
49
- grid-template-columns: auto 1fr auto;
49
+ grid-template-columns: auto minmax(0, 1fr) auto;
50
50
  }
51
51
 
52
52
  a {
@@ -62,7 +62,10 @@ if (attributes.href && localeSlug) {
62
62
  }
63
63
 
64
64
  .stack {
65
- flex-direction: column;
65
+ min-width: 0;
66
+ overflow-wrap: anywhere;
67
+ display: grid;
68
+ align-content: start;
66
69
  gap: 0.5rem;
67
70
  }
68
71
 
@@ -75,6 +78,7 @@ if (attributes.href && localeSlug) {
75
78
  .description {
76
79
  color: var(--sl-color-gray-3);
77
80
  line-height: 1.5;
81
+ margin: 0;
78
82
  }
79
83
 
80
84
  .icon {
@@ -83,10 +87,10 @@ if (attributes.href && localeSlug) {
83
87
 
84
88
  .card-icon {
85
89
  color: var(--sl-color-white);
86
- align-self: stretch;
90
+ align-self: start;
87
91
  position: relative;
88
- aspect-ratio: 1;
89
- max-height: 3rem;
92
+ width: 3rem;
93
+ height: 3rem;
90
94
  }
91
95
 
92
96
  .card-icon :global(svg) {
@@ -96,6 +100,11 @@ if (attributes.href && localeSlug) {
96
100
  height: 100%;
97
101
  }
98
102
 
103
+ .sl-link-card:focus-within {
104
+ outline: 2px solid var(--sl-color-text-accent);
105
+ outline-offset: 3px;
106
+ }
107
+
99
108
  /* Hover state */
100
109
  .sl-link-card:hover {
101
110
  background: var(--sl-color-gray-7, var(--sl-color-gray-6));
@@ -49,6 +49,11 @@ const shouldRenderSearch = config.pagefind || config.components.Search !== '@ast
49
49
  min-width: 0;
50
50
  }
51
51
 
52
+ .right-group { display: none; }
53
+ @media (min-width: 90rem) {
54
+ .right-group { display: flex; }
55
+ }
56
+
52
57
  .right-group,
53
58
  .social-icons {
54
59
  gap: 1rem;
@@ -71,7 +76,7 @@ const shouldRenderSearch = config.pagefind || config.components.Search !== '@ast
71
76
  align-items: center;
72
77
  }
73
78
 
74
- @media (min-width: 50rem) {
79
+ @media (min-width: 90rem) {
75
80
  :global(:root[data-has-sidebar]) {
76
81
  --__sidebar-pad: calc(2 * var(--sl-nav-pad-x));
77
82
  }
@@ -90,9 +95,9 @@ const shouldRenderSearch = config.pagefind || config.components.Search !== '@ast
90
95
  display: grid;
91
96
  grid-template-columns:
92
97
  /* 1 (site title) */
93
- auto
98
+ minmax(0, 1fr)
94
99
  /* 2 (mega-menu nav) */
95
- 1fr
100
+ auto
96
101
  /* 3 (search box) */
97
102
  auto
98
103
  /* 4 (right items) */
@@ -7,6 +7,7 @@ import ThemeSelect from 'virtual:starlight/components/ThemeSelect';
7
7
  import config from 'virtual:starlight/user-config';
8
8
  import MegaMenu from './SharedMegaMenu.tsx';
9
9
  import MegaMenuMobile from './SharedMegaMenuMobile.tsx';
10
+ import { federatedSearchSites } from '../src/utils/search-sites';
10
11
 
11
12
  /**
12
13
  * Render the `Search` component if Pagefind is enabled or the default search component has been overridden.
@@ -14,7 +15,7 @@ import MegaMenuMobile from './SharedMegaMenuMobile.tsx';
14
15
  const shouldRenderSearch = config.pagefind || config.components.Search !== '@astrojs/starlight/components/Search.astro';
15
16
  ---
16
17
 
17
- <div class="header sl-mega-menu-header">
18
+ <div class="header sl-mega-menu-header" data-search-sources={JSON.stringify(federatedSearchSites)}>
18
19
  <div class="title-wrapper sl-flex">
19
20
  <SiteTitle />
20
21
  </div>
@@ -34,8 +35,38 @@ const shouldRenderSearch = config.pagefind || config.components.Search !== '@ast
34
35
  <div class="smm-mobile-toggle">
35
36
  <MegaMenuMobile client:only="react" />
36
37
  </div>
38
+ <details class="compact-preferences">
39
+ <summary aria-label="Display and language">Aa</summary>
40
+ <div class="preferences-panel"><ThemeSelect /><LanguageSelect /></div>
41
+ </details>
37
42
  </div>
38
43
 
44
+ <script>
45
+ import { searchSource } from '../src/utils/search-source';
46
+ const header = document.querySelector<HTMLElement>('[data-search-sources]');
47
+ const sources = JSON.parse(header?.dataset.searchSources || '[]');
48
+ const annotateResults = () => {
49
+ for (const link of document.querySelectorAll<HTMLAnchorElement>('.pagefind-ui__result-link')) {
50
+ if (link.dataset.sourceAnnotated) continue;
51
+ link.dataset.sourceAnnotated = 'true';
52
+ const label = searchSource(link.href, sources);
53
+ if (!label) continue;
54
+ const source = document.createElement('span');
55
+ source.className = 'search-project-source';
56
+ source.textContent = label;
57
+ link.closest('.pagefind-ui__result-title')?.append(source);
58
+ }
59
+ };
60
+ new MutationObserver(annotateResults).observe(document.body, { childList: true, subtree: true });
61
+ document.addEventListener('keydown', (event) => {
62
+ const preferences = document.querySelector<HTMLDetailsElement>('.compact-preferences[open]');
63
+ if (event.key === 'Escape' && preferences) {
64
+ preferences.open = false;
65
+ preferences.querySelector('summary')?.focus();
66
+ }
67
+ });
68
+ </script>
69
+
39
70
  <style>
40
71
  @layer starlight.core {
41
72
  .header {
@@ -55,6 +86,37 @@ const shouldRenderSearch = config.pagefind || config.components.Search !== '@ast
55
86
  min-width: 0;
56
87
  }
57
88
 
89
+ .right-group { display: none; }
90
+ .compact-preferences { position: relative; flex-shrink: 0; }
91
+ .compact-preferences summary {
92
+ cursor: pointer;
93
+ padding: 0.75rem;
94
+ min-height: 44px;
95
+ list-style: none;
96
+ }
97
+ .preferences-panel {
98
+ position: absolute;
99
+ inset-inline-end: 0;
100
+ top: calc(100% + 0.5rem);
101
+ display: grid;
102
+ gap: 0.5rem;
103
+ padding: 0.75rem;
104
+ background: var(--sl-color-bg-nav);
105
+ border: 1px solid var(--sl-color-gray-5);
106
+ border-radius: 0.5rem;
107
+ }
108
+ :global(.search-project-source) {
109
+ display: block;
110
+ font-size: var(--sl-text-sm);
111
+ font-weight: 400;
112
+ color: var(--sl-color-gray-2);
113
+ margin-top: 0.25rem;
114
+ }
115
+ @media (min-width: 90rem) {
116
+ .right-group { display: flex; }
117
+ .compact-preferences { display: none; }
118
+ }
119
+
58
120
  .right-group,
59
121
  .social-icons {
60
122
  gap: 1rem;
@@ -77,7 +139,7 @@ const shouldRenderSearch = config.pagefind || config.components.Search !== '@ast
77
139
  align-items: center;
78
140
  }
79
141
 
80
- @media (min-width: 50rem) {
142
+ @media (min-width: 90rem) {
81
143
  :global(:root[data-has-sidebar]) {
82
144
  --__sidebar-pad: calc(2 * var(--sl-nav-pad-x));
83
145
  }
@@ -96,9 +158,9 @@ const shouldRenderSearch = config.pagefind || config.components.Search !== '@ast
96
158
  display: grid;
97
159
  grid-template-columns:
98
160
  /* 1 (site title) */
99
- auto
161
+ minmax(0, 1fr)
100
162
  /* 2 (mega-menu nav) */
101
- 1fr
163
+ auto
102
164
  /* 3 (search box) */
103
165
  auto
104
166
  /* 4 (right items) */