Skip to content
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

Conversation

personalizedrefrigerator
Copy link
Collaborator

@personalizedrefrigerator personalizedrefrigerator commented Jan 22, 2025

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

Theme Before After
Light before: the scrollbar in the dark-background sidebar is difficult to see after: the scrollbar in the dark-background sidebar is easier to see
Dark before/dark after/dark: Scrollbars are now slightly easier to see

To-do

@@ -97,7 +97,49 @@ const globalStyle = (() => {
};
})();

export function extraStyles(theme: Theme) {
export const derivedColors = (theme: Theme) => {
Copy link
Collaborator Author

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;
Copy link
Collaborator Author

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).


// Uses a scrollbar with secondary colors. Should be used for content with
// background matching joplin-background-color2.
._scrollbar2 {
Copy link
Collaborator Author

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.

@personalizedrefrigerator personalizedrefrigerator marked this pull request as ready for review January 22, 2025 18:21
@personalizedrefrigerator personalizedrefrigerator added desktop All desktop platforms accessibility Related to accessibility labels Jan 23, 2025
@personalizedrefrigerator personalizedrefrigerator merged commit 9854049 into laurent22:dev Jan 27, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility Related to accessibility desktop All desktop platforms
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Scrollbar thumb is barely visible in Light theme
1 participant