Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
* bundles Infima by default. Infima is a CSS framework designed to
* work well for content-centric websites.
*/
code[class*="language-"],
pre[class*="language-"] {
transition: none !important;
}
header {
display: flex;
flex-wrap: wrap;
Expand Down
13 changes: 13 additions & 0 deletions src/theme/Layout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import ErrorPageContent from '@theme/ErrorPageContent';
import type {Props} from '@theme/Layout';
import styles from './styles.module.css';
import { useUTMPersistenceDocs } from '@site/src/utils/useUTMPersistenceDocs';
import Head from '@docusaurus/Head';

export default function Layout(props: Props): ReactNode {
const {
Expand Down Expand Up @@ -45,6 +46,18 @@ export default function Layout(props: Props): ReactNode {

return (
<LayoutProvider>
<Head>
<script
dangerouslySetInnerHTML={{
__html: `(function(){
const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
if (prefersDark) {
document.documentElement.setAttribute('data-theme', 'dark');
}
})();`,
}}
/>
</Head>
<PageMetadata title={title} description={description} />

<SkipToContent />
Expand Down
Loading