-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Desktop: Accessibility: Improve scrollbar contrast #11708
Desktop: Accessibility: Improve scrollbar contrast #11708
Conversation
**Note**: Related to an issue mentioned in laurent22#11666
packages/lib/theme.ts
Outdated
@@ -97,7 +97,49 @@ const globalStyle = (() => { | |||
}; | |||
})(); | |||
|
|||
export function extraStyles(theme: Theme) { | |||
export const derivedColors = (theme: Theme) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since scrollbarThumbColor
is used in renderer/
, it needs to be available on mobile. As such, derived colors were refactored into a new derivedColors
function that can be used in app-mobile
's global-style.ts
.
@@ -137,14 +137,13 @@ export default function(theme: any, options: Options = null) { | |||
border: none; | |||
} | |||
::-webkit-scrollbar-thumb { | |||
background: rgba(100, 100, 100, 0.3); | |||
border-radius: 5px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: Setting border-radius
here is unnecessary (it's already set a few lines above).
The new name should clarify that derivedColors returns a copy of the given object **with** derived colors added.
|
||
// Uses a scrollbar with secondary colors. Should be used for content with | ||
// background matching joplin-background-color2. | ||
._scrollbar2 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_scrollbar2
follows the naming pattern for RSCSS helper classes. RSCSS also suggests including all helpers in a single file called helpers
. For now, _scrollbar2
is included in main.scss
(near the other scrollbar logic). If desired, I can move it to a new helpers.scss
file.
Summary
This pull request increases the scrollbar contrast, particularly in the sidebar, which has a dark background in light mode.
Fixes #8817 (which was originally fixed by #8831, though that fix was reverted).
Related to #10795 (WCAG 2.2 SC 1.4.3).
Screenshots
To-do