Skip to content

Commit

Permalink
feat: add global CSS for theme switching and update layout components
Browse files Browse the repository at this point in the history
  • Loading branch information
joao-vasconcelos committed Dec 30, 2024
1 parent d538d98 commit 7e71eb3
Show file tree
Hide file tree
Showing 8 changed files with 311 additions and 813 deletions.
20 changes: 20 additions & 0 deletions app/global.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/* * */
/* BODY */

body {
display: flex;
flex-direction: column;
min-height: 100vh;
}


/* * */
/* THEME SWITCH */

html.dark .theme-light {
display: none;
}

html.light .theme-dark {
display: none;
}
7 changes: 5 additions & 2 deletions app/layout.config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import type { BaseLayoutProps } from 'fumadocs-ui/layouts/shared';

import CMDarkLogo from '@/components/brand/CMDarkLogo';
import { IconBook2, IconWorld } from '@tabler/icons-react';
import Image from 'next/image';

/**
* Shared layout configurations
Expand All @@ -30,7 +30,10 @@ export const baseOptions: BaseLayoutProps = {
],
nav: {
title: (
<CMDarkLogo style={{ height: '2.5rem' }} />
<>
<Image alt="Carris Metropolitana" className="theme-light" height={40} src="/brands/cmet-light.svg" width={120} />
<Image alt="Carris Metropolitana" className="theme-dark" height={40} src="/brands/cmet-dark.svg" width={120} />
</>
),
},
};
4 changes: 3 additions & 1 deletion app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import 'fumadocs-ui/style.css';
import { RootProvider } from 'fumadocs-ui/provider';
import { Inter } from 'next/font/google';

import './global.css';

/* * */

const inter = Inter({
Expand All @@ -17,7 +19,7 @@ const inter = Inter({
export default function Layout({ children }: { children: ReactNode }) {
return (
<html className={inter.className} lang="en" suppressHydrationWarning>
<body style={{ display: 'flex', flexDirection: 'column', minHeight: '100vh' }}>
<body>
<RootProvider search={{ options: { type: 'static' } }}>
{children}
</RootProvider>
Expand Down
116 changes: 0 additions & 116 deletions components/brand/CMDarkLogo.tsx

This file was deleted.

Loading

0 comments on commit 7e71eb3

Please sign in to comment.