$list-group-hover-bg: rgba(var(--bs-emphasis-color-rgb), .075);
$enable-negative-margins: true;
-$color-mode-type: media-query;
--- /dev/null
+@use "common" with (
+ $color-mode-type: media-query
+);
--- /dev/null
+@use "common" with (
+ $color-mode-type: media-query
+);
+++ /dev/null
-@import "common";
--- /dev/null
+@use "common" with (
+ $color-mode-type: data
+);
--- /dev/null
+@use "common" with (
+ $color-mode-type: data
+);
+++ /dev/null
-@import "common";
end
end
- helper_method :preferred_editor
+ def preferred_site_color_scheme
+ if current_user
+ current_user.preferences.find_by(:k => "site.color_scheme")&.v || "auto"
+ else
+ "auto"
+ end
+ end
+
+ helper_method :preferred_editor, :preferred_site_color_scheme
def update_totp
if Settings.key?(:totp_key)
<%= javascript_include_tag "turbo", :type => "module" %>
<%= javascript_include_tag "application" %>
<%= javascript_include_tag "i18n/#{I18n.locale}" %>
- <%= stylesheet_link_tag "screen-#{dir}", :media => "screen" %>
+ <% if preferred_site_color_scheme == "auto" %>
+ <%= stylesheet_link_tag "screen-auto-#{dir}", :media => "screen" %>
+ <% else %>
+ <%= stylesheet_link_tag "screen-manual-#{dir}", :media => "screen" %>
+ <% end %>
<%= stylesheet_link_tag "print-#{dir}", :media => "print" %>
<%= stylesheet_link_tag "leaflet-all", :media => "screen, print" %>
<%= render :partial => "layouts/meta" %>
<!DOCTYPE html>
-<html lang="<%= I18n.locale %>" dir="<%= dir %>">
+<%= tag.html :lang => I18n.locale, :dir => dir, :data => { :bs_theme => (preferred_site_color_scheme if preferred_site_color_scheme != "auto") } do %>
<%= render :partial => "layouts/head" %>
<body class="<%= body_class %>">
<%= render :partial => "layouts/header" %>
<noscript><p><img src="<%= request.protocol %><%= Settings.matomo["location"] %>/matomo.php?idsite=<%= Settings.matomo["site"] %>" class="matomo" alt="" /></p></noscript>
<% end -%>
</body>
-</html>
+<% end %>