Browse Source

Refactor scrollbar styles handling

- fix Firefox >= 100 issue where the thin scrollbar becomes very very thin, i.e.
  don't use scrollbar-width:thin in Firefox
- remove separate width setting for dark mode
- move all scrollbar setting occurrences into one place
pull/8539/head
Aleksander Machniak 3 years ago
parent
commit
dc1c453d9c
  1. 47
      skins/elastic/styles/dark.less
  2. 40
      skins/elastic/styles/global.less
  3. 1
      skins/elastic/styles/variables.less
  4. 6
      skins/elastic/styles/widgets/editor.less
  5. 1
      skins/elastic/styles/widgets/jqueryui.less

47
skins/elastic/styles/dark.less

@ -12,41 +12,15 @@
@import (reference) "variables"; @import (reference) "variables";
html.dark-mode { html.dark-mode {
& when not (@scrollbar-dark-width = unset) {
scrollbar-color: @color-dark-scrollbar-thumb @color-dark-scrollbar-track;
scrollbar-width: @scrollbar-dark-width;
textarea,
select,
.popover-body,
.popupmenu,
.ui-dialog-content,
.frame-content,
.formcontent,
.table-responsive,
.table-responsive-sm,
.scroller {
// Firefox does not inherit scrollbar size from the html element
scrollbar-width: @scrollbar-dark-width;
}
&:not(.touch) {
::-webkit-scrollbar when (@scrollbar-dark-width = auto) {
// Note: If we do not set the width a default scrollbar is used in Chrome.
// And the custom colors set below do not work
width: 12px;
}
::-webkit-scrollbar when (@scrollbar-dark-width = thin) {
width: 6px;
}
scrollbar-color: @color-dark-scrollbar-thumb @color-dark-scrollbar-track;
::-webkit-scrollbar-track {
background-color: @color-dark-scrollbar-track;
}
&:not(.touch) {
::-webkit-scrollbar-track {
background-color: @color-dark-scrollbar-track;
}
::-webkit-scrollbar-thumb {
background-color: @color-dark-scrollbar-thumb;
}
::-webkit-scrollbar-thumb {
background-color: @color-dark-scrollbar-thumb;
} }
} }
@ -781,17 +755,11 @@ html.dark-mode {
} }
.tox-menu { .tox-menu {
scrollbar-width: @scrollbar-dark-width;
background-color: @color-dark-popover-background; background-color: @color-dark-popover-background;
border-color: @color-dark-popover-border; border-color: @color-dark-popover-border;
box-shadow: none; box-shadow: none;
} }
.tox-dialog__body-nav,
.tox-collection__group {
scrollbar-width: @scrollbar-dark-width;
}
.tox-collection__item-caret svg { .tox-collection__item-caret svg {
fill: @color-dark-font; fill: @color-dark-font;
} }
@ -985,7 +953,6 @@ html.dark-mode {
} }
.ui-menu { .ui-menu {
scrollbar-width: @scrollbar-dark-width;
background-color: @color-dark-popover-background; background-color: @color-dark-popover-background;
border-color: @color-dark-popover-border; border-color: @color-dark-popover-border;
box-shadow: none; box-shadow: none;

40
skins/elastic/styles/global.less

@ -99,21 +99,27 @@ a {
/* Scrollbar styles */ /* Scrollbar styles */
html when not (@scrollbar-width = unset) { html when not (@scrollbar-width = unset) {
scrollbar-color: @color-scrollbar-thumb @color-scrollbar-track;
scrollbar-width: @scrollbar-width;
textarea,
select,
.popover-body,
.popupmenu,
.ui-dialog-content,
.frame-content,
.formcontent,
.table-responsive,
.table-responsive-sm,
.scroller {
// Firefox does not inherit scrollbar size from the html element
// Ignore thin width setting for Firefox, it makes the scrollbar very very thin in Firefox >= 100
& when not (@scrollbar-width = thin) {
scrollbar-width: @scrollbar-width; scrollbar-width: @scrollbar-width;
textarea,
select,
.popover-body,
.popupmenu,
.ui-menu,
.ui-dialog-content,
.frame-content,
.formcontent,
.table-responsive,
.table-responsive-sm,
.tox-menu,
.tox-dialog__body-nav,
.tox-collection__group,
.scroller {
// Firefox does not inherit scrollbar size from the html element
scrollbar-width: @scrollbar-width;
}
} }
&:not(.touch) { &:not(.touch) {
@ -125,7 +131,13 @@ html when not (@scrollbar-width = unset) {
::-webkit-scrollbar when (@scrollbar-width = thin) { ::-webkit-scrollbar when (@scrollbar-width = thin) {
width: 6px; width: 6px;
} }
}
}
html {
scrollbar-color: @color-scrollbar-thumb @color-scrollbar-track;
&:not(.touch) {
::-webkit-scrollbar-track { ::-webkit-scrollbar-track {
background-color: @color-scrollbar-track; background-color: @color-scrollbar-track;
} }

1
skins/elastic/styles/variables.less

@ -55,7 +55,6 @@
// Scrollbars // Scrollbars
@scrollbar-width: thin; // 'auto' or 'thin' or 'unset' @scrollbar-width: thin; // 'auto' or 'thin' or 'unset'
@scrollbar-dark-width: thin; // 'auto' or 'thin' or 'unset'
// Additional icons // Additional icons
@icon-resize-corner: data-uri("image/svg+xml;charset=utf-8", "../images/corner-handle.svg"); // size: 16x16 @icon-resize-corner: data-uri("image/svg+xml;charset=utf-8", "../images/corner-handle.svg"); // size: 16x16

6
skins/elastic/styles/widgets/editor.less

@ -86,12 +86,6 @@ div.tox {
background-color: @color-dialog-overlay-background; background-color: @color-dialog-overlay-background;
} }
.tox-menu,
.tox-dialog__body-nav,
.tox-collection__group {
scrollbar-width: @scrollbar-width;
}
.tox-dialog__header { .tox-dialog__header {
height: (@layout-header-height - 1px); height: (@layout-header-height - 1px);
border-bottom: 1px solid @color-dialog-header-border; border-bottom: 1px solid @color-dialog-header-border;

1
skins/elastic/styles/widgets/jqueryui.less

@ -33,7 +33,6 @@
border-radius: .3rem; border-radius: .3rem;
z-index: 240; z-index: 240;
position: absolute; position: absolute;
scrollbar-width: @scrollbar-width;
.ui-state-active { .ui-state-active {
border: 0 !important; border: 0 !important;

Loading…
Cancel
Save