From 34fdc82b502ce51e21750aa1bd4ef97b2a6fdda5 Mon Sep 17 00:00:00 2001 From: Agampreet Singh <68941022+agam778@users.noreply.github.com> Date: Wed, 8 May 2024 12:28:25 +0530 Subject: [PATCH] Add custom scrollbar to web contents --- app/main.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/app/main.js b/app/main.js index 3337cb0..4e3d041 100644 --- a/app/main.js +++ b/app/main.js @@ -289,6 +289,27 @@ app.on("web-contents-created", (event, contents) => { } } } + contents.insertCSS( + ` + ::-webkit-scrollbar { + width: 8px; + height: 8px; + } + + ::-webkit-scrollbar-track { + background: transparent; + } + + ::-webkit-scrollbar-thumb { + background: transparent; + border-radius: 5px; + } + + ::-webkit-scrollbar-thumb:hover { + background: #555; + } + ` + ); }); });