From b1c87474b874af4e0d7fece16242683a781903bb Mon Sep 17 00:00:00 2001 From: mergehez Date: Tue, 1 Oct 2024 16:37:32 +0200 Subject: [PATCH] added dark mode support --- resources/css/app.css | 4 ++++ resources/js/Components/A.jsx | 2 +- resources/js/Components/Code.jsx | 2 +- resources/js/Components/H1.jsx | 2 +- resources/js/Components/H2.jsx | 2 +- resources/js/Components/H3.jsx | 2 +- resources/js/Components/Layout.jsx | 24 ++++++++++++------------ resources/js/Components/Nav.jsx | 6 +++--- resources/js/Components/Strong.jsx | 2 +- resources/js/Pages/error-handling.jsx | 2 +- tailwind.config.js | 2 +- 11 files changed, 27 insertions(+), 23 deletions(-) diff --git a/resources/css/app.css b/resources/css/app.css index 892af9a1..4f98a94b 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -1,5 +1,9 @@ @tailwind base; +html{ + color-scheme: dark light; +} + /* Fonts */ @font-face { diff --git a/resources/js/Components/A.jsx b/resources/js/Components/A.jsx index bbdbb27f..bb9d7ff7 100644 --- a/resources/js/Components/A.jsx +++ b/resources/js/Components/A.jsx @@ -1,7 +1,7 @@ import { Link } from '@inertiajs/react' export default function A({ color, ...props }) { - const classes = color === 'orange' ? 'text-orange-600 hover:text-orange-800' : 'text-blue-700 hover:text-orange-700' + const classes = color === 'orange' ? 'text-orange-600 hover:text-orange-800' : 'text-blue-700 dark:text-blue-500 hover:text-orange-700 hover:text-orange-500' return props.href.startsWith('http') || props.href.startsWith('#') ? ( ) : ( diff --git a/resources/js/Components/Code.jsx b/resources/js/Components/Code.jsx index e1bd281a..a1882a28 100644 --- a/resources/js/Components/Code.jsx +++ b/resources/js/Components/Code.jsx @@ -1,4 +1,4 @@ export default function Code({ color, ...props }) { - const bgClass = color === 'orange' ? 'bg-orange-300' : 'bg-gray-200' + const bgClass = color === 'orange' ? 'bg-orange-300' : 'bg-gray-200 dark:bg-gray-800/80' return } diff --git a/resources/js/Components/H1.jsx b/resources/js/Components/H1.jsx index bde6bdd9..0c3e4508 100644 --- a/resources/js/Components/H1.jsx +++ b/resources/js/Components/H1.jsx @@ -1,3 +1,3 @@ export default function H1(props) { - return

+ return

} diff --git a/resources/js/Components/H2.jsx b/resources/js/Components/H2.jsx index 10a9a2bb..51c3de75 100644 --- a/resources/js/Components/H2.jsx +++ b/resources/js/Components/H2.jsx @@ -12,7 +12,7 @@ export default function H2(props) {

) } diff --git a/resources/js/Components/H3.jsx b/resources/js/Components/H3.jsx index 29d34f5c..c866b869 100644 --- a/resources/js/Components/H3.jsx +++ b/resources/js/Components/H3.jsx @@ -12,7 +12,7 @@ export default function H3(props) {

) } diff --git a/resources/js/Components/Layout.jsx b/resources/js/Components/Layout.jsx index 79d8ee3b..f6deabe4 100644 --- a/resources/js/Components/Layout.jsx +++ b/resources/js/Components/Layout.jsx @@ -94,7 +94,7 @@ export default function Layout({ meta, children }) { {showMobileNav && ( -