starlight-theme-bejamas 0.0.0-canary.0d34eb2

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.
package/CHANGELOG.md ADDED
@@ -0,0 +1,15 @@
1
+ # starlight-theme-bejamas
2
+
3
+ ## 0.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#6](https://github.com/bejamas/ui/pull/6) [`fcca220`](https://github.com/bejamas/ui/commit/fcca220c0d4760edbaaefbfe2ce0af512bfadc26) Thanks [@thomkrupa](https://github.com/thomkrupa)! - convert component names to PascalCase for barrel import
8
+
9
+ - [#6](https://github.com/bejamas/ui/pull/6) [`41d9e97`](https://github.com/bejamas/ui/commit/41d9e97f7cee67e95d9c9eeb112762d1487d4e4f) Thanks [@thomkrupa](https://github.com/thomkrupa)! - change imports of bejamas/ui components
10
+
11
+ ## 0.1.1
12
+
13
+ ### Patch Changes
14
+
15
+ - fix search position on tablet screen size
package/package.json ADDED
@@ -0,0 +1,49 @@
1
+ {
2
+ "name": "starlight-theme-bejamas",
3
+ "author": "Bejamas",
4
+ "version": "0.0.0-canary.0d34eb2",
5
+ "license": "MIT",
6
+ "description": "A Starlight theme using bejamas/ui",
7
+ "type": "module",
8
+ "exports": {
9
+ ".": "./src/index.ts",
10
+ "./config": "./src/config.ts",
11
+ "./styles/theme.css": "./src/styles/theme.css",
12
+ "./overrides/Header.astro": "./src/overrides/Header.astro",
13
+ "./overrides/PageFrame.astro": "./src/overrides/PageFrame.astro",
14
+ "./overrides/SiteTitle.astro": "./src/overrides/SiteTitle.astro",
15
+ "./overrides/Pagination.astro": "./src/overrides/Pagination.astro",
16
+ "./overrides/PageTitle.astro": "./src/overrides/PageTitle.astro",
17
+ "./overrides/Hero.astro": "./src/overrides/Hero.astro",
18
+ "./overrides/MobileTableOfContents.astro": "./src/overrides/MobileTableOfContents.astro",
19
+ "./overrides/Footer.astro": "./src/overrides/Footer.astro",
20
+ "./overrides/ThemeSelect.astro": "./src/overrides/ThemeSelect.astro",
21
+ "./overrides/ThemeProvider.astro": "./src/overrides/ThemeProvider.astro"
22
+ },
23
+ "scripts": {},
24
+ "keywords": [
25
+ "starlight",
26
+ "theme",
27
+ "bejamas",
28
+ "bejamas/ui",
29
+ "astro",
30
+ "astro-component",
31
+ "withastro"
32
+ ],
33
+ "repository": {
34
+ "type": "git",
35
+ "url": "https://github.com/bejamas/ui.git",
36
+ "directory": "packages/starlight-theme-bejamas"
37
+ },
38
+ "bugs": "https://github.com/bejamas/ui/issues",
39
+ "peerDependencies": {
40
+ "@astrojs/starlight": ">=0.33.0",
41
+ "astro": ">=5.5.0"
42
+ },
43
+ "dependencies": {
44
+ "@expressive-code/plugin-line-numbers": "^0.41.3",
45
+ "@fontsource-variable/inter": "^5.2.8",
46
+ "@fontsource/inter": "^5.2.8",
47
+ "@lucide/astro": "^0.545.0"
48
+ }
49
+ }
package/src/config.ts ADDED
@@ -0,0 +1,50 @@
1
+ import type { AstroBuiltinAttributes } from "astro";
2
+ import type { HTMLAttributes } from "astro/types";
3
+ import { z } from "astro/zod";
4
+
5
+ const linkHTMLAttributesSchema = z.record(
6
+ z.union([z.string(), z.number(), z.boolean(), z.undefined()])
7
+ ) as z.Schema<
8
+ Omit<HTMLAttributes<"a">, keyof AstroBuiltinAttributes | "children">
9
+ >;
10
+
11
+ // eslint-disable-next-line ts/explicit-function-return-type
12
+ const LinkItemHTMLAttributesSchema = () => linkHTMLAttributesSchema.default({});
13
+
14
+ const navLinkSchema = z.object({
15
+ /**
16
+ * An optional badge to display next to the topic label.
17
+ *
18
+ * This option accepts the same configuration as the Starlight badge sidebar item configuration.
19
+ * @see https://starlight.astro.build/guides/sidebar/#badges
20
+ */
21
+ badge: z.string().optional(),
22
+ /**
23
+ * The topic label visible at the top of the sidebar.
24
+ *
25
+ * The value can be a string, or for multilingual sites, an object with values for each different locale. When using
26
+ * the object form, the keys must be BCP-47 tags (e.g. en, fr, or zh-CN).
27
+ */
28
+ label: z.union([z.string(), z.record(z.string())]),
29
+ /**
30
+ * The link to the topic’s content which an be a relative link to local files or the full URL of an external page.
31
+ *
32
+ * For internal links, the link can either be a page included in the items array or a different page acting as the
33
+ * topic’s landing page.
34
+ */
35
+ href: z.string(),
36
+ /** HTML attributes to add to the link item. */
37
+ attrs: LinkItemHTMLAttributesSchema(),
38
+ });
39
+
40
+ export const StarlightThemeBejamasConfigSchema = z.object({
41
+ nav: z.array(navLinkSchema).optional(),
42
+ components: z.record(z.string()).optional(),
43
+ });
44
+
45
+ export type StarlightThemeBejamasUserConfig = z.input<
46
+ typeof StarlightThemeBejamasConfigSchema
47
+ >;
48
+ export type StarlightThemeBejamasConfig = z.output<
49
+ typeof StarlightThemeBejamasConfigSchema
50
+ >;
package/src/env.d.ts ADDED
@@ -0,0 +1,16 @@
1
+ /// <reference path="./virtual-modules.d.ts" />
2
+ /// <reference path="./virtual-internal.d.ts" />
3
+
4
+ import type { I18nT } from "@astrojs/starlight/utils/createTranslationSystem";
5
+ import type { StarlightRouteData } from "@astrojs/starlight/utils/routing/types";
6
+
7
+ declare global {
8
+ namespace App {
9
+ interface Locals {
10
+ t: I18nT;
11
+ starlightRoute: StarlightRouteData;
12
+ }
13
+ }
14
+ }
15
+
16
+ export {};
@@ -0,0 +1,18 @@
1
+ declare global {
2
+ interface Window {
3
+ StarlightThemeProvider?: {
4
+ updatePickers: (theme?: string) => void;
5
+ };
6
+ }
7
+
8
+ const StarlightThemeProvider: {
9
+ updatePickers: (theme?: string) => void;
10
+ };
11
+
12
+ namespace App {
13
+ interface Locals {
14
+ t: I18nT;
15
+ starlightRoute: StarlightRouteData;
16
+ }
17
+ }
18
+ }
package/src/index.ts ADDED
@@ -0,0 +1,159 @@
1
+ import type {
2
+ StarlightPlugin,
3
+ StarlightUserConfig,
4
+ } from "@astrojs/starlight/types";
5
+ import type { AstroIntegration, AstroIntegrationLogger } from "astro";
6
+
7
+ import { createInlineSvgUrl } from "@astrojs/starlight/expressive-code";
8
+
9
+ import {
10
+ StarlightThemeBejamasConfigSchema,
11
+ type StarlightThemeBejamasUserConfig,
12
+ } from "./config";
13
+ import { vitePluginStarlightThemeBejamas } from "./lib/vite";
14
+ // import { pluginLineNumbers } from "@expressive-code/plugin-line-numbers";
15
+
16
+ export default function starlightThemeBejamas(
17
+ userConfig: StarlightThemeBejamasUserConfig,
18
+ ): StarlightPlugin {
19
+ const parsedConfig = StarlightThemeBejamasConfigSchema.safeParse(userConfig);
20
+
21
+ if (!parsedConfig.success) {
22
+ throw new Error(
23
+ `The provided plugin configuration is invalid.\n${parsedConfig.error.issues
24
+ .map((issue: { message: string }) => issue.message)
25
+ .join("\n")}`,
26
+ );
27
+ }
28
+
29
+ const config = parsedConfig.data;
30
+
31
+ return {
32
+ name: "starlight-theme-bejamas-plugin",
33
+ hooks: {
34
+ "config:setup": function ({
35
+ config: starlightConfig,
36
+ logger,
37
+ updateConfig,
38
+ addIntegration,
39
+ }: {
40
+ config: StarlightUserConfig;
41
+ logger: AstroIntegrationLogger;
42
+ updateConfig: (config: StarlightUserConfig) => void;
43
+ addIntegration: (integration: AstroIntegration) => void;
44
+ }) {
45
+ const userExpressiveCodeConfig =
46
+ starlightConfig.expressiveCode === false ||
47
+ starlightConfig.expressiveCode === true
48
+ ? {}
49
+ : starlightConfig.expressiveCode;
50
+
51
+ // starlightConfig.plugins?.push(
52
+ // pluginLineNumbers({
53
+ // showLineNumbers: true,
54
+ // }),
55
+ // );
56
+
57
+ const componentOverrides: typeof config.components = {};
58
+
59
+ type OverridableComponent =
60
+ | "Header"
61
+ | "PageFrame"
62
+ | "SiteTitle"
63
+ | "Pagination"
64
+ | "PageTitle"
65
+ | "Hero"
66
+ | "MobileTableOfContents"
67
+ | "Footer"
68
+ | "ThemeSelect"
69
+ | "ThemeProvider";
70
+
71
+ const overridableComponents: OverridableComponent[] = [
72
+ "Header",
73
+ "PageFrame",
74
+ "SiteTitle",
75
+ "Pagination",
76
+ "PageTitle",
77
+ "Hero",
78
+ "MobileTableOfContents",
79
+ "Footer",
80
+ "ThemeSelect",
81
+ "ThemeProvider",
82
+ ];
83
+
84
+ for (const component of overridableComponents) {
85
+ if (config.components?.[component]) {
86
+ logger.warn(
87
+ `It looks like you already have a \`${component}\` component override in your Starlight configuration.`,
88
+ );
89
+ } else {
90
+ componentOverrides[component] =
91
+ `starlight-theme-bejamas/overrides/${component}.astro`;
92
+ }
93
+ }
94
+
95
+ updateConfig({
96
+ components: {
97
+ ...componentOverrides,
98
+ ...config.components,
99
+ },
100
+ customCss: [
101
+ "@fontsource/inter/400.css",
102
+ "@fontsource/inter/500.css",
103
+ "@fontsource/inter/700.css",
104
+ ...(starlightConfig.customCss ?? []),
105
+ "starlight-theme-bejamas/styles/theme.css",
106
+ ],
107
+ expressiveCode:
108
+ starlightConfig.expressiveCode === false
109
+ ? false
110
+ : {
111
+ themes: ["github-dark-default", "github-light-default"],
112
+ ...userExpressiveCodeConfig,
113
+ styleOverrides: {
114
+ codeBackground: "var(--code-background)",
115
+ borderWidth: "0px",
116
+ borderRadius: "calc(var(--radius) + 4px)",
117
+ gutterBorderWidth: "0px",
118
+ ...userExpressiveCodeConfig?.styleOverrides,
119
+ frames: {
120
+ editorBackground: "var(--code-background)",
121
+ terminalBackground: "var(--code-background)",
122
+ copyIcon: createInlineSvgUrl(
123
+ `<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-clipboard"><rect width="8" height="4" x="8" y="2" rx="1" ry="1"></rect><path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"></path></svg>`,
124
+ ),
125
+ ...userExpressiveCodeConfig?.styleOverrides?.frames,
126
+ },
127
+ textMarkers: {
128
+ markBackground: "var(--mark-background)",
129
+ markBorderColor: "var(--border)",
130
+ ...userExpressiveCodeConfig?.styleOverrides?.textMarkers,
131
+ },
132
+ },
133
+ defaultProps: {
134
+ showLineNumbers: false,
135
+ overridesByLang: {
136
+ astro: {
137
+ showLineNumbers: true,
138
+ },
139
+ },
140
+ },
141
+ },
142
+ });
143
+
144
+ addIntegration({
145
+ name: "starlight-theme-bejamas-integration",
146
+ hooks: {
147
+ "astro:config:setup": ({ updateConfig }) => {
148
+ updateConfig({
149
+ vite: {
150
+ plugins: [vitePluginStarlightThemeBejamas(config)],
151
+ },
152
+ });
153
+ },
154
+ },
155
+ });
156
+ },
157
+ },
158
+ };
159
+ }
@@ -0,0 +1,6 @@
1
+ import { type ClassValue, clsx } from "clsx";
2
+ import { twMerge } from "tailwind-merge";
3
+
4
+ export function cn(...inputs: ClassValue[]) {
5
+ return twMerge(clsx(inputs));
6
+ }
@@ -0,0 +1,62 @@
1
+ import type { ViteUserConfig } from "astro";
2
+ import type { StarlightThemeBejamasConfig } from "../config";
3
+
4
+ export function vitePluginStarlightThemeBejamas(
5
+ config: StarlightThemeBejamasConfig,
6
+ ): VitePlugin {
7
+ const moduleId = "virtual:starlight-theme-bejamas/user-config";
8
+ const resolvedModuleId = `\0${moduleId}`;
9
+ const moduleContent = `export default ${JSON.stringify(config)}`;
10
+
11
+ const componentsPrefix = "virtual:starlight-theme-bejamas/components/";
12
+ const resolvedComponentsPrefix = `\0${componentsPrefix}`;
13
+
14
+ return {
15
+ name: "vite-plugin-starlight-theme-bejamas",
16
+ load(id) {
17
+ if (id === resolvedModuleId) {
18
+ return moduleContent;
19
+ }
20
+
21
+ if (id.startsWith(resolvedComponentsPrefix)) {
22
+ const componentId = id.slice(resolvedComponentsPrefix.length);
23
+ const componentName = componentId.replace(/\.astro$/, "");
24
+ const target = config.components?.[componentName];
25
+
26
+ if (!target) {
27
+ return `export default (()=>{ throw new Error(\"starlight-theme-bejamas: No component mapping found for '${componentName}'. Add it under 'components' in your starlightThemeBejamas config.\"); })()`;
28
+ }
29
+
30
+ // Check if target is a barrel import (no .astro extension) or old-style file import
31
+ const isBarrelImport = !target.endsWith(".astro");
32
+
33
+ if (isBarrelImport) {
34
+ // For barrel imports, the component is exported as a named export in PascalCase
35
+ // Convert componentName (e.g., 'button') to PascalCase (e.g., 'Button')
36
+ const pascalCaseName = componentName.charAt(0).toUpperCase() + componentName.slice(1);
37
+ return `export { ${pascalCaseName} as default, ${pascalCaseName} } from "${target}"; export * from "${target}";`;
38
+ }
39
+
40
+ // Old pattern: .astro file with default export
41
+ return `export { default } from "${target}"; export * from "${target}";`;
42
+ }
43
+
44
+ return undefined;
45
+ },
46
+ resolveId(id) {
47
+ if (id === moduleId) {
48
+ return resolvedModuleId;
49
+ }
50
+
51
+ if (id.startsWith(componentsPrefix)) {
52
+ const componentId = id.slice(componentsPrefix.length);
53
+ const componentName = componentId.replace(/\.astro$/, "");
54
+ return `${resolvedComponentsPrefix}${componentName}`;
55
+ }
56
+
57
+ return undefined;
58
+ },
59
+ };
60
+ }
61
+
62
+ type VitePlugin = NonNullable<ViteUserConfig["plugins"]>[number];
@@ -0,0 +1,130 @@
1
+ ---
2
+ import EditLink from "virtual:starlight/components/EditLink";
3
+ import LastUpdated from "virtual:starlight/components/LastUpdated";
4
+ import Pagination from "virtual:starlight/components/Pagination";
5
+ import config from "virtual:starlight/user-config";
6
+ ---
7
+
8
+ <footer class="sl-flex footer-wide">
9
+ <div class="meta sl-flex">
10
+ <EditLink />
11
+ <LastUpdated />
12
+ </div>
13
+ <Pagination />
14
+ <div class="fade"></div>
15
+ </footer>
16
+
17
+ {
18
+ config.credits && (
19
+ <a class="kudos sl-flex footer-wide" href="https://ui.bejamas.com">
20
+ Built at Bejamas
21
+ </a>
22
+ )
23
+ }
24
+
25
+ <style>
26
+ @layer starlight.core {
27
+ .footer-wide {
28
+ width: calc(
29
+ 100% + calc(var(--sl-content-pad-x) * 2) + calc(var(--spacing) * 2)
30
+ );
31
+ margin-inline: calc(var(--spacing) * -1 - var(--sl-content-pad-x));
32
+ padding-inline: calc(var(--sl-content-pad-x) + var(--spacing));
33
+ }
34
+
35
+ footer {
36
+ flex-direction: column;
37
+ gap: 1.5rem;
38
+ position: sticky;
39
+ bottom: 0;
40
+ background: linear-gradient(to top, var(--background), transparent);
41
+ padding-block: calc(var(--spacing) * 3);
42
+ z-index: 10;
43
+ }
44
+
45
+ @media (min-width: 50rem) {
46
+ footer {
47
+ position: relative;
48
+ background: transparent;
49
+ }
50
+ .meta {
51
+ display: flex;
52
+ }
53
+ .kudos {
54
+ margin-bottom: calc(var(--spacing) * -10);
55
+ }
56
+ }
57
+
58
+ .meta {
59
+ gap: 0.75rem 3rem;
60
+ justify-content: space-between;
61
+ flex-wrap: wrap;
62
+ margin-top: 3rem;
63
+ font-size: var(--sl-text-sm);
64
+ color: var(--sl-color-gray-3);
65
+ display: none;
66
+ }
67
+
68
+ .meta > :global(p:only-child) {
69
+ margin-inline-start: auto;
70
+ }
71
+
72
+ .kudos {
73
+ align-items: center;
74
+ gap: 0.5em;
75
+ margin-block: 0;
76
+ font-size: var(--sl-text-xs);
77
+ text-decoration: none;
78
+ color: var(--muted-foreground);
79
+ justify-content: center;
80
+ padding-top: calc(var(--spacing) * 12);
81
+ padding-bottom: calc(var(--spacing) * 10);
82
+ background-color: var(--background);
83
+ justify-content: center;
84
+ }
85
+ .kudos:hover {
86
+ color: var(--foreground);
87
+ }
88
+
89
+ @media (min-width: 50rem) {
90
+ .kudos {
91
+ background-color: transparent;
92
+ }
93
+ }
94
+
95
+ .fade {
96
+ --blur: 4px;
97
+ --stop: 50%;
98
+ --height: 72px;
99
+ position: absolute;
100
+ pointer-events: none;
101
+ width: 100%;
102
+ height: var(--height);
103
+ user-select: none;
104
+ -webkit-user-select: none;
105
+ left: 0;
106
+ -webkit-backdrop-filter: blur(var(--blur));
107
+ backdrop-filter: blur(var(--blur));
108
+
109
+ background: linear-gradient(to bottom, transparent, var(--background));
110
+ mask-image: linear-gradient(
111
+ to top,
112
+ var(--background) var(--stop),
113
+ transparent
114
+ );
115
+ bottom: 0;
116
+ }
117
+
118
+ @media (min-width: 50rem) {
119
+ .fade {
120
+ display: none;
121
+ }
122
+ }
123
+ }
124
+
125
+ @layer starlight.components {
126
+ .kudos :global(svg) {
127
+ color: var(--sl-color-orange);
128
+ }
129
+ }
130
+ </style>
@@ -0,0 +1,153 @@
1
+ ---
2
+ import config from "virtual:starlight/user-config";
3
+
4
+ import LanguageSelect from "virtual:starlight/components/LanguageSelect";
5
+ import Search from "virtual:starlight/components/Search";
6
+ import SiteTitle from "virtual:starlight/components/SiteTitle";
7
+ import SocialIcons from "virtual:starlight/components/SocialIcons";
8
+ import ThemeSelect from "virtual:starlight/components/ThemeSelect";
9
+
10
+ import options from "virtual:starlight-theme-bejamas/user-config";
11
+
12
+ import { Button } from "virtual:starlight-theme-bejamas/components/button";
13
+ /**
14
+ * Render the `Search` component if Pagefind is enabled or the default search component has been overridden.
15
+ */
16
+ const shouldRenderSearch =
17
+ config.pagefind ||
18
+ config.components.Search !== "@astrojs/starlight/components/Search.astro";
19
+
20
+ /**
21
+ * Render the `nav` items if they are defined.
22
+ */
23
+
24
+ const shouldRenderNav = options.nav && options.nav.length > 0;
25
+ ---
26
+
27
+ <div class="header">
28
+ <div class="sl-bejamas-header-title">
29
+ <SiteTitle />
30
+ {
31
+ shouldRenderNav && (
32
+ <nav class="sl-bejamas-main-nav">
33
+ <ul class="gap-1 flex items-center">
34
+ {options.nav.map((item) => (
35
+ <li>
36
+ <Button as="a" variant="ghost" href={item.href}>
37
+ {item.label}
38
+ </Button>
39
+ </li>
40
+ ))}
41
+ </ul>
42
+ </nav>
43
+ )
44
+ }
45
+ </div>
46
+ <div class="sl-flex sl-bejamas-header-search sl-justify-end print:hidden">
47
+ {shouldRenderSearch && <Search />}
48
+ </div>
49
+ <div class="sl-hidden md:sl-flex print:hidden right-group">
50
+ <div class="sl-flex social-icons">
51
+ <SocialIcons />
52
+ </div>
53
+ <ThemeSelect />
54
+ <LanguageSelect />
55
+ </div>
56
+ </div>
57
+
58
+ <style>
59
+ @layer bejamas {
60
+ .sl-bejamas-header-title {
61
+ display: flex;
62
+ align-items: center;
63
+ gap: 1.25rem;
64
+ }
65
+
66
+ .sl-bejamas-header-search {
67
+ margin-left: auto;
68
+ }
69
+
70
+ .header {
71
+ display: flex;
72
+ gap: var(--sl-nav-gap);
73
+ justify-content: space-between;
74
+ align-items: center;
75
+ height: 100%;
76
+ position: relative;
77
+ z-index: 10;
78
+ }
79
+
80
+ .sl-bejamas-main-nav {
81
+ display: none;
82
+ }
83
+
84
+ @media (min-width: 50rem) {
85
+ .sl-bejamas-main-nav {
86
+ display: block;
87
+ }
88
+ }
89
+
90
+ .sl-justify-end {
91
+ justify-content: flex-end;
92
+ }
93
+
94
+ .title-wrapper {
95
+ /* Prevent long titles overflowing and covering the search and menu buttons on narrow viewports. */
96
+ overflow: clip;
97
+ /* Avoid clipping focus ring around link inside title wrapper. */
98
+ padding: 0.25rem;
99
+ margin: -0.25rem;
100
+ min-width: 0;
101
+ }
102
+
103
+ .right-group,
104
+ .social-icons {
105
+ gap: 1rem;
106
+ align-items: center;
107
+ }
108
+ .social-icons::after {
109
+ content: "";
110
+ height: 2rem;
111
+ border-inline-end: 1px solid var(--sl-color-gray-5);
112
+ }
113
+
114
+ @media (min-width: 64rem) {
115
+ :global(:root[data-has-sidebar]) {
116
+ --__sidebar-pad: calc(2 * var(--sl-nav-pad-x));
117
+ }
118
+ :global(:root:not([data-has-toc])) {
119
+ --__toc-width: 0rem;
120
+ }
121
+ .header {
122
+ --__sidebar-width: max(
123
+ 0rem,
124
+ var(--sl-content-inline-start, 0rem) - var(--sl-nav-pad-x)
125
+ );
126
+ --__main-column-fr: calc(
127
+ (
128
+ 100% + var(--__sidebar-pad, 0rem) -
129
+ var(--__toc-width, var(--sl-sidebar-width)) -
130
+ (2 * var(--__toc-width, var(--sl-nav-pad-x))) -
131
+ var(--sl-content-inline-start, 0rem) - var(--sl-content-width)
132
+ ) /
133
+ 2
134
+ );
135
+ display: grid;
136
+ grid-template-columns:
137
+ /* 1 (site title): runs up until the main content column’s left edge or the width of the title, whichever is the largest */
138
+ minmax(
139
+ calc(
140
+ var(--__sidebar-width) +
141
+ max(0rem, var(--__main-column-fr) - var(--sl-nav-gap))
142
+ ),
143
+ auto
144
+ )
145
+ /* 2 (search box): all free space that is available. */
146
+ 1fr
147
+ /* 3 (right items): use the space that these need. */
148
+ auto;
149
+ align-content: center;
150
+ }
151
+ }
152
+ }
153
+ </style>