better scrollbars on macos

This commit is contained in:
CJ Pais 2026-03-18 20:26:02 +08:00
parent 075a588791
commit 012e066697
2 changed files with 14 additions and 5 deletions

View file

@ -62,17 +62,22 @@
}
}
/* Custom Scrollbar */
::-webkit-scrollbar {
/* macOS - tint native overlay scrollbar thumb */
:root[data-platform="macos"] {
scrollbar-color: var(--scrollbar-thumb) transparent;
}
/* Custom Scrollbar - only on Windows/Linux; macOS uses native overlay scrollbars */
:root:not([data-platform="macos"]) ::-webkit-scrollbar {
width: 14px;
height: 14px;
}
::-webkit-scrollbar-track {
:root:not([data-platform="macos"]) ::-webkit-scrollbar-track {
background: transparent;
}
::-webkit-scrollbar-thumb {
:root:not([data-platform="macos"]) ::-webkit-scrollbar-thumb {
background-color: var(--scrollbar-thumb);
border-radius: 20px;
border: 3px solid transparent;
@ -82,7 +87,7 @@
min-height: 32px;
}
::-webkit-scrollbar-thumb:hover {
:root:not([data-platform="macos"]) ::-webkit-scrollbar-thumb:hover {
background-color: var(--scrollbar-thumb-hover);
}

View file

@ -1,7 +1,11 @@
import React from "react";
import ReactDOM from "react-dom/client";
import { platform } from "@tauri-apps/plugin-os";
import App from "./App";
// Set platform before render so CSS can scope per-platform (e.g. scrollbar styles)
document.documentElement.dataset.platform = platform();
// Initialize i18n
import "./i18n";