diff --git a/docs/astro/astro.config.mjs b/docs/astro/astro.config.mjs index b85d5219edf..af1306d3379 100644 --- a/docs/astro/astro.config.mjs +++ b/docs/astro/astro.config.mjs @@ -34,12 +34,13 @@ export default defineConfig({ }, integrations: [ starlight({ - title: "Docs", + title: "Slint Docs", logo: { light: "./src/assets/slint-logo-simple-light.webp", dark: "./src/assets/slint-logo-simple-dark.webp", + replacesTitle: true, }, - customCss: ["./src/styles/custom.css"], + customCss: ["./src/styles/custom.css", "./src/styles/theme.css"], components: { Footer: "./src/components/Footer.astro", diff --git a/docs/astro/src/components/Footer.astro b/docs/astro/src/components/Footer.astro index d1f8038e6c3..571471b693d 100644 --- a/docs/astro/src/components/Footer.astro +++ b/docs/astro/src/components/Footer.astro @@ -3,15 +3,23 @@ // SPDX-License-Identifier: MIT import type { Props } from "@astrojs/starlight/props"; import Default from "@astrojs/starlight/components/Footer.astro"; +const year = new Date().getFullYear(); --- -
- - -
-

Copyright © SixtyFPS GmbH

-
-
+ +
+

© {year} SixtyFPS GmbH

+ diff --git a/docs/astro/src/components/Header.astro b/docs/astro/src/components/Header.astro index 2546b5fd06c..8ab0712f6c4 100644 --- a/docs/astro/src/components/Header.astro +++ b/docs/astro/src/components/Header.astro @@ -7,7 +7,7 @@ import LanguageSelect from "@astrojs/starlight/components/LanguageSelect.astro"; import Search from "@astrojs/starlight/components/Search.astro"; import SiteTitle from "@astrojs/starlight/components/SiteTitle.astro"; import SocialIcons from "@astrojs/starlight/components/SocialIcons.astro"; -import ThemeSelect from "@astrojs/starlight/components/ThemeSelect.astro"; +import ThemeSelect from "./ThemeSelect.astro"; import VersionSelector from "./VersionSelector.astro"; --- diff --git a/docs/astro/src/components/ThemeSelect.astro b/docs/astro/src/components/ThemeSelect.astro new file mode 100644 index 00000000000..1e0d613a9ba --- /dev/null +++ b/docs/astro/src/components/ThemeSelect.astro @@ -0,0 +1,38 @@ +--- +// Copyright © SixtyFPS GmbH +// SPDX-License-Identifier: MIT +import type { Props } from "@astrojs/starlight/props"; +import { Icon } from "@astrojs/starlight/components"; +--- + + + + + + + \ No newline at end of file diff --git a/docs/astro/src/styles/theme.css b/docs/astro/src/styles/theme.css new file mode 100644 index 00000000000..6c09eb0b843 --- /dev/null +++ b/docs/astro/src/styles/theme.css @@ -0,0 +1,34 @@ +theme-switcher { + align-items: center; +} +.theme-selector-light, +.theme-selector-dark { + user-select: none; + z-index: 999999; + position: relative; + cursor: pointer; +} +.theme-selector-light:hover, +.theme-selector-dark:hover { + color: var(--sl-color-accent-high); +} +:root { + .theme-selector-light { + display: none; + } + .theme-selector-dark { + display: inline-block; + } +} +:root[data-theme="light"] { + .theme-selector-light { + display: inline-block; + } + .theme-selector-dark { + display: none; + } + .theme-selector-light:hover, + .theme-selector-dark:hover { + color: var(--sl-color-accent); + } +}