You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-08-04 23:02:14 +03:00
use css scrollbar styles to make native scrollbars prettier
This commit is contained in:
@@ -64,3 +64,20 @@ body.mx_scrollbar_nooverlay {
|
|||||||
margin-right: calc(-1 * var(--scrollbar-width));
|
margin-right: calc(-1 * var(--scrollbar-width));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// style the native scrollbars ...
|
||||||
|
// ... standard css scrollbars (firefox at time of writing)
|
||||||
|
.mx_AutoHideScrollbar {
|
||||||
|
scrollbar-color: $scrollbar-thumb-color $scrollbar-track-color;
|
||||||
|
scrollbar-width: thin;
|
||||||
|
}
|
||||||
|
// or fallback for webkit browsers
|
||||||
|
::-webkit-scrollbar {
|
||||||
|
width: 6px;
|
||||||
|
background-color: $scrollbar-track-color;
|
||||||
|
}
|
||||||
|
|
||||||
|
::-webkit-scrollbar-thumb {
|
||||||
|
background-color: $scrollbar-thumb-color;
|
||||||
|
border-radius: 3px;
|
||||||
|
}
|
||||||
|
@@ -74,7 +74,9 @@ $strong-input-border-color: #656565;
|
|||||||
// used for UserSettings EditableText
|
// used for UserSettings EditableText
|
||||||
$input-underline-color: $primary-fg-color;
|
$input-underline-color: $primary-fg-color;
|
||||||
$input-fg-color: $primary-fg-color;
|
$input-fg-color: $primary-fg-color;
|
||||||
|
// scrollbars
|
||||||
|
$scrollbar-thumb-color: rgba(255, 255, 255, 0.2);
|
||||||
|
$scrollbar-track-color: transparent;
|
||||||
// context menus
|
// context menus
|
||||||
$menu-border-color: rgba(187, 187, 187, 0.5);
|
$menu-border-color: rgba(187, 187, 187, 0.5);
|
||||||
$menu-bg-color: #373737;
|
$menu-bg-color: #373737;
|
||||||
|
@@ -83,7 +83,9 @@ $strong-input-border-color: #c7c7c7;
|
|||||||
// used for UserSettings EditableText
|
// used for UserSettings EditableText
|
||||||
$input-underline-color: rgba(151, 151, 151, 0.5);
|
$input-underline-color: rgba(151, 151, 151, 0.5);
|
||||||
$input-fg-color: rgba(74, 74, 74, 0.9);
|
$input-fg-color: rgba(74, 74, 74, 0.9);
|
||||||
|
// scrollbars
|
||||||
|
$scrollbar-thumb-color: rgba(0, 0, 0, 0.2);
|
||||||
|
$scrollbar-track-color: transparent;
|
||||||
// context menus
|
// context menus
|
||||||
$menu-border-color: #ebedf8;
|
$menu-border-color: #ebedf8;
|
||||||
$menu-bg-color: #fff;
|
$menu-bg-color: #fff;
|
||||||
|
@@ -79,7 +79,9 @@ $strong-input-border-color: #c7c7c7;
|
|||||||
// used for UserSettings EditableText
|
// used for UserSettings EditableText
|
||||||
$input-underline-color: rgba(151, 151, 151, 0.5);
|
$input-underline-color: rgba(151, 151, 151, 0.5);
|
||||||
$input-fg-color: rgba(74, 74, 74, 0.9);
|
$input-fg-color: rgba(74, 74, 74, 0.9);
|
||||||
|
// scrollbars
|
||||||
|
$scrollbar-thumb-color: rgba(0, 0, 0, 0.2);
|
||||||
|
$scrollbar-track-color: transparent;
|
||||||
// context menus
|
// context menus
|
||||||
$menu-border-color: rgba(187, 187, 187, 0.5);
|
$menu-border-color: rgba(187, 187, 187, 0.5);
|
||||||
$menu-bg-color: #f6f6f6;
|
$menu-bg-color: #f6f6f6;
|
||||||
|
@@ -20,6 +20,7 @@ import React from "react";
|
|||||||
// Copyright (c) Noel Delgado <pixelia.me@gmail.com> (pixelia.me)
|
// Copyright (c) Noel Delgado <pixelia.me@gmail.com> (pixelia.me)
|
||||||
function getScrollbarWidth(alternativeOverflow) {
|
function getScrollbarWidth(alternativeOverflow) {
|
||||||
const div = document.createElement('div');
|
const div = document.createElement('div');
|
||||||
|
div.className = 'mx_AutoHideScrollbar'; //to get width of css scrollbar
|
||||||
div.style.position = 'absolute';
|
div.style.position = 'absolute';
|
||||||
div.style.top = '-9999px';
|
div.style.top = '-9999px';
|
||||||
div.style.width = '100px';
|
div.style.width = '100px';
|
||||||
|
Reference in New Issue
Block a user