diff --git a/.prettierignore b/.prettierignore
index aeedd95d45f..8b0126b66ef 100644
--- a/.prettierignore
+++ b/.prettierignore
@@ -3,7 +3,9 @@
# Wrapped components are our own code, so they follow the repo's formatting.
src/theme/DocItem/Layout/index.tsx
src/theme/EditMetaRow/index.tsx
+src/theme/Icon/DarkMode/index.tsx
src/theme/Icon/Edit/index.tsx
+src/theme/Icon/LightMode/index.tsx
src/theme/Icon/Language/index.tsx
src/theme/Layout/index.tsx
src/theme/NavbarItem/LocaleDropdownNavbarItem/index.tsx
diff --git a/docusaurus.config.js b/docusaurus.config.js
index 0b3061a8f7b..150fdc3b38e 100644
--- a/docusaurus.config.js
+++ b/docusaurus.config.js
@@ -162,6 +162,7 @@ module.exports = {
],
colorMode: {
defaultMode: 'light',
+ respectPrefersColorScheme: true,
},
navbar: {
hideOnScroll: true,
diff --git a/src/styles/components/_theme-toggle.scss b/src/styles/components/_theme-toggle.scss
deleted file mode 100644
index 850ad8d9216..00000000000
--- a/src/styles/components/_theme-toggle.scss
+++ /dev/null
@@ -1,52 +0,0 @@
-[class^='toggle_'] {
- position: relative;
- padding: 0;
-
- display: flex;
- align-items: center;
- justify-content: center;
-
- [class^='toggleTrack'] {
- display: none;
- }
-
- input[type='checkbox'] {
- display: block;
- position: relative;
- height: 1.25rem;
- width: 1.25rem;
- clip: unset;
- cursor: pointer;
- }
-
- &::before {
- content: '';
- position: absolute;
- z-index: 1;
- pointer-events: none;
- top: 0;
- left: 0;
- width: 100%;
- height: 100%;
-
- background: var(--token-primary-bg-c);
- }
-
- &::after {
- content: '';
- width: 1rem;
- height: 1rem;
- display: block;
- pointer-events: none;
-
- position: absolute;
- z-index: 2;
- }
-}
-
-html[data-theme='light'] [class^='toggle_']::after {
- content: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwM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C0xLjY2YS43Ny43NyAwIDAgMSAwLTEuNTRoMS42NmEuNzcuNzcgMCAwIDEgMCAxLjU0Wk0yLjQzIDguNzdILjc3YS43Ny43NyAwIDEgMSAwLTEuNTRoMS42NmEuNzcuNzcgMCAxIDEgMCAxLjU0Wk0xMy4xMiAxMy44OGEuNzYuNzYgMCAwIDEtLjU1LS4yMmwtMS4xOC0xLjE4YS43Ny43NyAwIDAgMSAxLjA5LTEuMDlsMS4xOCAxLjE4YS43Ni43NiAwIDAgMS0uNTQgMS4zMVpNNC4wNiA0LjgzYS43Ni43NiAwIDAgMS0uNTQtLjIyTDIuMzQgMy40M2EuNzcuNzcgMCAwIDEgMS4wOS0xLjA5TDQuNiAzLjUyYS43Ny43NyAwIDAgMS0uNTUgMS4zMVpNOCAxMS41NWEzLjU1IDMuNTUgMCAxIDEgMC03LjEgMy41NSAzLjU1IDAgMCAxIDAgNy4xWiIKICAgIGZpbGw9IiNmZmZmZmYiIC8+Cjwvc3ZnPg==');
-}
diff --git a/src/styles/custom.scss b/src/styles/custom.scss
index b518dd5de32..f1133013798 100644
--- a/src/styles/custom.scss
+++ b/src/styles/custom.scss
@@ -21,7 +21,6 @@
@use './components/search';
@use './components/table';
@use './components/tabs';
-@use './components/theme-toggle';
@use './components/toc';
:root {
diff --git a/src/theme/Icon/DarkMode/index.tsx b/src/theme/Icon/DarkMode/index.tsx
new file mode 100644
index 00000000000..149f654cb33
--- /dev/null
+++ b/src/theme/Icon/DarkMode/index.tsx
@@ -0,0 +1,24 @@
+/**
+ * Original source:
+ * @link https://github.com/facebook/docusaurus/blob/v3.10.2/packages/docusaurus-theme-classic/src/theme/Icon/DarkMode/index.tsx
+ *
+ * Reason for overriding:
+ * - Changed the icon to Ionic's moon mark. The artwork is drawn on a 16x16
+ * grid, so only the `viewBox` differs from upstream; the rendered size still
+ * matches the light and system icons.
+ * - `currentColor` is kept from upstream so the icon inherits `--navbar-icon-link-c`.
+ */
+
+import React, {type ReactNode} from 'react';
+import type {Props} from '@theme/Icon/DarkMode';
+
+export default function IconDarkMode(props: Props): ReactNode {
+ return (
+
+ );
+}
diff --git a/src/theme/Icon/LightMode/index.tsx b/src/theme/Icon/LightMode/index.tsx
new file mode 100644
index 00000000000..8ea848270d0
--- /dev/null
+++ b/src/theme/Icon/LightMode/index.tsx
@@ -0,0 +1,24 @@
+/**
+ * Original source:
+ * @link https://github.com/facebook/docusaurus/blob/v3.10.2/packages/docusaurus-theme-classic/src/theme/Icon/LightMode/index.tsx
+ *
+ * Reason for overriding:
+ * - Changed the icon to Ionic's sun mark. The artwork is drawn on a 16x16
+ * grid, so only the `viewBox` differs from upstream; the rendered size still
+ * matches the dark and system icons.
+ * - `currentColor` is kept from upstream so the icon inherits `--navbar-icon-link-c`.
+ */
+
+import React, {type ReactNode} from 'react';
+import type {Props} from '@theme/Icon/LightMode';
+
+export default function IconLightMode(props: Props): ReactNode {
+ return (
+
+ );
+}