diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 4e1e673b377..db6a5b22f38 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -11,6 +11,7 @@ This serves two purposes: ### Added - Added support for using HTML comments to create Markdown code block filepath labels in https://github.com/hydephp/develop/pull/1693 +- Added a config option to disable the theme toggle buttons to automatically use browser settings in https://github.com/hydephp/develop/pull/1697 - You can now specify which path to open when using the `--open` option in the serve command in https://github.com/hydephp/develop/pull/1694 ### Changed diff --git a/config/hyde.php b/config/hyde.php index 333ba70b287..33d0ccc6140 100644 --- a/config/hyde.php +++ b/config/hyde.php @@ -483,4 +483,7 @@ 'hydefront_version' => \Hyde\Framework\Services\AssetService::HYDEFRONT_VERSION, 'hydefront_cdn_url' => \Hyde\Framework\Services\AssetService::HYDEFRONT_CDN_URL, + // Should the theme toggle buttons be displayed in the layouts? + 'theme_toggle_buttons' => true, + ]; diff --git a/docs/digging-deeper/customization.md b/docs/digging-deeper/customization.md index 8f8c455bc60..899d411a706 100644 --- a/docs/digging-deeper/customization.md +++ b/docs/digging-deeper/customization.md @@ -325,6 +325,20 @@ use \Hyde\Framework\Services\AssetService; 'hydefront_cdn_url' => AssetService::HYDEFRONT_CDN_URL, ``` +### `theme_toggle_buttons` + +>info This feature was added in HydePHP v1.7.0 + +This setting allows you to enable or disable the theme toggle buttons in the navigation menu. + +```php +// filepath config/hyde.php +'theme_toggle_buttons' => true, +``` + +If the `Feature::Darkmode` setting is disabled in the `features` array in the same file, this won't do anything, but if darkmode is enabled, +setting this setting to `false` will make so that the buttons will not show up in the app layout nor the documentation layout; +instead the appropriate color scheme will be automatically applied based on the browser system settings. ## Blade Views diff --git a/packages/framework/config/hyde.php b/packages/framework/config/hyde.php index 333ba70b287..33d0ccc6140 100644 --- a/packages/framework/config/hyde.php +++ b/packages/framework/config/hyde.php @@ -483,4 +483,7 @@ 'hydefront_version' => \Hyde\Framework\Services\AssetService::HYDEFRONT_VERSION, 'hydefront_cdn_url' => \Hyde\Framework\Services\AssetService::HYDEFRONT_CDN_URL, + // Should the theme toggle buttons be displayed in the layouts? + 'theme_toggle_buttons' => true, + ]; diff --git a/packages/framework/resources/views/components/navigation/theme-toggle-button.blade.php b/packages/framework/resources/views/components/navigation/theme-toggle-button.blade.php index 2b21c1f9528..3dece0c97cb 100644 --- a/packages/framework/resources/views/components/navigation/theme-toggle-button.blade.php +++ b/packages/framework/resources/views/components/navigation/theme-toggle-button.blade.php @@ -1,4 +1,4 @@ -@if(Features::hasDarkmode()) +@if(Features::hasDarkmode() && Features::hasThemeToggleButtons())