Skip to content

Commit

Permalink
Create "hidden" config option for default theme
Browse files Browse the repository at this point in the history
Hidden (as in not included in default config file) is that if falls under advanced and specific usage. If the default theme is changed, you would need to make sure all Blade views are compatible, and at that point I expect you have already published the views, and can then see the option there.
  • Loading branch information
caendesilva committed May 30, 2022
1 parent 332a992 commit a641ddf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion resources/views/layouts/head.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@

@if(Hyde::features('darkmode'))
{{-- Check the local storage for theme preference to avoid FOUC --}}
<meta id="meta-color-scheme" name="color-scheme" content="light">
<meta id="meta-color-scheme" name="color-scheme" content="{{ config('hyde.default_color_scheme', 'light') }}">
<script>if (localStorage.getItem('color-theme') === 'dark' || (!('color-theme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)) { document.documentElement.classList.add('dark'); document.getElementById('meta-color-scheme').setAttribute('content', 'dark');} else { document.documentElement.classList.remove('dark') } </script>
@endif

0 comments on commit a641ddf

Please sign in to comment.