diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index 43cbad1fb..775e2a984 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -312,6 +312,16 @@ class UserController extends Controller return $this->changeListSort($id, $request, $type); } + /** + * Toggle dark mode for the current user. + */ + public function toggleDarkMode() + { + $enabled = setting()->getForCurrentUser('dark-mode-enabled', false); + setting()->putUser(user(), 'dark-mode-enabled', $enabled ? 'false' : 'true'); + return redirect()->back(); + } + /** * Update the stored section expansion preference for the given user. */ diff --git a/resources/icons/dark-mode.svg b/resources/icons/dark-mode.svg new file mode 100644 index 000000000..8b00d72a5 --- /dev/null +++ b/resources/icons/dark-mode.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/resources/icons/light-mode.svg b/resources/icons/light-mode.svg new file mode 100644 index 000000000..cf2961d2e --- /dev/null +++ b/resources/icons/light-mode.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/resources/sass/_lists.scss b/resources/sass/_lists.scss index 8165d532d..5eb672697 100644 --- a/resources/sass/_lists.scss +++ b/resources/sass/_lists.scss @@ -603,6 +603,9 @@ ul.pagination { li.border-bottom { border-bottom: 1px solid #DDD; } + li hr { + margin: $-xs 0; + } } // Books grid view diff --git a/resources/views/base.blade.php b/resources/views/base.blade.php index 0f43532fb..a5404a365 100644 --- a/resources/views/base.blade.php +++ b/resources/views/base.blade.php @@ -1,5 +1,7 @@ - +