Skip to content

Commit

Permalink
[ui] Fix dark mode scrollbars (#26033)
Browse files Browse the repository at this point in the history
## Summary & Motivation

Fix scrollbars in dark mode.

- Use `dark` instead of `'dark'` as the color scheme value. This fixes
the main issue, where we're rendering light-mode browser controls. I'm
not sure if this has been broken since we shipped dark mode, or if
something recently changed. Either way, sorry for leaving it broken for
so long.
- Style the scrollbar to use our themed colors, instead of the
(mismatching) defaults.

<img width="1098" alt="Screenshot 2024-11-20 at 08 31 03"
src="https://github.com/user-attachments/assets/638d77b9-5add-4cc2-a2ba-0de7c2c68b40">

<img width="1098" alt="Screenshot 2024-11-20 at 08 31 18"
src="https://github.com/user-attachments/assets/f062f452-0e97-42db-9311-07ba0017626b">


## How I Tested These Changes

Change MacOS settings to show scrollbars in all cases. Load an asset
detail page, shrink the viewport to force scrollbars to appear.

Verify that they look correct (including themed colors) in both dark
mode and light mode.

## Changelog

[ui] Fix scrollbars in dark mode.
  • Loading branch information
hellendag authored Nov 20, 2024
1 parent db070bc commit 7360e30
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {css} from 'styled-components';

export const darkThemeColors = css`
--browser-color-scheme: 'dark';
--browser-color-scheme: dark;
--color-keyline-default: var(--color-translucent-gray15);
--color-link-default: var(--color-core-blue200);
--color-link-hover: var(--color-core-blue400);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const GlobalStyle = createGlobalStyle`
color-scheme: ${Colors.browserColorScheme()};
background-color: ${Colors.backgroundDefault()};
color: ${Colors.textDefault()};
scrollbar-color: ${Colors.accentGrayHover()} ${Colors.backgroundDefault()};
width: 100vw;
height: 100vh;
overflow: hidden;
Expand Down

2 comments on commit 7360e30

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for dagit-storybook ready!

✅ Preview
https://dagit-storybook-ayksva716-elementl.vercel.app

Built with commit 7360e30.
This pull request is being automatically deployed with vercel-action

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for dagit-core-storybook ready!

✅ Preview
https://dagit-core-storybook-hyhmjiqsl-elementl.vercel.app

Built with commit 7360e30.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.