1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-19 13:19:39 +02:00

Replaced Native Scrollbars with Tailwind Scrollbars on Windows (#1493)

* feat: scrollbar styling for windows browsers

* fix: lint
This commit is contained in:
Jestin Palamuttam 2024-11-23 01:57:07 +05:30 committed by GitHub
parent c8302a6d49
commit 571fc4db75
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 31 additions and 1 deletions

View file

@ -162,4 +162,20 @@
.scrollbar::-webkit-scrollbar-thumb:hover {
background: #a6a6a6;
}
}
/* Custom scrollbar implementation for Windows browsers */
.windows {
::-webkit-scrollbar {
width: 4px;
}
::-webkit-scrollbar-thumb {
background: #d6d6d6;
border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
background: #a6a6a6;
}
}

View file

@ -4,6 +4,8 @@ class ApplicationController < ActionController::Base
helper_method :require_upgrade?, :subscription_pending?
before_action :detect_os
private
def require_upgrade?
return false if self_hosted?
@ -24,4 +26,16 @@ class ApplicationController < ActionController::Base
"with_sidebar"
end
def detect_os
user_agent = request.user_agent
@os = case user_agent
when /Windows/i then "windows"
when /Macintosh/i then "mac"
when /Linux/i then "linux"
when /Android/i then "android"
when /iPhone|iPad/i then "ios"
else ""
end
end
end

View file

@ -1,5 +1,5 @@
<!DOCTYPE html>
<html class="h-full" lang="en">
<html class="h-full <%= @os %>" lang="en">
<head>
<title><%= content_for(:title) || "Maybe" %></title>