|
@@ -16,9 +16,11 @@
|
|
|
document.head.appendChild(polyfillScriptTag);
|
|
|
}
|
|
|
|
|
|
- if(window.matchMedia('(prefers-color-scheme: dark)').matches || localStorage.getItem('theme') == 'dark'){
|
|
|
- document.documentElement.dataset.theme = 'dark';
|
|
|
- }
|
|
|
+ try {
|
|
|
+ if(window.matchMedia('(prefers-color-scheme: dark)').matches || localStorage.getItem('theme') == 'dark'){
|
|
|
+ document.documentElement.dataset.theme = 'dark';
|
|
|
+ }
|
|
|
+ } catch { };
|
|
|
<% end -%>
|
|
|
<% if Rails.configuration.assets.debug %>
|
|
|
<%= javascript_include_tag "application", nonce: true %>
|